Просмотр исходного кода

Patches applied:

 * scott@netsplit.com--2004/dpkg--devo--1.10--patch-37
   remove non-posix test -a/-o in favour of && and ||

* scripts/dpkg-buildpackge.sh, scripts/dpkg-name.sh, methods/disk.update,
methods/disk.setup: Change non-POSIX -a and -o test options to shell
&& and || for portability.
Scott James Remnant лет назад: 22
Родитель
Сommit
f4cf1eda36
8 измененных файлов с 29 добавлено и 22 удалено
  1. 6 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 4 4
      debian/dpkg.postinst
  4. 1 1
      debian/dpkg.prerm
  5. 8 8
      methods/disk.setup
  6. 3 3
      methods/disk.update
  7. 3 3
      scripts/dpkg-buildpackage.sh
  8. 3 3
      scripts/dpkg-name.sh

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+Sat Jun 26 18:38:34 CEST 2004 David Weinehall <tao@debian.org>
+
+  * scripts/dpkg-buildpackge.sh, scripts/dpkg-name.sh, methods/disk.update,
+  methods/disk.setup: Change non-POSIX -a and -o test options to shell
+  && and || for portability.
+
 Sat Jun 26 16:41:31 CEST 2004 Changwoo Ryu <cwryu@debian.org>
 
   * po/ko.po: Updated.

+ 1 - 0
debian/changelog

@@ -1,6 +1,7 @@
 dpkg (1.10.23) unstable; urgency=low
 
   * Updated hurd start-stop-daemon support.  Closes: #133640, #254180.
+  * Removed usage of non-POSIX test options.  Closes: #256302.
 
   * Architecture Support:
     - Renamed x86-64 to amd64.  Closes: #252346, #254598.

+ 4 - 4
debian/dpkg.postinst

@@ -19,7 +19,7 @@ EOF
 }
 
 if [ "x$1" = xconfigure ]; then
-	if [ -z "$2" -a ! -f /etc/dpkg/dpkg.cfg ] ; then
+	if [ -z "$2" ] && [ ! -f /etc/dpkg/dpkg.cfg ] ; then
 		cp /usr/share/doc/dpkg/dpkg.cfg /etc/dpkg
 	fi
 
@@ -35,7 +35,7 @@ if [ "x$1" = xconfigure ]; then
 					continue
 				fi
 				h="`echo $g | sed -e 's/^K/S/'`"
-				if ! [ -L $h -a -L $g ] \
+				if ! [ -L $h ] && [ -L $g ] \
 				  || [ "`ls -Li $g 2>/dev/null | awk '{print $1}'`" != \
 				       "`ls -Li $h 2>/dev/null | awk '{print $1}'`" ]
 				then
@@ -114,8 +114,8 @@ OK.
 	esac
 fi
 
-if [ -d /usr/info -a ! -L /usr/info -a ! -L /usr/info/dir \
-		-a -f /usr/info/dir ]; then              
+if [ -d /usr/info ] && [ ! -L /usr/info ] && [ ! -L /usr/info/dir ] \
+		&& [ -f /usr/info/dir ]; then              
 	echo Moving /usr/info/dir to /usr/share/info/dir.
 	mv /usr/info/dir /usr/share/info/dir
 	if [ -f /usr/info/dir.old ]; then

+ 1 - 1
debian/dpkg.prerm

@@ -2,7 +2,7 @@
 
 set -e
 
-if [ ! \( "$1" = "upgrade" -o "$1" = "remove" \) ]; then
+if [ ! "$1" = "upgrade" ] && [ ! "$1" = "remove" ]; then
 	exit 0
 fi
 

+ 8 - 8
methods/disk.setup

@@ -172,7 +172,7 @@ then
 			read response
 			response="`echo \"$response\" | sed -e 's/[ 	]*$//'`"
 			if expr "$response" : '[0-9][0-9]*$' >/dev/null && \
-			   [ $response -ge 1 -a $response -le $ncdroms ]
+			   [ $response -ge 1 ] && [ $response -le $ncdroms ]
 			then
 				mountpoint="`sed -n $response'p' <$tp.l`"
 				echo
@@ -229,7 +229,7 @@ then
 		echo -n \
 "What is the name of the NFS server ? [$defaultnfsserver]  "
 		read response
-		if [ -z "$response" -a -n "$defaultnfsserver" ]
+		if [ -z "$response" ] && [ -n "$defaultnfsserver" ]
 		then
 			response="$defaultnfsserver"
 		fi
@@ -262,7 +262,7 @@ then
 What is the pathname on the NFS server of the filesystem with
 the Debian files? [$defaultnfsrempath]  "
 		read response
-		if [ -z "$response" -a -n "$defaultnfsrempath" ]
+		if [ -z "$response" ] && [ -n "$defaultnfsrempath" ]
 		then
 			response="$defaultnfsrempath"
 		else
