Skip to content

Commit

Permalink
Merge pull request #566 from dscho/let-pacman-helper-run-in-linux
Browse files Browse the repository at this point in the history
Let `pacman-helper.sh` run in Linux
  • Loading branch information
dscho committed Jul 4, 2024
2 parents 1b1a068 + 78ef4e3 commit 90a00a9
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions pacman-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ die () {
fifo_find="/var/tmp/disowned.find"
fifo_pacman="/var/tmp/disowned.pacman"

# MSYS2's mingw-w64-$arch-ca-certificates seem to lag behind ca-certificates
CURL_CA_BUNDLE=/usr/ssl/certs/ca-bundle.crt
export CURL_CA_BUNDLE

mode=
case "$1" in
fetch|add|remove|push|files|dirs|orphans|push_missing_signatures|file_exists|lock|unlock|break_lock|quick_add|sanitize_db)
Expand All @@ -57,7 +53,18 @@ upload)
;;
esac

this_script_dir="$(cygpath -am "${0%/*}")"
case "$(uname -s)" in
MSYS|MINGW*)
# MSYS2's mingw-w64-$arch-ca-certificates seem to lag behind ca-certificates
CURL_CA_BUNDLE=/usr/ssl/certs/ca-bundle.crt
export CURL_CA_BUNDLE

this_script_dir="$(cygpath -am "${0%/*}")"
;;
*)
this_script_dir="$(cd "$(dirname "$0")" && pwd -P)"
;;
esac
base_url=https://wingit.blob.core.windows.net
mirror=/var/local/pacman-mirror

Expand Down Expand Up @@ -152,21 +159,17 @@ fetch () {
;;
esac
test -f $filename ||
curl --cacert /usr/ssl/certs/ca-bundle.crt \
-sfLO $(arch_url $arch)/$filename ||
curl -sfLO $(arch_url $arch)/$filename ||
if test $? = 56
then
curl --cacert /usr/ssl/certs/ca-bundle.crt \
-sfLO $(arch_url $arch)/$filename
curl -sfLO $(arch_url $arch)/$filename
fi ||
die "Could not get $filename ($?)"
test -f $filename.sig ||
curl --cacert /usr/ssl/certs/ca-bundle.crt \
-sfLO $(arch_url $arch)/$filename.sig ||
curl -sfLO $(arch_url $arch)/$filename.sig ||
if test $? = 56
then
curl --cacert /usr/ssl/certs/ca-bundle.crt \
-sfLO $(arch_url $arch)/$filename.sig
curl -sfLO $(arch_url $arch)/$filename.sig
fi ||
die "Could not get $filename.sig ($?)"
test x86_64 = "$arch" || continue
Expand All @@ -189,21 +192,17 @@ fetch () {
;;
esac
test -f $filename ||
curl --cacert /usr/ssl/certs/ca-bundle.crt \
-sfLO $base_url/sources/$filename ||
curl -sfLO $base_url/sources/$filename ||
if test $? = 56
then
curl --cacert /usr/ssl/certs/ca-bundle.crt \
-sfLO $base_url/sources/$filename
curl -sfLO $base_url/sources/$filename
fi ||
die "Could not get $filename ($?)"
test -f $filename.sig ||
curl --cacert /usr/ssl/certs/ca-bundle.crt \
-sfLO $base_url/sources/$filename.sig ||
curl -sfLO $base_url/sources/$filename.sig ||
if test $? = 56
then
curl --cacert /usr/ssl/certs/ca-bundle.crt \
-sfLO $base_url/sources/$filename.sig
curl -sfLO $base_url/sources/$filename.sig
fi ||
die "Could not get $filename.sig ($?)")
done
Expand Down Expand Up @@ -409,14 +408,14 @@ push () {
die "Could not get remote index for $arch"
done

old_list="$((for arch in $architectures
old_list="$( (for arch in $architectures
do
dir="$(arch_dir $arch)"
test -s "$dir/.remote" &&
package_list "$dir/.remote"
done) |
sort | uniq)"
new_list="$((for arch in $architectures
new_list="$( (for arch in $architectures
do
dir="$(arch_dir $arch)"
package_list "$dir/git-for-windows.db.tar.xz"
Expand Down Expand Up @@ -804,7 +803,7 @@ file_exists () { # arch filename
}

push_missing_signatures () {
list="$((for arch in $architectures
list="$( (for arch in $architectures
do
dir="$(arch_dir $arch)"
package_list "$dir/git-for-windows.db.tar.xz"
Expand Down

0 comments on commit 90a00a9

Please sign in to comment.