diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-05 19:36:55 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-05 20:01:07 -0600 |
commit | beae9b3e2822021fea741fc98282cf9e0fc1d024 (patch) | |
tree | ab2c55df74fb068050be1f293b9a9df24721f24f | |
parent | 1d6066b37e0fd4e7118a3d366d1b6a2168a70286 (diff) |
Double bracket ==/</> compare lexicographically, not numerically.
Unfortunately for me, that means that it works correctly *most* of the
time. But, for example, [[ 10 < 2 ]], and negatives don't work.
-rwxr-xr-x | src/abslibre-tools/librestage | 2 | ||||
-rwxr-xr-x | src/aur | 2 | ||||
-rwxr-xr-x | src/chroot-tools/librechroot | 2 | ||||
-rwxr-xr-x | src/is_built | 2 | ||||
-rw-r--r-- | src/lib/conf.sh | 2 | ||||
-rwxr-xr-x | src/lib/libreblacklist | 4 | ||||
-rwxr-xr-x | src/librefetch/librefetch | 4 | ||||
-rwxr-xr-x | src/pkgbuild-check-licenses | 2 | ||||
-rwxr-xr-x | src/pkgbuild-check-nonfree | 2 |
9 files changed, 11 insertions, 11 deletions
diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index 0cb7a27..e209beb 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -47,7 +47,7 @@ main() { esac done repos=("$@") - if [[ ${#repos[@]} == 0 ]]; then + if [[ ${#repos[@]} -eq 0 ]]; then usage >>/dev/stderr return 1; fi @@ -103,7 +103,7 @@ main() { local s=0 pkgbuild-check-licenses || s=$? for i in 1 2 4; do - if [[ $s == $(($s & $i)) ]]; then + if [[ $s -eq $(($s & $i)) ]]; then case $i in 1) warning "pkgbuild-check-licenses encountered an error";; 2) warning "This PKGBUILD has an uncommon license";; diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 3ac5380..a2394d7 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -137,7 +137,7 @@ main() { esac done shift $(($OPTIND - 1)) - if [[ $# < 1 ]]; then + if [[ $# -lt 1 ]]; then error "Must specify a command" usage >/dev/stderr return 1 diff --git a/src/is_built b/src/is_built index 92b44f8..6aa9b66 100755 --- a/src/is_built +++ b/src/is_built @@ -34,7 +34,7 @@ result=$(vercmp "${pver}" "${ver}") # 0 : pver = ver # 1 : pver > ver -if [[ $result >= 0 ]] && [[ $r == 0 ]]; then +if [[ $result -ge 0 ]] && [[ $r -eq 0 ]]; then exit 0 else exit 1 diff --git a/src/lib/conf.sh b/src/lib/conf.sh index 3ec8a8d..67aeb96 100644 --- a/src/lib/conf.sh +++ b/src/lib/conf.sh @@ -114,7 +114,7 @@ check_vars() { local VAR for VAR in "$@"; do if [[ -z ${!VAR:-} ]]; then - if [[ $(list_files $slug|wc -l) > 1 ]]; then + if [[ $(list_files $slug|wc -l) -gt 1 ]]; then echo "Configure '$VAR' in one of:" list_files $slug | sed 's/./ -> &/' else diff --git a/src/lib/libreblacklist b/src/lib/libreblacklist index 1d73d2f..627bb39 100755 --- a/src/lib/libreblacklist +++ b/src/lib/libreblacklist @@ -103,7 +103,7 @@ if [[ "${0##*/}" == libreblacklist ]]; then sed 's/\r/\n/g'<<<"$1"|sed '/^$/d' } usage() { - if [[ $# == 0 ]]; then + if [[ $# -eq 0 ]]; then printf "Usage: %s [-h] COMMAND [ARGUMENTS]\n" "${0##*/}" echo "Tool for working with the nonfree software blacklist" echo @@ -128,7 +128,7 @@ if [[ "${0##*/}" == libreblacklist ]]; then fi } - if [[ $# == 0 ]]; then + if [[ $# -eq 0 ]]; then usage >/dev/stderr exit 1 fi diff --git a/src/librefetch/librefetch b/src/librefetch/librefetch index ce60396..9aa4641 100755 --- a/src/librefetch/librefetch +++ b/src/librefetch/librefetch @@ -149,7 +149,7 @@ parse_options() { local opt local have_opt - while [[ $# > 0 ]]; do + while [[ $# -gt 0 ]]; do arg=$1 have_opt=false if in_array "${arg%%=*}" "${makepkg_opt2long[@]}"; then @@ -270,7 +270,7 @@ prepare() { rm -rf "$pkgdir"; } build() { mksource; } check() { :; } package() { - if [[ $(ls "$pkgdir" | wc -l) == 0 ]]; then + if [[ $(ls "$pkgdir" | wc -l) -eq 0 ]]; then # pkgdir is empty; provide good default behavior cp -a "${srcdir}"/*/ "$pkgdir/" fi diff --git a/src/pkgbuild-check-licenses b/src/pkgbuild-check-licenses index 347b48f..7dfe309 100755 --- a/src/pkgbuild-check-licenses +++ b/src/pkgbuild-check-licenses @@ -110,7 +110,7 @@ main() { esac done shift $(($OPTIND - 1)) - if [[ $# < 1 ]]; then + if [[ $# -lt 1 ]]; then pkgbuilds=("`pwd`/PKGBUILD") else pkgbuilds=("$@") diff --git a/src/pkgbuild-check-nonfree b/src/pkgbuild-check-nonfree index 9a5e440..92496be 100755 --- a/src/pkgbuild-check-nonfree +++ b/src/pkgbuild-check-nonfree @@ -101,7 +101,7 @@ main() { esac done shift $(($OPTIND - 1)) - if [[ $# < 1 ]]; then + if [[ $# -lt 1 ]]; then pkgbuilds=("`pwd`/PKGBUILD") else pkgbuilds=("$@") |