@@ -444,7 +444,7 @@ find_area () {
 		check_binary $1 "$hierbase/$3/binary-$iarch"
 	fi
 
-	if [ $option = cdrom -a $2 = nf -a -z "$this_binary" ]
+	if [ $option = cdrom ] && [ $2 = nf ] && [ -z "$this_binary" ]
 	then
 		echo '
 Note: most CD-ROM distributions of Debian do not include programs
@@ -453,7 +453,7 @@ This is because these programs have copyrights that prevent
 distribution for profit on a CD-ROM - ie they are not free software.
 If you wish to install these programs you'\''ll have to get them from an
 alternative source.'
-	elif [ $2 = lcl -a -z "$this_binary" ]
+	elif [ $2 = lcl ] && [ -z "$this_binary" ]
 	then
 		echo '
 Note: By default there is no `local'\'' directory. It is intended for 
@@ -466,7 +466,7 @@ packages you made yourself.'
 Which directory contains the *.deb packages from the $1 distribution
 area (this directory is named \`$3/binary-$iarch' on the distribution site) ?
 Say \`none' if this area is not available."
-		if [ $2 != main -a -z "$defaultbinary" ]
+		if [ $2 != main ] && [ -z "$defaultbinary" ]
 		then
 			defaultbinary=none
 		fi
@@ -474,7 +474,7 @@ Say \`none' if this area is not available."
 "Enter _$1_ binary dir. [$4]
  ?  "
 		read response
-		if [ -z "$response" -a -n "$defaultbinary" ]
+		if [ -z "$response" ] && [ -n "$defaultbinary" ]
 		then
 			response="$defaultbinary"
 		fi
@@ -519,7 +519,7 @@ Where is the _$1_ \`Packages' file (if none is available, say \`none')
 [$5]
  ?  "
 			read response
-			if [ -z "$response" -a -n "$5" ]
+			if [ -z "$response" ] && [ -n "$5" ]
 			then
 				response="$5"
 			fi

+ 3 - 3
methods/disk.update

@@ -9,9 +9,9 @@ cd "$vardir/methods/disk"
 
 . ./shvar.$option
 
-if [ -z "$p_main_packages" -a -z "$p_ctb_packages" -a \
-     -z "$p_nf_packages" -a -z "$p_nus_packages " -a \
-     -z "$p_lcl_packages" ]
+if [ -z "$p_main_packages" ] && [ -z "$p_ctb_packages" ] && \
+   [ -z "$p_nf_packages" ] && [ -z "$p_nus_packages " ] && \
+   [ -z "$p_lcl_packages" ]
 then
 	echo '
 No Packages files available, cannot update available packages list.

+ 3 - 3
scripts/dpkg-buildpackage.sh

@@ -48,7 +48,7 @@ END
 
 rootcommand=''
 signcommand=""
-if [ -e $GNUPGHOME/secring.gpg -o -e $HOME/.gnupg/secring.gpg ] && \
+if ( [ -e $GNUPGHOME/secring.gpg ] || [ -e $HOME/.gnupg/secring.gpg ] ) && \
 		command -v gpg > /dev/null 2>&1; then
 	signcommand=gpg
 elif command -v pgp > /dev/null 2>&1 ; then
@@ -120,7 +120,7 @@ fi
 
 if test -n "$forcesigninterface" ; then
   signinterface=$forcesigninterface
-if [ "$signinterface" != "gpg" -a "$signinterface" != "pgp" ] ; then
+if [ "$signinterface" != "gpg" ] && [ "$signinterface" != "pgp" ] ; then
 	echo >&2 "$progname: invalid sign interface specified"
 	exit 1
 fi
@@ -200,7 +200,7 @@ if [ x$sourceonly = x ]; then
 	withecho $rootcommand debian/rules $binarytarget
 fi
 if [ "$usepause" = "true" ] && \
-   [  "$signchanges" != ":" -o \( -z "$binaryonly"  -a "$signsource" != ":" \) ] ; then
+   ( [ "$signchanges" != ":" ] || ( [ -z "$binaryonly" ] && [ "$signsource" != ":" ] ) ) ; then
     echo Press the return key to start signing process
     read dummy_stuff
 fi

+ 3 - 3
scripts/dpkg-name.sh

@@ -70,7 +70,7 @@ getname () {
 
 		a=`dpkg-deb -f -- "$1" architecture`;
 		a=`echo $a|sed -e 's/ *//g'`;
-		if [ -z "$a" -a -n "$noarchitecture" ]; # arch field empty, or ignored
+		if [ -z "$a" ] && [ -n "$noarchitecture" ]; # arch field empty, or ignored
 		then
 			a=`dpkg --print-installation-architecture`;
 			stderr "assuming architecture \`"$a"' for \`"$1"'";
@@ -103,7 +103,7 @@ getdir () {
 				s="no-section";
 				stderr "assuming section \`"no-section"' for \`"$1"'";
 			fi
-			if [ "$s" != "non-free" -a "$s" != "contrib" -a "$s" != "no-section" ];
+			if [ "$s" != "non-free" ] && [ "$s" != "contrib" ] && [ "$s" != "no-section" ];
 			then
 				dir=`echo unstable/binary-$a/$s`;
 			else
@@ -147,7 +147,7 @@ move () {
 		if [ $newname -ef "$1" ]; # same device and inode numbers
 		then
 			stderr "skipping \`"$1"'";
-		elif [ -f $newname -a -z "$overwrite" ];
+		elif [ -f $newname ] && [ -z "$overwrite" ];
 		then
 			stderr "can't move \`"$1"' to existing file";
 		elif `$command "$1" $newname`;