index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | contrib/bash_completion | 17 | ||||
-rw-r--r-- | scripts/makepkg.sh.in | 10 | ||||
-rw-r--r-- | scripts/rankmirrors.sh.in | 12 |
diff --git a/contrib/bash_completion b/contrib/bash_completion index 2713ba4d..1ec2cd53 100644 --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -52,10 +52,6 @@ _pacman_pkg() { )" } -_pacman_file() { - compopt -o filenames; _filedir 'pkg.tar.*' -} - _pacman() { local common core cur database prev query remove sync upgrade o COMPREPLY=() @@ -102,7 +98,18 @@ _pacman() { true } +if [[ $(type -t compopt) = "builtin" ]]; then + _pacman_file() { + compopt -o filenames; _filedir 'pkg.tar.*' + } + complete -F _pacman -o default pacman +else + _pacman_file() { + _filedir 'pkg.tar.*' + } + complete -F _pacman -o filenames -o default pacman +fi + complete -F _makepkg -o default makepkg -complete -F _pacman -o default pacman # ex:et ts=2 sw=2 ft=sh diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 71ad9415..cbc344de 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -382,11 +382,15 @@ run_pacman() { } check_deps() { - (( $# > 0 )) || return + (( $# > 0 )) || return 0 + # Disable error trap in pacman subshell call as this breaks bash-3.2 compatibility + # Also, a non-zero return value is not unexpected and we are manually dealing them + set +E local ret=0 - pmout=$(run_pacman -T "$@") - ret=$? + pmout=$(run_pacman -T "$@") || ret=$? + set -E + if (( ret == 127 )); then #unresolved deps echo "$pmout" elif (( ret )); then diff --git a/scripts/rankmirrors.sh.in b/scripts/rankmirrors.sh.in index 9b4e973a..b0dc1ab7 100644 --- a/scripts/rankmirrors.sh.in +++ b/scripts/rankmirrors.sh.in @@ -49,7 +49,7 @@ version() { } err() { - echo "$1" + echo "$1" >&2 exit 1 } @@ -70,15 +70,15 @@ ARCH="$(uname -m)" getfetchurl() { local strippedurl="${1%/}" - local replacedurl="${replacedurl//'$arch'/$ARCH}" + local replacedurl="${strippedurl//'$arch'/$ARCH}" if [[ ! $TARGETREPO ]]; then - replacedurl="${strippedurl//'$repo'/core}" + replacedurl="${replacedurl//'$repo'/core}" local tmp="${replacedurl%/*}" tmp="${tmp%/*}" local reponame="${tmp##*/}" else - replacedurl="${strippedurl//'$repo'/$TARGETREPO}" + replacedurl="${replacedurl//'$repo'/$TARGETREPO}" local reponame="$TARGETREPO" fi @@ -184,9 +184,9 @@ fi timesarray=() for line in "${linearray[@]}"; do - if [[ $line =~ ^# ]]; then + if [[ $line =~ ^[[:space:]]*# ]]; then [[ $TIMESONLY ]] || echo $line - elif [[ $line =~ ^Server ]]; then + elif [[ $line =~ ^[[:space:]]*Server ]]; then # Getting values and times and such server="${line#*= }" |