[Dbconfig-common-changes] [dbconfig-common] r361 - in trunk: . debian dpkg internal

Sean Finney seanius at alioth.debian.org
Mon Nov 27 20:01:39 CET 2006


Author: seanius
Date: 2006-11-27 20:01:38 +0100 (Mon, 27 Nov 2006)
New Revision: 361

Modified:
   trunk/dbconfig-generate-include
   trunk/dbconfig-load-include
   trunk/debian/changelog
   trunk/dpkg/common
   trunk/dpkg/config
   trunk/internal/mysql
   trunk/internal/pgsql
Log:
bashisms fix

Modified: trunk/dbconfig-generate-include
===================================================================
--- trunk/dbconfig-generate-include	2006-11-18 02:11:00 UTC (rev 360)
+++ trunk/dbconfig-generate-include	2006-11-27 19:01:38 UTC (rev 361)
@@ -203,7 +203,7 @@
 	exec > $tmpout
 fi
 
-if [ ! -f "$inputfile" -o ! -r "$inputfile" ]; then
+if [ ! -f "$inputfile" ] || [ ! -r "$inputfile" ]; then
 	echo "unable to read input file $inputfile" >&2
 	exit 1
 fi

Modified: trunk/dbconfig-load-include
===================================================================
--- trunk/dbconfig-load-include	2006-11-18 02:11:00 UTC (rev 360)
+++ trunk/dbconfig-load-include	2006-11-27 19:01:38 UTC (rev 361)
@@ -152,7 +152,7 @@
 	exit 1
 fi
 
-if [ ! -f "$inputfile" -o ! -r "$inputfile" ]; then
+if [ ! -f "$inputfile" ] || [ ! -r "$inputfile" ]; then
 	echo "unable to read input file $inputfile" >&2
 	exit 1
 fi

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-11-18 02:11:00 UTC (rev 360)
+++ trunk/debian/changelog	2006-11-27 19:01:38 UTC (rev 361)
@@ -1,6 +1,7 @@
 dbconfig-common (1.8.30) UNRELEASED; urgency=low
 
   * NOT RELEASED YET
+  * remove some "-a" and "-o" bashisms while i'm thinking about it.
 
  -- sean finney <seanius at copelandia.yale-house.net>  Sat, 11 Nov 2006 18:01:08 +0100
 

Modified: trunk/dpkg/common
===================================================================
--- trunk/dpkg/common	2006-11-18 02:11:00 UTC (rev 360)
+++ trunk/dpkg/common	2006-11-27 19:01:38 UTC (rev 361)
@@ -712,7 +712,7 @@
 		db_get $dbc_package/$dbc_dbtype/admin-pass
 		pass1="$RET"
 
-		if [ "$dbc_dbtype" = "pgsql" -a ! "$pass1" ]; then
+		if [ "$dbc_dbtype" = "pgsql" ] && [ ! "$pass1" ]; then
 			db_input high $dbc_package/pgsql/no-empty-passwords || true
 			db_reset $dbc_package/$dbc_dbtype/admin-pass
 			db_fset $dbc_package/$dbc_dbtype/admin-pass seen false

Modified: trunk/dpkg/config
===================================================================
--- trunk/dpkg/config	2006-11-18 02:11:00 UTC (rev 360)
+++ trunk/dpkg/config	2006-11-27 19:01:38 UTC (rev 361)
@@ -243,7 +243,7 @@
 			if [ "$dbc_dbport" ]; then
 				db_set $dbc_package/remote/port "$dbc_dbport"
 			fi
-			if [ "$dbc_ssl" = "true" -a "$dbc_dbtype" = "pgsql" ]; then
+			if [ "$dbc_ssl" = "true" ] && [ "$dbc_dbtype" = "pgsql" ]; then
 				db_set $dbc_package/pgsql/method "tcp/ip + ssl"
 			fi
 			db_input $dbc_remote_questions_priority $dbc_package/$dbc_dbtype/method || true
@@ -299,7 +299,7 @@
 				fi
 
 				# if they've chosen "new host" or the host list was empty
-				if [ ! "$host" -o "$host" = "new host" ]; then
+				if [ ! "$host" ] || [ "$host" = "new host" ]; then
 					# prompt them for a new hostname
 					db_input high $dbc_package/remote/newhost || true
 				fi
@@ -310,7 +310,7 @@
 	6)
 		if echo "$dbc_remote_dbtypes" | grep -q "$dbc_dbtype"; then
 			if [ "$dbc_method" != "unix socket" ]; then
-				if [ ! "$host" -o "$host" = "new host" ]; then
+				if [ ! "$host" ] || [ "$host" = "new host" ]; then
 					db_get $dbc_package/remote/newhost 
 					newhost="$RET"
 

