tazlito rev 514

Remove ashism ==
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 26 08:21:00 2019 +0100 (2019-02-26)
parents 368b74f9c467
children e2ff6056f93a
files live.cgi tazlito tazlito-wiz
line diff
     1.1 --- a/live.cgi	Fri Jan 25 22:18:53 2019 +0100
     1.2 +++ b/live.cgi	Tue Feb 26 08:21:00 2019 +0100
     1.3 @@ -5,7 +5,7 @@
     1.4  # Copyright (C) 2011-2015 SliTaz GNU/Linux - BSD License
     1.5  #
     1.6  
     1.7 -if [ "$1" == 'call' ]; then
     1.8 +if [ "$1" = 'call' ]; then
     1.9  	case "$2" in
    1.10  		merge_cleanup)
    1.11  			mv -f $3.merged $3
    1.12 @@ -155,7 +155,7 @@
    1.13  		if [ -d /proc/scsi/usb-storage ]; then
    1.14  			for dev in /sys/block/sd*; do
    1.15  				# removable writable sd* device:
    1.16 -				if [ "$(cat $dev/removable)" == '1' -a "$(cat $dev/ro)" == '0' ]; then
    1.17 +				if [ "$(cat $dev/removable)" = '1' -a "$(cat $dev/ro)" = '0' ]; then
    1.18  					echo "<optgroup label='$(cat $dev/device/vendor) $(cat $dev/device/model):'>"
    1.19  					for part in $dev/sd*; do
    1.20  						[ ! -d "$part" ] && break
     2.1 --- a/tazlito	Fri Jan 25 22:18:53 2019 +0100
     2.2 +++ b/tazlito	Tue Feb 26 08:21:00 2019 +0100
     2.3 @@ -102,7 +102,7 @@
     2.4  # Print the usage.
     2.5  
     2.6  usage () {
     2.7 -	[ $(basename $0) == 'tazlito' ] && cat <<EOT
     2.8 +	[ $(basename $0) = 'tazlito' ] && cat <<EOT
     2.9  
    2.10  SliTaz Live Tool - Version: $(colorize 34 "$VERSION")
    2.11  
    2.12 @@ -224,7 +224,7 @@
    2.13  		unset VERSION EXTRAVERSION
    2.14  		eval $(grep -s ^VERSION=      $INSTALLED/$i/receipt)
    2.15  		eval $(grep -s ^EXTRAVERSION= $INSTALLED/$i/receipt)
    2.16 -		if [ "$i-$VERSION$EXTRAVERSION" == "$tazpkg" ]; then
    2.17 +		if [ "$i-$VERSION$EXTRAVERSION" = "$tazpkg" ]; then
    2.18  			echo $i
    2.19  			break
    2.20  		fi
    2.21 @@ -289,7 +289,7 @@
    2.22  		while [ $sz -gt 0 ]; do
    2.23  			local len=$(get $e "$2")
    2.24  			[ "$(dd if="$2" bs=1 skip=$(($e+33)) count=${#i} \
    2.25 -				2>/dev/null)" == "$i" ] && continue 2
    2.26 +				2>/dev/null)" = "$i" ] && continue 2
    2.27  			[ $len -eq 0 ] && break
    2.28  			sz=$(($sz-$len))
    2.29  			e=$(($e+$len))
    2.30 @@ -481,7 +481,7 @@
    2.31  		*taz64) efifile=bootx64.efi ;;
    2.32  		esac
    2.33  		if [ ! -s $basedir/efi/boot/$efifile ] &&
    2.34 -		   [ $(get $((0x82)) "$1") == $((0x4550)) ]; then
    2.35 +		   [ $(get $((0x82)) "$1") = $((0x4550)) ]; then
    2.36  			mkdir -p $basedir/efi/boot 2> /dev/null
    2.37  			ln "$1" "$basedir/efi/boot/$efifile"
    2.38  			stat -c "%s %n" "$1"
    2.39 @@ -551,7 +551,7 @@
    2.40  
    2.41  	# Create boot sector
    2.42  	doslabel="$(echo "SLITAZ BOOT         " | od -v -N 11 -t x1 -w1 -An)"
    2.43 -	if [ "$ftype" == "33 32" ]; then
    2.44 +	if [ "$ftype" = "33 32" ]; then
    2.45  		hexdump -R <<EOT | dd of=$basedir/boot/isolinux/efi.img \
    2.46  			conv=notrunc
    2.47  0  eb 58 90 53 6c 69 54 61  7a 00 00 00 02 04 $rsect 00  |
    2.48 @@ -838,7 +838,7 @@
    2.49  			cpio -o -H newc > "/$INITRAMFS"
    2.50  			;;
    2.51  	esac < /tmp/list
    2.52 -	[ "$align" == 'y' -a -z "$noalign" ] && align_to_32bits "/$INITRAMFS"
    2.53 +	[ "$align" = 'y' -a -z "$noalign" ] && align_to_32bits "/$INITRAMFS"
    2.54  	echo 1 > /tmp/rootfs
    2.55  }
    2.56  
    2.57 @@ -846,12 +846,12 @@
    2.58  # Deduplicate files (MUST be on the same filesystem).
    2.59  
    2.60  deduplicate() {
    2.61 -	find "${@:-.}" -type f -size +0c -xdev -exec stat -c '%s-%a-%u-%g %i %h %n' {} \; | sort | \
    2.62 +	find "${@:-.}" -xdev -type f -size +0c -exec stat -c '%s-%a-%u-%g %i %h %n' {} \; | sort | \
    2.63  		(
    2.64  			save=0; hardlinks=0; old_attr=""; old_inode=""; old_link=""; old_file=""
    2.65  			while read attr inode link file; do
    2.66  				[ -L "$file" ] && continue
    2.67 -				if [ "$attr" == "$old_attr" -a "$inode" != "$old_inode" ]; then
    2.68 +				if [ "$attr" = "$old_attr" -a "$inode" != "$old_inode" ]; then
    2.69  					if cmp "$file" "$old_file" >/dev/null 2>&1 ; then
    2.70  						rm -f "$file"
    2.71  						if ln "$old_file" "$file" 2>/dev/null; then
    2.72 @@ -868,12 +868,12 @@
    2.73  			_ '%s Kbytes saved in %s duplicate files.' "$save" "$hardlinks"
    2.74  		)
    2.75  
    2.76 -	find "$@" -type l -xdev -exec stat -c '%s-%u-%g-TARGET- %i %h %n' {} \; | sort | \
    2.77 +	find "$@" -xdev -type l -exec stat -c '%s-%u-%g-TARGET- %i %h %n' {} \; | sort | \
    2.78  		(
    2.79  			old_attr=""; hardlinks=0;
    2.80  			while read attr inode link file; do
    2.81  				attr="${attr/-TARGET-/-$(readlink $file)}"
    2.82 -				if [ "$attr" == "$old_attr" ]; then
    2.83 +				if [ "$attr" = "$old_attr" ]; then
    2.84  					if [ "$inode" != "$old_inode" ]; then
    2.85  						rm -f "$file"
    2.86  						if ln "$old_file" "$file" 2>/dev/null; then
    2.87 @@ -1025,7 +1025,7 @@
    2.88  		done
    2.89  		touch -t 197001010100.00 $1.*
    2.90  		# Info to be stored inside ISO
    2.91 -		[ "$2" == info ] && echo -e $infos | cpio -o -H newc | dogzip info
    2.92 +		[ "$2" = info ] && echo -e $infos | cpio -o -H newc | dogzip info
    2.93  		rm $1.list*
    2.94  
    2.95  		# Renames
    2.96 @@ -1060,16 +1060,16 @@
    2.97  		return 1
    2.98  
    2.99  	elif [ -L "$1" ] && [ -L "$2" ]; then
   2.100 -		[ "$(readlink "$1")" == "$(readlink "$2")" ] && return 0
   2.101 +		[ "$(readlink "$1")" = "$(readlink "$2")" ] && return 0
   2.102  
   2.103  	elif [ -f "$1" ] && [ -f "$2" ]; then
   2.104  		cmp -s "$1" "$2" && return 0
   2.105  
   2.106 -		[ "$(basename "$3")" == 'volatile.cpio.gz' ] &&
   2.107 -		[ "$(dirname $(dirname "$3"))" == ".$INSTALLED" ] &&
   2.108 +		[ "$(basename "$3")" = 'volatile.cpio.gz' ] &&
   2.109 +		[ "$(dirname $(dirname "$3"))" = ".$INSTALLED" ] &&
   2.110  			return 0
   2.111  
   2.112 -	elif [ "$(ls -l "$1"|cut -c1-10)$(stat -c '%a:%u:%g:%t:%T' "$1")" == \
   2.113 +	elif [ "$(ls -l "$1"|cut -c1-10)$(stat -c '%a:%u:%g:%t:%T' "$1")" = \
   2.114  	       "$(ls -l "$2"|cut -c1-10)$(stat -c '%a:%u:%g:%t:%T' "$2")" ]; then 
   2.115  			return 0
   2.116  
   2.117 @@ -1331,7 +1331,7 @@
   2.118  		cp /lib/modules/$v/kernel/fs/$aufs/$aufs.ko.?z \
   2.119  			$TMP_DIR/initfs/lib/modules/${v/*taz/}
   2.120  	done
   2.121 -	if [ "$1" == 'cdrom' ]; then
   2.122 +	if [ "$1" = 'cdrom' ]; then
   2.123  		sed -i '/mod squashfs/d' $TMP_DIR/initfs/init
   2.124  	else
   2.125  		[ ! -f /usr/sbin/mksquashfs ] && ! install_package squashfs && return 1
   2.126 @@ -1347,7 +1347,7 @@
   2.127  		#ls /sbin/unsquashfs /usr/lib/liblzma.so* $INSTALLED/squashfs/* | \
   2.128  		#cpio -o -H newc > $TMP_DIR/initfs/extractfs.cpio
   2.129  	fi
   2.130 -	if [ "$1" == 'http' ]; then
   2.131 +	if [ "$1" = 'http' ]; then
   2.132  		mkdir $TMP_DIR/initfs/etc $TMP_DIR/fs
   2.133  		ln -s /proc/mounts $TMP_DIR/initfs/etc/mtab
   2.134  		cp /usr/share/udhcpc/default.script $TMP_DIR/initfs/lib/udhcpc
   2.135 @@ -1438,7 +1438,7 @@
   2.136  	$need_lib && for i in /lib/ld-* /lib/lib[cm][-\.]* ; do
   2.137  		cp -a $i $TMP_DIR/initfs/lib
   2.138  	done
   2.139 -	[ "$1" == 'http' ] && cat > $TMP_DIR/initfs/init <<EOTEOT
   2.140 +	[ "$1" = 'http' ] && cat > $TMP_DIR/initfs/init <<EOTEOT
   2.141  #!/bin/sh
   2.142  
   2.143  getarg() {
   2.144 @@ -1582,7 +1582,7 @@
   2.145  		deduplicate
   2.146  		cd - > /dev/null
   2.147  		rootfs=$TMP_DIR/$(basename $i 64)
   2.148 -		[ $rootfs == $TMP_DIR/rootfs.gz ] && rootfs=$TMP_DIR/rootfs0.gz
   2.149 +		[ $rootfs = $TMP_DIR/rootfs.gz ] && rootfs=$TMP_DIR/rootfs0.gz
   2.150  		/usr/sbin/mksquashfs $TMP_DIR/fs $rootfs -comp ${1:-xz -Xbcj x86}
   2.151  		cd $TMP_DIR
   2.152  		rootfs_sizes="$rootfs_sizes $(( $(du -s $TMP_DIR/fs | cut -f1) - $(du -s $rootfs | cut -f1) ))"
   2.153 @@ -1673,7 +1673,7 @@
   2.154  		local new
   2.155  		set -- $append
   2.156  		shift
   2.157 -		[ "$1" == "ifmem" ] && shift
   2.158 +		[ "$1" = "ifmem" ] && shift
   2.159  		new=""
   2.160  		while [ -n "$2" ]; do
   2.161  			local s
   2.162 @@ -1734,7 +1734,7 @@
   2.163  	cat $1$INSTALLED/*/md5sum | \
   2.164  	while read md5 file; do
   2.165  		[ -e "$1$file" ] || continue
   2.166 -		[ "$(md5sum < "$1$file")" == "$md5  -" ] &&
   2.167 +		[ "$(md5sum < "$1$file")" = "$md5  -" ] &&
   2.168  		rm -f "$1$file"
   2.169  	done
   2.170  
   2.171 @@ -2200,7 +2200,7 @@
   2.172  		status
   2.173  
   2.174  		for i in $(ls $TMP_DIR); do
   2.175 -			[ "$i" == 'boot' ] && continue
   2.176 +			[ "$i" = 'boot' ] && continue
   2.177  			cp -a "$TMP_DIR/$i" "$TARGET/rootcd"
   2.178  		done
   2.179  
   2.180 @@ -2366,7 +2366,7 @@
   2.181  			EXTRAVERSION=""
   2.182  			eval $(grep ^EXTRAVERSION= $ROOTFS$INSTALLED/$i/receipt)
   2.183  			eval $(grep ^CATEGORY= $ROOTFS$INSTALLED/$i/receipt)
   2.184 -			if [ "$CATEGORY" == 'non-free' -a "${i%%-*}" != 'get' ]; then
   2.185 +			if [ "$CATEGORY" = 'non-free' -a "${i%%-*}" != 'get' ]; then
   2.186  				echo "$i" >> $FLAVOR.nonfree
   2.187  			else
   2.188  				echo "$i-$VERSION$EXTRAVERSION" >> $FLAVOR.pkglist
   2.189 @@ -2728,7 +2728,7 @@
   2.190  				if [ ! -d "$ADDFILES/rootcd" ] ; then
   2.191  					mkdir -p "$ADDFILES/rootcd"
   2.192  					for i in $(ls $TMP_MNT); do
   2.193 -						[ "$i" == 'boot' ] && continue
   2.194 +						[ "$i" = 'boot' ] && continue
   2.195  						cp -a "$TMP_MNT/$i" "$ADDFILES/rootcd"
   2.196  					done
   2.197  				fi
   2.198 @@ -2747,7 +2747,7 @@
   2.199  		cp -f /etc/slitaz-release    $root/etc/slitaz-release
   2.200  		strip_versions "$LIST_NAME"
   2.201  
   2.202 -		if [ "$REPACK" == 'y' ]; then
   2.203 +		if [ "$REPACK" = 'y' ]; then
   2.204  			# Determine full packages list with all dependencies
   2.205  			tmp_dir="$(mktemp -d)"
   2.206  			cp "$LIST_NAME" "$tmp_dir/flavor.pkglist"
   2.207 @@ -3017,7 +3017,7 @@
   2.208  		newline
   2.209  		emsg "<b>Archive compression:</b> <c 36>$COMPRESSION</c>"
   2.210  
   2.211 -		[ "$COMPRESSION" == 'gzip' ] && colorize 31 "gzip-compressed rootfs unsupported and may fail to boot"
   2.212 +		[ "$COMPRESSION" = 'gzip' ] && colorize 31 "gzip-compressed rootfs unsupported and may fail to boot"
   2.213  		# Save some space
   2.214  		rm -rf /var/cache/tazpkg/*
   2.215  		rm -f  /var/lib/tazpkg/*.bak
     3.1 --- a/tazlito-wiz	Fri Jan 25 22:18:53 2019 +0100
     3.2 +++ b/tazlito-wiz	Tue Feb 26 08:21:00 2019 +0100
     3.3 @@ -94,7 +94,7 @@
     3.4  		name="$(echo $main | cut -d'|' -f1)"; name="${name:-custom}"
     3.5  		skel="$(echo $main | cut -d'|' -f2)"
     3.6  		flvf="$(echo $main | cut -d'|' -f5)"
     3.7 -		if [ ${flvf/*./} == flavor ]; then
     3.8 +		if [ ${flvf/*./} = flavor ]; then
     3.9  			cp -a $flvf $live ; skel=$(basename $flvf)
    3.10  		fi
    3.11  		echo "$skel" > $live/skel