From 56d4dec19fbcec23f677114e4104bb9df902ed9f Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 2 Dec 2011 08:33:33 +0100 Subject: Use double brackets everywhere We already fixed a couple of these in previous patches - this one should replace all remaining uses of single brackets ("[") by double brackets. Also, use arithmetic evaluation instead of conditional expressions where appropriate and make use of "-z" and "-n" instead of comparing variables to empty strings. Signed-off-by: Lukas Fleischer --- rebuildpkgs.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'rebuildpkgs.in') diff --git a/rebuildpkgs.in b/rebuildpkgs.in index d8fbdbe..f7b1612 100644 --- a/rebuildpkgs.in +++ b/rebuildpkgs.in @@ -11,14 +11,14 @@ m4_include(lib/common.sh) -if [ $# -le 1 ]; then +if (( $# < 1 )); then echo "usage: $(basename $0) " echo " example: $(basename $0) ~/chroot readline bash foo bar baz" exit 1 fi # Source makepkg.conf; fail if it is not found -if [ -r '/etc/makepkg.conf' ]; then +if [[ -r '/etc/makepkg.conf' ]]; then source '/etc/makepkg.conf' else die '/etc/makepkg.conf not found!' @@ -63,7 +63,7 @@ for pkg in $pkgs; do msg2 "Building '$pkg'" /usr/bin/svn update "$pkg" - if [ ! -d "$pkg/trunk" ]; then + if [[ ! -d "$pkg/trunk" ]]; then FAILED="$FAILED $pkg" warning "$pkg does not exist in SVN" continue @@ -77,7 +77,7 @@ for pkg in $pkgs; do error "$pkg Failed!" else pkgfile=$(pkg_from_pkgbuild) - if [ -e "$pkgfile" ]; then + if [[ -e $pkgfile ]]; then msg2 "$pkg Complete" else FAILED="$FAILED $pkg" @@ -87,7 +87,7 @@ for pkg in $pkgs; do done cd "$REBUILD_ROOT" -if [ "$FAILED" != "" ]; then +if [[ -n $FAILED ]]; then msg 'Packages failed:' for pkg in $FAILED; do msg2 "$pkg" -- cgit v1.2.3-70-g09d2