tazinst rev 116 tip

tazinst: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 09 15:11:39 2021 +0000 (2021-11-09)
parents 6b79681fa9ec
children
files tazinst
line diff
     1.1 --- a/tazinst	Sat Oct 23 15:17:11 2021 +0000
     1.2 +++ b/tazinst	Tue Nov 09 15:11:39 2021 +0000
     1.3 @@ -702,8 +702,8 @@
     1.4  				|| echo "ok" ;;
     1.5  		liveboot|webboot)
     1.6  			printf "%-15s: " "$key"
     1.7 -			[ -n "$(get $key)" ] && { "$(get $key)" == "auto" ] \
     1.8 -				&& check_boot_mix && echo "ok"; } \
     1.9 +			[ -n "$(get $key)" ] && [ "$(get $key)" == "auto" ] \
    1.10 +				&& { check_boot_mix && echo "ok"; } \
    1.11  				|| echo "ok" ;;
    1.12  		winboot)
    1.13  			printf "%-15s: " "$key"
    1.14 @@ -746,10 +746,10 @@
    1.15  				|| (check_key $setting "$(list_bootloader)" \
    1.16  				&& check_table ; ) ;;
    1.17  		liveboot|webboot)
    1.18 -			([ -z "$(get $setting)" ] || [ "$(get $setting)" = "auto" ]) \
    1.19 +			{ [ -z "$(get $setting)" ] || [ "$(get $setting)" = "auto" ]; } \
    1.20  				&& check_boot_mix ;;
    1.21  		winboot)
    1.22 -			([ -z "$(get $setting)" ] || [ "$(get $setting)" = "auto" ]) \
    1.23 +			{ [ -z "$(get $setting)" ] || [ "$(get $setting)" = "auto" ]; } \
    1.24  				|| check_uuid $setting && check_boot_mix ;;
    1.25  		""|all)
    1.26  			check_all ;;
    1.27 @@ -1138,10 +1138,9 @@
    1.28  	local list_mirrors
    1.29  	if [ -r "$MIRRORS" ]; then
    1.30  		# randomize list of mirrors
    1.31 -		list_mirrors="$(cat $MIRRORS | \
    1.32 -			/bin/busybox awk 'BEGIN {srand()}{
    1.33 +		list_mirrors="$(busybox awk 'BEGIN {srand()}{
    1.34  				printf "%05.0f %s \n",rand()*99999, $0;
    1.35 -			}' | sort -n | sed 's/^[0-9]* //' )"
    1.36 +			}' < $MIRRORS | sort -n | sed 's/^[0-9]* //' )"
    1.37  	else
    1.38  		log "$(_ 'No mirror list found, run %s.' 'tazpkg recharge')"
    1.39  		list_mirrors="http://mirror.slitaz.org/"
    1.40 @@ -1164,7 +1163,7 @@
    1.41  	if [ "$transfer" -gt "0" ];then
    1.42  		log "$(_ 'Download completed.')"
    1.43  	else
    1.44 -		error 5 "(_ '%s: Download failed.' "$file")"
    1.45 +		error 5 "$(_ '%s: Download failed.' "$file")"
    1.46  	fi
    1.47  }
    1.48  
    1.49 @@ -1349,8 +1348,8 @@
    1.50  
    1.51  	#  exit if no rootfs.gz found.
    1.52  	log "$(_ 'Checking installation media...')"
    1.53 -	if [ ! -f $SOURCE_ROOT/boot/rootfs.gz -a \
    1.54 -		 ! -f $SOURCE_ROOT/boot/rootfs1.gz ]; then
    1.55 +	if [ ! -f $SOURCE_ROOT/boot/rootfs.gz ] &&
    1.56 +	   [ ! -f $SOURCE_ROOT/boot/rootfs1.gz ]; then
    1.57  		error 3 "$(_ 'Invalid source')"
    1.58  	else
    1.59  		log "$(_ 'Installation media checked ok')"
    1.60 @@ -1428,7 +1427,7 @@
    1.61  	mount -t "$mount_fs" "$ROOT_UUID" \
    1.62  			"$TARGET_ROOT" >>"$LOG" 2>>"$LOG"
    1.63  	if [ $(mount | \
    1.64 -			grep -c "mnt/target") = "0" ]; then
    1.65 +			grep -c "mnt/target") -eq 0 ]; then
    1.66  		error 4 "$(_ '%s: Unable to mount partition' "$ROOT_UUID")"
    1.67  	fi
    1.68  }
    1.69 @@ -1631,7 +1630,7 @@
    1.70  _EOF_
    1.71  	fi
    1.72  
    1.73 -	if [ -n "$WEBBOOT" -a -n "$IPXE" ]; then
    1.74 +	if [ -n "$WEBBOOT" ] && [ -n "$IPXE" ]; then
    1.75  		log "$(_ 'Enabling Webboot using %s' $IPXE)"
    1.76  		mv -f $TARGET_ROOT/boot/tazinst.$$/$IPXE $TARGET_ROOT/boot/
    1.77  		cat >> $TARGET_ROOT/boot/grub/menu.lst <<_EOF_
    1.78 @@ -1764,7 +1763,7 @@
    1.79  EOF
    1.80  	fi
    1.81  
    1.82 -	if [ -n "$WEBBOOT" -a -n "$IPXE" ]; then
    1.83 +	if [ -n "$WEBBOOT" ] && [ -n "$IPXE" ]; then
    1.84  		log "$(_ 'Enabling Webboot using %s' $IPXE)"
    1.85  		mv -f $TARGET_ROOT/boot/tazinst.$$/$IPXE $TARGET_ROOT/boot/
    1.86  		cat >> $TARGET_ROOT/boot/syslinux/syslinux.cfg <<EOF
    1.87 @@ -1854,7 +1853,7 @@
    1.88  {
    1.89  	local esp_fs_uuid mnt="/media/esp$$" efiboot="/EFI/SLITAZ"
    1.90  	# We need efi stub support
    1.91 -	[ "$(strings $TARGET_ROOT/boot/$KERNEL | head | grep reloc)" ] || return
    1.92 +	strings $TARGET_ROOT/boot/$KERNEL | head | grep -q reloc || return
    1.93  	# And the esp partition
    1.94  	esp_fs_uuid="$(blkid | sed '/EFI system partition/!d;s|.* UUID="||;s|".*||;q')"
    1.95  	[ "$esp_fs_uuid" ] || return
    1.96 @@ -2242,7 +2241,7 @@
    1.97  	diff="$(sort < packages-selection.diff)"
    1.98  	for pkg in $diff
    1.99  	do
   1.100 -		if grep -q ^$pkg-[0-9] /var/lib/tazpkg/packages.list; then
   1.101 +		if grep -q "^$pkg-[0-9]" /var/lib/tazpkg/packages.list; then
   1.102  			packages="$(($packages+1))"
   1.103  			printf "%s\n" "$pkg" >> packages-to-install.list
   1.104  		fi
   1.105 @@ -2279,7 +2278,7 @@
   1.106  	log "$(_ '%s: done' 'packages-source.list')"
   1.107  	# diff
   1.108  	/bin/busybox diff packages-source.list packages-selection.list | \
   1.109 -		grep ^+[a-z] | sed s/^+// > packages-selection.diff
   1.110 +		grep '^+[a-z]' | sed 's/^+//' > packages-selection.diff
   1.111  	log "$(_ '%s: done' 'packages-selection.diff')"
   1.112  	# get mirror list.
   1.113  	/usr/bin/tazpkg recharge >>$LOG 2>>$LOG