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

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>
 Sat Jun 26 16:41:31 CEST 2004 Changwoo Ryu <cwryu@debian.org>
 
 
   * po/ko.po: Updated.
   * po/ko.po: Updated.

+ 1 - 0
debian/changelog

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

+ 4 - 4
debian/dpkg.postinst

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

+ 1 - 1
debian/dpkg.prerm

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

+ 8 - 8
methods/disk.setup

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

+ 3 - 3
methods/disk.update

@@ -9,9 +9,9 @@ cd "$vardir/methods/disk"
 
 
 . ./shvar.$option
 . ./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
 then
 	echo '
 	echo '
 No Packages files available, cannot update available packages list.
 No Packages files available, cannot update available packages list.

+ 3 - 3
scripts/dpkg-buildpackage.sh

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

+ 3 - 3
scripts/dpkg-name.sh

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