[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[patch][debootstrap] small style fixes



Hi.

Can you please consider to commit in the attached patch in debootstrap svn?
They are only small style fixes.

Thanks,
Luca Favatella


P.S.
I'm trying to understand debootstrap.
In
http://lists.debian.org/debian-boot/2009/03/msg00370.html
it was suggested to me to "Use [ -z ... ].".
Index: debootstrap
===================================================================
--- debootstrap	(revision 57959)
+++ debootstrap	(working copy)
@@ -9,7 +9,7 @@
 
 ###########################################################################
 
-if [ "$DEBOOTSTRAP_DIR" = "" ]; then
+if [ -z "$DEBOOTSTRAP_DIR" ]; then
 	if [ -x /debootstrap/debootstrap ]; then
 		DEBOOTSTRAP_DIR=/debootstrap
 	else
@@ -96,7 +96,7 @@
 
 ###########################################################################
 
-if [ "$PKGDETAILS" = "" ]; then
+if [ -z "$PKGDETAILS" ]; then
 	error 1 NO_PKGDETAILS "No pkgdetails available; either install perl, or build pkgdetails.c from source"
 fi
 
@@ -299,14 +299,14 @@
 		VARIANT=$(cat $DEBOOTSTRAP_DIR/variant)
 		SUPPORTED_VARIANTS="$VARIANT"
 	fi
-	if [ "$CHROOTDIR" = "" ]; then
+	if [ -z "$CHROOTDIR" ]; then
 		TARGET=/
 	else
 		TARGET=$CHROOTDIR
 	fi
 	SCRIPT=$DEBOOTSTRAP_DIR/suite-script
 else
-	if [ "$1" = "" ] || [ "$2" = "" ]; then
+	if [ -z "$1" ] || [ -z "$2" ]; then
 		usage_err 1 NEEDSUITETARGET "You must specify a suite and a target."
 	fi
 	SUITE="$1"
Index: functions
===================================================================
--- functions	(revision 57959)
+++ functions	(working copy)
@@ -251,7 +251,7 @@
 	fi
 
 	if [ -e "$2" ]; then
-		if [ "$3" = "" ]; then
+		if [ -z "$3" ]; then
 			return 0
 		elif [ "$3" = nocache ]; then
 			rm -f "$2"
@@ -306,7 +306,7 @@
 				md5=""
 			fi
 		fi
-		if [ "$md5" = "" ]; then
+		if [ -z "$md5" ]; then
 			[ "$dest2" = "$dest" ] || mv "$dest2" "$dest"
 			case "$typ" in
 			    gz)  gunzip "$dest" ;;
@@ -478,7 +478,7 @@
 	done
 	COMPONENTS="$(echo $COMPONENTS)"
 
-	if [ "$COMPONENTS" = "" ]; then
+	if [ -z "$COMPONENTS" ]; then
 		mv "$reldest" "$reldest.malformed"
 		error 1 INVALIDREL "Invalid Release file, no valid components"
 	fi
@@ -637,9 +637,9 @@
 		local pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m" "$path")"
 		if [ ! -e "$pkgdest" ]; then continue; fi
 		pkgs_to_get="$(download_debs "$m" "$pkgdest" $pkgs_to_get 5>&1 1>&6)"
-		if [ "$pkgs_to_get" = "" ]; then break; fi
+		if [ -z "$pkgs_to_get" ]; then break; fi
 	    done 6>&1
-	    if [ "$pkgs_to_get" = "" ]; then break; fi
+	    if [ -z "$pkgs_to_get" ]; then break; fi
 	done
 	progress $dloaddebs $totaldebs DOWNDEBS "Downloading packages"
 	if [ "$pkgs_to_get" != "" ]; then

Reply to: