-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Install pacman script #3060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
daxgames
wants to merge
24
commits into
cmderdev:development
Choose a base branch
from
daxgames:install-pacman
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Install pacman script #3060
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
f604b06
update windows terminal, clink, and git
daxgames f4b8d08
update clink
daxgames de9402a
Merge remote-tracking branch 'origin/development-dax' into sources-up…
daxgames e4a6640
update sources
daxgames 58bbe78
x
daxgames f9d7972
Add install-pacman.sh
daxgames df0785d
Add a disclaimer
daxgames 83df88d
fixes for windows 10
daxgames 6431633
x
daxgames c2cdcfc
Merge remote-tracking branch 'origin/install-pacman' into install-pacman
daxgames be5b641
add installPacman switch to build.sh
daxgames ffe4700
Merge branch 'upstream-development' into install-pacman
daxgames de291de
Merge branch 'upstream-development' into install-pacman
daxgames 0dd8459
cleanup
daxgames a0aecb6
Fix CodeQL
daxgames 9b1e7a2
Fix CodeQL
daxgames 7da225a
Fix CodeQl
daxgames 2ffe72c
Merge remote-tracking branch 'upstream/development' into install-pacman
daxgames d842064
update Git
daxgames 79c0d6f
Merge remote-tracking branch 'upstream/development' into install-pacman
daxgames 4b80f51
Update help
daxgames 7dbe665
Merge remote-tracking branch 'upstream/development' into install-pacman
daxgames 983764b
Merge remote-tracking branch 'origin/install-pacman' into install-pacman
daxgames 7bda24a
Merge branch 'upstream-development' into install-pacman
daxgames File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,4 +37,4 @@ scripts/packer/iso/*.iso | |
| scripts/packer/packer_cache | ||
| scripts/packer/output-* | ||
| *.box | ||
|
|
||
| *.code-workspace | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Based on: https://github.com/mcgitty/pacman-for-git | ||
| # Dax T. Games Fork: https://github.com/daxgames/pacman-for-git | ||
|
|
||
| # Disclaimer: Use at your own risk. | ||
| # | ||
| # This script modifies system files and installs the pacman package manager into your Git for Windows environment. | ||
| # | ||
| # While it has been tested in various Git for Windows versions, there is always a risk of data loss or system instability when running scripts that alter executable files and shared libraries. | ||
| # | ||
| # Make sure to back up any important data before proceeding. | ||
| # | ||
| # Always review and understand scripts from external sources prior to execution. | ||
| export bin_source=${1:-https://github.com/daxgames/pacman-for-git/raw/refs/heads/main} | ||
| echo "Using binary source: $bin_source" | ||
| echo "Using HOME directory: $HOME" | ||
| read -rp "Press [Enter] to continue..." | ||
|
|
||
| if [[ "$HOSTTYPE" == "i686" ]]; then | ||
| pacman=( | ||
| pacman-6.0.0-4-i686.pkg.tar.zst | ||
| pacman-mirrors-20210703-1-any.pkg.tar.zst | ||
| msys2-keyring-1~20210213-2-any.pkg.tar.zst | ||
| ) | ||
|
|
||
| zstd=zstd-1.5.0-1-i686.pkg.tar.xz | ||
| zstd_win=https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-v1.5.5-win32.zip | ||
| else | ||
| pacman=( | ||
| pacman-6.0.1-18-x86_64.pkg.tar.zst | ||
| pacman-mirrors-20220205-1-any.pkg.tar.zst | ||
| msys2-keyring-1~20220623-1-any.pkg.tar.zst | ||
| ) | ||
|
|
||
| zstd=zstd-1.5.2-1-x86_64.pkg.tar.xz | ||
| zstd_win=https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-v1.5.5-win64.zip | ||
| fi | ||
|
|
||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| echo Downloading pacman files... | ||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| for f in "${pacman[@]}"; do | ||
| [[ -f "$HOME/Downloads/$f" ]] && continue | ||
| echo "Running: curl -sLkf -o \"$HOME/Downloads/$f\" \"${bin_source}/$f\"" | ||
| curl -sLkf -o "$HOME/Downloads/$f" "${bin_source}/$f" || exit 1 | ||
| done | ||
| echo -e "\n=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" | ||
|
|
||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| echo Downloading zstd binaries... | ||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| if [[ ! -f "$HOME/Downloads/$zstd" ]] ; then | ||
| echo "Running: curl -sLkf -o \"$HOME/Downloads/$zstd\" \"${bin_source}/$zstd\"" | ||
| curl -sLkf -o "$HOME/Downloads/$zstd" "${bin_source}/$zstd" || exit 1 | ||
| fi | ||
|
|
||
| if [[ ! -f "$HOME/Downloads/$(basename${zstd_win})" ]] ; then | ||
| echo "Running: curl -sLkf -o \"$HOME/Downloads/$(basename \"${zstd_win}\")\" \"$zstd_win\"" | ||
| curl -sLkf -o "$HOME/Downloads/$(basename "${zstd_win}")" "$zstd_win" || exit 1 | ||
| fi | ||
| echo -e "\n=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" | ||
|
|
||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| echo Downloading pacman.conf... | ||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| echo "Running: curl -Lk https://raw.githubusercontent.com/msys2/MSYS2-packages/7858ee9c236402adf569ac7cff6beb1f883ab67c/pacman/pacman.conf" | ||
| curl -sLk https://raw.githubusercontent.com/msys2/MSYS2-packages/7858ee9c236402adf569ac7cff6beb1f883ab67c/pacman/pacman.conf -o /etc/pacman.conf || exit 1 | ||
|
|
||
| pushd "$HOME/Downloads" | ||
| [[ -d "$(basename "${zstd_win}" | sed 's/\.zip$//')" ]] && \ | ||
| rm -rf "$(basename "${zstd_win}" | sed 's/\.zip$//')" | ||
| unzip "$HOME/Downloads/$(basename "${zstd_win}")" | ||
| export PATH="$PATH:$HOME/Downloads/$(basename "${zstd_win}" | sed 's/\.zip$//')" | ||
| popd | ||
| echo -e "\n=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" | ||
|
|
||
| cd / | ||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| echo Installing pacman files... | ||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| echo "Extracting zstd to /usr..." | ||
| tar x --xz -vf "$HOME/Downloads/$zstd" usr | ||
|
|
||
| for f in "${pacman[@]}"; do | ||
| echo "Extracting $f to /usr and /etc..." | ||
| tar x --zstd -vf "$HOME/Downloads/$f" usr etc 2>/dev/null | ||
| done | ||
| echo -e "\n=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" | ||
|
|
||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| echo Initializing pacman... | ||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| mkdir -p /var/lib/pacman | ||
| ln -sf "$(which gettext)" /usr/bin/ | ||
| pacman-key --init | ||
| pacman-key --populate msys2 | ||
| pacman -Syu --noconfirm --disable-download-timeout | ||
| echo -e "\n=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" | ||
|
|
||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| echo Getting package versions for the installed Git release | ||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| t=$(grep -E 'mingw-w64-[ix_0-9]+-git ' /etc/package-versions.txt) | ||
| echo "Found package version line: $t" | ||
|
|
||
| curl --help >/dev/null 2>&1 || { echo "ERROR: curl is not installed properly."; exit 1; } | ||
|
|
||
| echo "Getting commit ID that matches '$t' from github pacman-for-git..." | ||
| t=$(curl -sLk "${bin_source}/version-tags.txt" | grep "$t") | ||
| echo "Full line from version-tags.txt: '$t'" | ||
|
|
||
| [[ "$t" == "" ]] && echo "ERROR: Commit ID not logged in github pacman-for-git." && exit 1 | ||
| echo -e "Using commit ID: '${t##* }'" | ||
| echo -e "\n=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" | ||
|
|
||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| echo Downloading package database files for the installed Git release | ||
| echo =-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | ||
| b=64 && [[ "$t" == *-i686-* ]] && b=32 | ||
| URL="https://github.com/git-for-windows/git-sdk-$b/raw/${t##* }" | ||
| while read -r p v; do | ||
| d="/var/lib/pacman/local/$p-$v" | ||
| mkdir -p "$d" | ||
| echo "$d" | ||
|
|
||
| for f in desc files mtree; do | ||
| curl -fsSL "$URL$d/$f" -o "$d/$f" | ||
| done | ||
|
|
||
| [[ ! -f "$d/desc" ]] && rmdir "$d" && echo "Missing $d" | ||
| done < /etc/package-versions.txt | ||
| echo -e "\n=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daxgames
Added invalid indentation here accidentally, please remove
To avoid keeping track of a random version such as v1.5.5, I'm considering to apply some minor improvements