tazlito diff 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
line diff
     1.1 --- a/tazlito	Fri Jan 25 22:18:53 2019 +0100
     1.2 +++ b/tazlito	Tue Feb 26 08:21:00 2019 +0100
     1.3 @@ -102,7 +102,7 @@
     1.4  # Print the usage.
     1.5  
     1.6  usage () {
     1.7 -	[ $(basename $0) == 'tazlito' ] && cat <<EOT
     1.8 +	[ $(basename $0) = 'tazlito' ] && cat <<EOT
     1.9  
    1.10  SliTaz Live Tool - Version: $(colorize 34 "$VERSION")
    1.11  
    1.12 @@ -224,7 +224,7 @@
    1.13  		unset VERSION EXTRAVERSION
    1.14  		eval $(grep -s ^VERSION=      $INSTALLED/$i/receipt)
    1.15  		eval $(grep -s ^EXTRAVERSION= $INSTALLED/$i/receipt)
    1.16 -		if [ "$i-$VERSION$EXTRAVERSION" == "$tazpkg" ]; then
    1.17 +		if [ "$i-$VERSION$EXTRAVERSION" = "$tazpkg" ]; then
    1.18  			echo $i
    1.19  			break
    1.20  		fi
    1.21 @@ -289,7 +289,7 @@
    1.22  		while [ $sz -gt 0 ]; do
    1.23  			local len=$(get $e "$2")
    1.24  			[ "$(dd if="$2" bs=1 skip=$(($e+33)) count=${#i} \
    1.25 -				2>/dev/null)" == "$i" ] && continue 2
    1.26 +				2>/dev/null)" = "$i" ] && continue 2
    1.27  			[ $len -eq 0 ] && break
    1.28  			sz=$(($sz-$len))
    1.29  			e=$(($e+$len))
    1.30 @@ -481,7 +481,7 @@
    1.31  		*taz64) efifile=bootx64.efi ;;
    1.32  		esac
    1.33  		if [ ! -s $basedir/efi/boot/$efifile ] &&
    1.34 -		   [ $(get $((0x82)) "$1") == $((0x4550)) ]; then
    1.35 +		   [ $(get $((0x82)) "$1") = $((0x4550)) ]; then
    1.36  			mkdir -p $basedir/efi/boot 2> /dev/null
    1.37  			ln "$1" "$basedir/efi/boot/$efifile"
    1.38  			stat -c "%s %n" "$1"
    1.39 @@ -551,7 +551,7 @@
    1.40  
    1.41  	# Create boot sector
    1.42  	doslabel="$(echo "SLITAZ BOOT         " | od -v -N 11 -t x1 -w1 -An)"
    1.43 -	if [ "$ftype" == "33 32" ]; then
    1.44 +	if [ "$ftype" = "33 32" ]; then
    1.45  		hexdump -R <<EOT | dd of=$basedir/boot/isolinux/efi.img \
    1.46  			conv=notrunc
    1.47  0  eb 58 90 53 6c 69 54 61  7a 00 00 00 02 04 $rsect 00  |
    1.48 @@ -838,7 +838,7 @@
    1.49  			cpio -o -H newc > "/$INITRAMFS"
    1.50  			;;
    1.51  	esac < /tmp/list
    1.52 -	[ "$align" == 'y' -a -z "$noalign" ] && align_to_32bits "/$INITRAMFS"
    1.53 +	[ "$align" = 'y' -a -z "$noalign" ] && align_to_32bits "/$INITRAMFS"
    1.54  	echo 1 > /tmp/rootfs
    1.55  }
    1.56  
    1.57 @@ -846,12 +846,12 @@
    1.58  # Deduplicate files (MUST be on the same filesystem).
    1.59  
    1.60  deduplicate() {
    1.61 -	find "${@:-.}" -type f -size +0c -xdev -exec stat -c '%s-%a-%u-%g %i %h %n' {} \; | sort | \
    1.62 +	find "${@:-.}" -xdev -type f -size +0c -exec stat -c '%s-%a-%u-%g %i %h %n' {} \; | sort | \
    1.63  		(
    1.64  			save=0; hardlinks=0; old_attr=""; old_inode=""; old_link=""; old_file=""
    1.65  			while read attr inode link file; do
    1.66  				[ -L "$file" ] && continue
    1.67 -				if [ "$attr" == "$old_attr" -a "$inode" != "$old_inode" ]; then
    1.68 +				if [ "$attr" = "$old_attr" -a "$inode" != "$old_inode" ]; then
    1.69  					if cmp "$file" "$old_file" >/dev/null 2>&1 ; then
    1.70  						rm -f "$file"
    1.71  						if ln "$old_file" "$file" 2>/dev/null; then
    1.72 @@ -868,12 +868,12 @@
    1.73  			_ '%s Kbytes saved in %s duplicate files.' "$save" "$hardlinks"
    1.74  		)
    1.75  
    1.76 -	find "$@" -type l -xdev -exec stat -c '%s-%u-%g-TARGET- %i %h %n' {} \; | sort | \
    1.77 +	find "$@" -xdev -type l -exec stat -c '%s-%u-%g-TARGET- %i %h %n' {} \; | sort | \
    1.78  		(
    1.79  			old_attr=""; hardlinks=0;
    1.80  			while read attr inode link file; do
    1.81  				attr="${attr/-TARGET-/-$(readlink $file)}"
    1.82 -				if [ "$attr" == "$old_attr" ]; then
    1.83 +				if [ "$attr" = "$old_attr" ]; then
    1.84  					if [ "$inode" != "$old_inode" ]; then
    1.85  						rm -f "$file"
    1.86  						if ln "$old_file" "$file" 2>/dev/null; then
    1.87 @@ -1025,7 +1025,7 @@
    1.88  		done
    1.89  		touch -t 197001010100.00 $1.*
    1.90  		# Info to be stored inside ISO
    1.91 -		[ "$2" == info ] && echo -e $infos | cpio -o -H newc | dogzip info
    1.92 +		[ "$2" = info ] && echo -e $infos | cpio -o -H newc | dogzip info
    1.93  		rm $1.list*
    1.94  
    1.95  		# Renames
    1.96 @@ -1060,16 +1060,16 @@
    1.97  		return 1
    1.98  
    1.99  	elif [ -L "$1" ] && [ -L "$2" ]; then
   1.100 -		[ "$(readlink "$1")" == "$(readlink "$2")" ] && return 0
   1.101 +		[ "$(readlink "$1")" = "$(readlink "$2")" ] && return 0
   1.102  
   1.103  	elif [ -f "$1" ] && [ -f "$2" ]; then
   1.104  		cmp -s "$1" "$2" && return 0
   1.105  
   1.106 -		[ "$(basename "$3")" == 'volatile.cpio.gz' ] &&
   1.107 -		[ "$(dirname $(dirname "$3"))" == ".$INSTALLED" ] &&
   1.108 +		[ "$(basename "$3")" = 'volatile.cpio.gz' ] &&
   1.109 +		[ "$(dirname $(dirname "$3"))" = ".$INSTALLED" ] &&
   1.110  			return 0
   1.111  
   1.112 -	elif [ "$(ls -l "$1"|cut -c1-10)$(stat -c '%a:%u:%g:%t:%T' "$1")" == \
   1.113 +	elif [ "$(ls -l "$1"|cut -c1-10)$(stat -c '%a:%u:%g:%t:%T' "$1")" = \
   1.114  	       "$(ls -l "$2"|cut -c1-10)$(stat -c '%a:%u:%g:%t:%T' "$2")" ]; then 
   1.115  			return 0
   1.116  
   1.117 @@ -1331,7 +1331,7 @@
   1.118  		cp /lib/modules/$v/kernel/fs/$aufs/$aufs.ko.?z \
   1.119  			$TMP_DIR/initfs/lib/modules/${v/*taz/}
   1.120  	done
   1.121 -	if [ "$1" == 'cdrom' ]; then
   1.122 +	if [ "$1" = 'cdrom' ]; then
   1.123  		sed -i '/mod squashfs/d' $TMP_DIR/initfs/init
   1.124  	else
   1.125  		[ ! -f /usr/sbin/mksquashfs ] && ! install_package squashfs && return 1
   1.126 @@ -1347,7 +1347,7 @@
   1.127  		#ls /sbin/unsquashfs /usr/lib/liblzma.so* $INSTALLED/squashfs/* | \
   1.128  		#cpio -o -H newc > $TMP_DIR/initfs/extractfs.cpio
   1.129  	fi
   1.130 -	if [ "$1" == 'http' ]; then
   1.131 +	if [ "$1" = 'http' ]; then
   1.132  		mkdir $TMP_DIR/initfs/etc $TMP_DIR/fs
   1.133  		ln -s /proc/mounts $TMP_DIR/initfs/etc/mtab
   1.134  		cp /usr/share/udhcpc/default.script $TMP_DIR/initfs/lib/udhcpc
   1.135 @@ -1438,7 +1438,7 @@
   1.136  	$need_lib && for i in /lib/ld-* /lib/lib[cm][-\.]* ; do
   1.137  		cp -a $i $TMP_DIR/initfs/lib
   1.138  	done
   1.139 -	[ "$1" == 'http' ] && cat > $TMP_DIR/initfs/init <<EOTEOT
   1.140 +	[ "$1" = 'http' ] && cat > $TMP_DIR/initfs/init <<EOTEOT
   1.141  #!/bin/sh
   1.142  
   1.143  getarg() {
   1.144 @@ -1582,7 +1582,7 @@
   1.145  		deduplicate
   1.146  		cd - > /dev/null
   1.147  		rootfs=$TMP_DIR/$(basename $i 64)
   1.148 -		[ $rootfs == $TMP_DIR/rootfs.gz ] && rootfs=$TMP_DIR/rootfs0.gz
   1.149 +		[ $rootfs = $TMP_DIR/rootfs.gz ] && rootfs=$TMP_DIR/rootfs0.gz
   1.150  		/usr/sbin/mksquashfs $TMP_DIR/fs $rootfs -comp ${1:-xz -Xbcj x86}
   1.151  		cd $TMP_DIR
   1.152  		rootfs_sizes="$rootfs_sizes $(( $(du -s $TMP_DIR/fs | cut -f1) - $(du -s $rootfs | cut -f1) ))"
   1.153 @@ -1673,7 +1673,7 @@
   1.154  		local new
   1.155  		set -- $append
   1.156  		shift
   1.157 -		[ "$1" == "ifmem" ] && shift
   1.158 +		[ "$1" = "ifmem" ] && shift
   1.159  		new=""
   1.160  		while [ -n "$2" ]; do
   1.161  			local s
   1.162 @@ -1734,7 +1734,7 @@
   1.163  	cat $1$INSTALLED/*/md5sum | \
   1.164  	while read md5 file; do
   1.165  		[ -e "$1$file" ] || continue
   1.166 -		[ "$(md5sum < "$1$file")" == "$md5  -" ] &&
   1.167 +		[ "$(md5sum < "$1$file")" = "$md5  -" ] &&
   1.168  		rm -f "$1$file"
   1.169  	done
   1.170  
   1.171 @@ -2200,7 +2200,7 @@
   1.172  		status
   1.173  
   1.174  		for i in $(ls $TMP_DIR); do
   1.175 -			[ "$i" == 'boot' ] && continue
   1.176 +			[ "$i" = 'boot' ] && continue
   1.177  			cp -a "$TMP_DIR/$i" "$TARGET/rootcd"
   1.178  		done
   1.179  
   1.180 @@ -2366,7 +2366,7 @@
   1.181  			EXTRAVERSION=""
   1.182  			eval $(grep ^EXTRAVERSION= $ROOTFS$INSTALLED/$i/receipt)
   1.183  			eval $(grep ^CATEGORY= $ROOTFS$INSTALLED/$i/receipt)
   1.184 -			if [ "$CATEGORY" == 'non-free' -a "${i%%-*}" != 'get' ]; then
   1.185 +			if [ "$CATEGORY" = 'non-free' -a "${i%%-*}" != 'get' ]; then
   1.186  				echo "$i" >> $FLAVOR.nonfree
   1.187  			else
   1.188  				echo "$i-$VERSION$EXTRAVERSION" >> $FLAVOR.pkglist
   1.189 @@ -2728,7 +2728,7 @@
   1.190  				if [ ! -d "$ADDFILES/rootcd" ] ; then
   1.191  					mkdir -p "$ADDFILES/rootcd"
   1.192  					for i in $(ls $TMP_MNT); do
   1.193 -						[ "$i" == 'boot' ] && continue
   1.194 +						[ "$i" = 'boot' ] && continue
   1.195  						cp -a "$TMP_MNT/$i" "$ADDFILES/rootcd"
   1.196  					done
   1.197  				fi
   1.198 @@ -2747,7 +2747,7 @@
   1.199  		cp -f /etc/slitaz-release    $root/etc/slitaz-release
   1.200  		strip_versions "$LIST_NAME"
   1.201  
   1.202 -		if [ "$REPACK" == 'y' ]; then
   1.203 +		if [ "$REPACK" = 'y' ]; then
   1.204  			# Determine full packages list with all dependencies
   1.205  			tmp_dir="$(mktemp -d)"
   1.206  			cp "$LIST_NAME" "$tmp_dir/flavor.pkglist"
   1.207 @@ -3017,7 +3017,7 @@
   1.208  		newline
   1.209  		emsg "<b>Archive compression:</b> <c 36>$COMPRESSION</c>"
   1.210  
   1.211 -		[ "$COMPRESSION" == 'gzip' ] && colorize 31 "gzip-compressed rootfs unsupported and may fail to boot"
   1.212 +		[ "$COMPRESSION" = 'gzip' ] && colorize 31 "gzip-compressed rootfs unsupported and may fail to boot"
   1.213  		# Save some space
   1.214  		rm -rf /var/cache/tazpkg/*
   1.215  		rm -f  /var/lib/tazpkg/*.bak