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

Bug#459117: newbiedoc: FTBFS with dash



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I've created patch which partially fix the bashism.
The package builds fine.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBR3/GL3Cg+7fCe3L1AQj4hgf/aawk7Nhf74bXTx6qniPZDnhszMsPDAKi
hlQvPojQpFKf4tYYXZLo27SRDSDaZDL9vtJpykUb6aTxQUsMsU/c0SUmJ0KrMoMV
nnfzDjpQD2M+vlQhmRHV91eTAzGVd2a97RtcyiDaWte3Yf34m31yYdrY1xzPjHtw
K4AgjF7gFJskCp0Y0hwsEVzdKhZ67RBOuiV+Cy1O1KOCNfLRs3BGC+WIxBwKtDrK
G0defKC5d39rJwtI5Kd0loDaBa6U1u6aJRcsnT2gWAnN4TCyH0l2oC23+HgbDkRP
lsKKlxofULfRfhER02aUs96tDQnyV/r75JZdPPoNVEIbjDbTPOgXUQ==
=rheG
-----END PGP SIGNATURE-----
--- make_archive-sgmltools.sh	2008-01-05 19:54:38.000000000 +0200
+++ make_archive-sgmltools.sh.old	2001-10-29 14:17:19.000000000 +0200
@@ -94,7 +94,7 @@
 #---- Functions used in the code -------------------------------------------#
 
 #it's a " multiple backspace"
-	back_echo ()
+	function back_echo ()
 	{
 # usage: back_echo number_of_backspaces
 		if [ $# != 1 ]; then
@@ -105,7 +105,9 @@
 		local i
 		let i=0
 		while [ $i -lt $NUM_CHARS ]; do
-			printf '\b'
+			echo -n -e '\b'
+			# -e for 'understand the \xxx characters'
+			# -n for 'forget about the trailing newline'
 			let i=$i+1
 		done
 	}
@@ -114,7 +116,7 @@
 # it is a bit complicated because I wanted to have a "xx% completed" counter.
 # Note: the counter works on files, not size, so it might not represent 
 # anything close to the remaining compilation time...
-	actual_compilation ()
+	function actual_compilation()
 	{
 		local COMPLETED_STRING
 		local completed_string_size
@@ -123,10 +125,10 @@
 		for FILE in $SOURCE_FILES; do
 # this is the string that display xx% completed
 			COMPLETED_STRING="==> $(( $NUM_COMPILED / $NUM_SOURCE_FILES ))% completed"
-			printf $COMPLETED_STRING
+			echo -n $COMPLETED_STRING
 
 # get string size:
-			completed_string_size=$( printf $COMPLETED_STRING | wc -c )
+			completed_string_size=$( echo -n $COMPLETED_STRING | wc -c )
 		
 #    Backspaceing  over exactly the "xx% Completed" part
 			back_echo $completed_string_size
@@ -167,7 +169,7 @@
 # this prints the last 100% completed 
 		COMPLETED_STRING="$(( $NUM_COMPILED / $NUM_SOURCE_FILES ))% completed"
 		echo -e -n $COMPLETED_STRING
-		completed_string_size=$(printf $COMPLETED_STRING | wc -c )
+		completed_string_size=$(echo -n $COMPLETED_STRING | wc -c )
 		back_echo $completed_string_size
 # no, it's not useless to display 100% completed if we echo 'done'
 # right after. I tried on a slow standalone X terminal, and the echo was so
@@ -238,7 +240,7 @@
 
 # after this line will be appended during the compilation something like
 # "xx% completed" :
-	printf "Compiling sgml sources in $TEMP_DIR/$ND_DIR..."
+	echo -n "Compiling sgml sources in $TEMP_DIR/$ND_DIR..."
 
 #-------------------------------------------------------------------------
 #             Compilation process
@@ -297,7 +299,7 @@
 	done
 
 	test $DEBUG && echo "Exiting directory $TEMP_DIR/$ND_DIR to $PWD"
-	printf 'Creating archive with processed files...'
+	echo -n 'Creating archive with processed files...'
 
 
 	tar $VERBOSE_TAR zcf $TEMP_TAR ./$ND_DIR/* || exit 1
@@ -319,7 +321,7 @@
 	cd $INITIAL_DIR
 
 # create the final archive
-	printf 'Creating final archive...'
+	echo -n 'Creating final archive...'
 	mv $TEMP_DIR/$TEMP_TAR $WRITE_FILE
 	echo 'done'
 

Reply to: