summaryrefslogtreecommitdiffstats
path: root/rebuildpkgs.in
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-12-02 08:33:33 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-04 18:00:57 +0100
commit56d4dec19fbcec23f677114e4104bb9df902ed9f (patch)
treec7a8cf2484db200d810f37a01b1226fef59f90c5 /rebuildpkgs.in
parentf62f307c8490a3018941e2a8805a082e001b95e2 (diff)
downloaddevtools-56d4dec19fbcec23f677114e4104bb9df902ed9f.tar.gz
devtools-56d4dec19fbcec23f677114e4104bb9df902ed9f.tar.xz
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 <archlinux@cryptocrack.de>
Diffstat (limited to 'rebuildpkgs.in')
-rw-r--r--rebuildpkgs.in10
1 files changed, 5 insertions, 5 deletions
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) <chrootdir> <packages to rebuild>"
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"