Modified: trunk/internal/mysql
===================================================================
--- trunk/internal/mysql	2006-11-18 02:11:00 UTC (rev 360)
+++ trunk/internal/mysql	2006-11-27 19:01:38 UTC (rev 361)
@@ -124,7 +124,7 @@
 dbc_mysql_check_user(){
 	local l_dballow l_retval _dbc_nodb
 	if [ ! "$dbc_dballow" ]; then
-		if [ ! "$dbc_dbserver" -o "$dbc_dbserver" = "localhost" ]; then
+		if [ ! "$dbc_dbserver" ] || [ "$dbc_dbserver" = "localhost" ]; then
 			l_dballow=localhost
 		else
 			l_dballow=`hostname`
@@ -245,7 +245,7 @@
 	_dbc_mysql_check_connect || return 1
 
 	if [ ! "$dbc_dballow" ]; then 
-		if [ ! "$dbc_dbserver" -o "$dbc_dbserver" = "localhost" ]; then
+		if [ ! "$dbc_dbserver" ] || [ "$dbc_dbserver" = "localhost" ]; then
 			l_dballow=localhost
 		else
 			l_dballow=`hostname`
@@ -310,7 +310,7 @@
 	_dbc_mysql_check_connect || return 1
 
 	if [ ! "$dbc_dballow" ]; then
-		if [ ! "$dbc_dbserver" -o "$dbc_dbserver" = "localhost" ]; then
+		if [ ! "$dbc_dbserver" ] || [ "$dbc_dbserver" = "localhost" ]; then
 			l_dballow=localhost
 		else
 			l_dballow=`hostname`

Modified: trunk/internal/pgsql
===================================================================
--- trunk/internal/pgsql	2006-11-18 02:11:00 UTC (rev 360)
+++ trunk/internal/pgsql	2006-11-27 19:01:38 UTC (rev 361)
@@ -15,7 +15,7 @@
 	#	- else ident/localhost: $dbc_dbadmin
 	#	- all others: no change (root)
 	if [ "$_dbc_asuser" ]; then
-		if [ "$dbc_authmethod_user" = "ident" -a ! "$dbc_dbserver" ]; then
+		if [ "$dbc_authmethod_user" = "ident" ] && [ ! "$dbc_dbserver" ]; then
 			if id $dbc_dbuser >/dev/null 2>&1; then
 				echo $dbc_dbuser
 				return 0
@@ -23,7 +23,7 @@
 				dbc_logline "warning: ident method specified but local account doesn't exist"
 			fi
 		fi
-	elif [ "$dbc_authmethod_admin" = "ident" -a ! "$dbc_dbserver" ]; then
+	elif [ "$dbc_authmethod_admin" = "ident" ] && [ ! "$dbc_dbserver" ]; then
 		echo $dbc_dbadmin
 		return 0
 	fi
@@ -57,7 +57,7 @@
 	cat << EOF > ${_dbc_pgsql_tmpdir}/.pgpass
 *:*:*:$remoteuser:$remotepass
 EOF
-	if [ "$localuser" -a "$localuser" != "root" ]; then
+	if [ "$localuser" ] && [ "$localuser" != "root" ]; then
 		chown -R "$localuser" $_dbc_pgsql_tmpdir
 	fi
 }
@@ -83,7 +83,7 @@
 }
 
 _dbc_psql_cmd_cleanup(){
-	if [ "$_dbc_pgsql_tmpdir" -a -d "$_dbc_pgsql_tmpdir" ]; then
+	if [ "$_dbc_pgsql_tmpdir" ] && [ -d "$_dbc_pgsql_tmpdir" ]; then
 		rm -f ${_dbc_pgsql_tmpdir}/.pgpass
 		rmdir $_dbc_pgsql_tmpdir
 	fi
@@ -363,7 +363,7 @@
 	_dbc_pgsql_check_connect || return 1
 
 	if [ ! "$dbc_dballow" ]; then 
-		if [ ! "$dbc_dbserver" -o "$dbc_dbserver" = "localhost" ]; then
+		if [ ! "$dbc_dbserver" ] || [ "$dbc_dbserver" = "localhost" ]; then
 			l_dballow=localhost
 		else
 			l_dballow=`hostname -f`
@@ -422,7 +422,7 @@
 	_dbc_pgsql_check_connect || return 1
 
 	if [ ! "$dbc_dballow" ]; then
-		if [ ! "$dbc_dbserver" -o "$dbc_dbserver" = "localhost" ]; then
+		if [ ! "$dbc_dbserver" ] || [ "$dbc_dbserver" = "localhost" ]; then
 			l_dballow=localhost
 		else
 			l_dballow=`hostname -f`




More information about the Dbconfig-common-changes mailing list