spk rev 161 tip

Remove ashism ==
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 26 12:27:19 2019 +0100 (13 months ago)
parents c6b5c649a7a3
children
files lib/libspk.sh spk spk-add spk-convert spk-ls spk-mirror spk-rm spk-up
line diff
     1.1 --- a/lib/libspk.sh	Thu Feb 16 19:22:27 2017 +0100
     1.2 +++ b/lib/libspk.sh	Tue Feb 26 12:27:19 2019 +0100
     1.3 @@ -185,7 +185,7 @@
     1.4  		return 0
     1.5  	else
     1.6  		[ "$verbose" ] && echo "URL: $uri/"
     1.7 -		if [ "$db" == "$PKGS_DB" ]; then
     1.8 +		if [ "$db" = "$PKGS_DB" ]; then
     1.9  			gettext "Using official mirror:"
    1.10  		else
    1.11  			gettext "Using extra mirror:"
     2.1 --- a/spk	Thu Feb 16 19:22:27 2017 +0100
     2.2 +++ b/spk	Tue Feb 26 12:27:19 2019 +0100
     2.3 @@ -122,7 +122,7 @@
     2.4  			package_full=$(full_package $pkg)
     2.5  			mirrored_pkg $pkg
     2.6  			[ "$mirrored" ] || continue
     2.7 -			[ "$count" == 0 ] && newline
     2.8 +			[ "$count" = 0 ] && newline
     2.9  			count=$(($count + 1))
    2.10  			download $package_full $mirror
    2.11  			unset_mirrored
    2.12 @@ -168,7 +168,7 @@
    2.13  				# Display package's log
    2.14  				if [ -f "$logdir/$pkg/install.log" ]; then
    2.15  					count=$(($count + 1))
    2.16 -					[ "$count" == "1" ] && newline
    2.17 +					[ "$count" = "1" ] && newline
    2.18  					colorize 36 $(gettext "Install log for:"; echo " $pkg")
    2.19  					separator
    2.20  					cat $logdir/$pkg/install.log
    2.21 @@ -194,7 +194,7 @@
    2.22  				continue ;;
    2.23  		esac
    2.24  		count=$(($count + 1))
    2.25 -		[ "$count" == 1 ] && newline
    2.26 +		[ "$count" = 1 ] && newline
    2.27  		unset_receipt
    2.28  		source_receipt $installed/$pkg/receipt
    2.29  		boldify $(gettext "Package") $pkg
    2.30 @@ -215,7 +215,7 @@
    2.31  				continue ;;
    2.32  		esac
    2.33  		count=$(($count + 1))
    2.34 -		[ "$count" == 1 ] && newline
    2.35 +		[ "$count" = 1 ] && newline
    2.36  		boldify $(gettext "Package") $pkg
    2.37  		separator
    2.38  		gettext "Status     :"; colorize 31 " not installed"
     3.1 --- a/spk-add	Thu Feb 16 19:22:27 2017 +0100
     3.2 +++ b/spk-add	Tue Feb 26 12:27:19 2019 +0100
     3.3 @@ -164,9 +164,9 @@
     3.4  			local count=0
     3.5  			for pkg_file in $list; do
     3.6  				local name=$(basename $(dirname $pkg_file))
     3.7 -				[  "$package_name" == "$name" ] && continue 2
     3.8 +				[  "$package_name" = "$name" ] && continue 2
     3.9  				count=$(($count +1))
    3.10 -				[ "$count" == "1" ] && gettext "Modified package:"; \
    3.11 +				[ "$count" = "1" ] && gettext "Modified package:"; \
    3.12  					colorize 31 " $name"
    3.13  				gettext "Overwriting file:"; echo " $file"
    3.14  				# If confirm is set, ask to remove. Do we want that ?
    3.15 @@ -275,7 +275,7 @@
    3.16  	local package_file="$1"
    3.17  	#check_valid_tazpkg $package_file
    3.18  	if [ -f "$package_file" ]; then
    3.19 -		if [ $(dirname $package_file) == "." ]; then
    3.20 +		if [ $(dirname $package_file) = "." ]; then
    3.21  			package_file=$(pwd)/$package_file
    3.22  		fi
    3.23  		debug "package file: $package_file"
    3.24 @@ -289,7 +289,7 @@
    3.25  	extract_receipt $tmpdir $package_file
    3.26  	source $tmpdir/receipt
    3.27  	[ "$forced" ] || check_installed $PACKAGE
    3.28 -	[ "$count" == "1" ] && newline
    3.29 +	[ "$count" = "1" ] && newline
    3.30  	install_package $package_file
    3.31  	update_databases
    3.32  }
    3.33 @@ -323,7 +323,7 @@
    3.34  	esac
    3.35  
    3.36  	# Lets fetch the package by download()
    3.37 -	[ "$count" == 1 ] && newline
    3.38 +	[ "$count" = 1 ] && newline
    3.39  	debug "spk-add package: $package_name"
    3.40  	download "$package_full" $mirror
    3.41  	cd $CACHE_DIR
     4.1 --- a/spk-convert	Thu Feb 16 19:22:27 2017 +0100
     4.2 +++ b/spk-convert	Tue Feb 26 12:27:19 2019 +0100
     4.3 @@ -465,7 +465,7 @@
     4.4  
     4.5  for pkg in $@
     4.6  do
     4.7 -	if [ "$(dd if=$pkg bs=8 count=1 skip=1 2> /dev/null)" == "debian-b" ]; 
     4.8 +	if [ "$(dd if=$pkg bs=8 count=1 skip=1 2> /dev/null)" = "debian-b" ]; 
     4.9  	then
    4.10  		convert_deb $pkg
    4.11  	else
     5.1 --- a/spk-ls	Thu Feb 16 19:22:27 2017 +0100
     5.2 +++ b/spk-ls	Tue Feb 26 12:27:19 2019 +0100
     5.3 @@ -109,7 +109,7 @@
     5.4  				[ -f "$installed/$pkg/files.list" ] || continue
     5.5  				nb=$(cat $installed/$pkg/files.list | wc -l)
     5.6  				count=$(($count + 1))
     5.7 -				[ "$count" == 1 ] && newline
     5.8 +				[ "$count" = 1 ] && newline
     5.9  				# List modifiers
    5.10  				if [ "$modifiers" ]; then
    5.11  					modifiers=$installed/$pkg/modifiers
     6.1 --- a/spk-mirror	Thu Feb 16 19:22:27 2017 +0100
     6.2 +++ b/spk-mirror	Tue Feb 26 12:27:19 2019 +0100
     6.3 @@ -161,7 +161,7 @@
     6.4  	[ -d "$url" ] && url="dir:$url"
     6.5  	case "$url" in
     6.6  		http://*|ftp://|local)
     6.7 -			[ "$count" == 0 ] && newline
     6.8 +			[ "$count" = 0 ] && newline
     6.9  			count=$(($count + 1))
    6.10  			url="${url%/}/"
    6.11  			debug "checking: $url"
    6.12 @@ -215,7 +215,7 @@
    6.13  			pkgsdir=${dir%/}
    6.14  			debug "dir: $dir"
    6.15  			nb=$(ls $pkgsdir/*.tazpkg 2>/dev/null | wc -l)
    6.16 -			if [ "$nb" == 0 ]; then
    6.17 +			if [ "$nb" = 0 ]; then
    6.18  				gettext "No packages found in:"; boldify " $pkgsdir"
    6.19  				continue
    6.20  			fi
    6.21 @@ -284,7 +284,7 @@
    6.22  			fi ;;
    6.23  		--*) continue ;;
    6.24  		*)
    6.25 -			[ "$count" == 0 ] && newline
    6.26 +			[ "$count" = 0 ] && newline
    6.27  			count=$(($count + 1))
    6.28  			# Should we handle --rm also here ?
    6.29  			if [ -d "$extradb/$url" ]; then
     7.1 --- a/spk-rm	Thu Feb 16 19:22:27 2017 +0100
     7.2 +++ b/spk-rm	Tue Feb 26 12:27:19 2019 +0100
     7.3 @@ -149,7 +149,7 @@
     7.4  		continue
     7.5  	fi
     7.6  	count=$(($count + 1))
     7.7 -	[ "$count" == 1 ] && newline
     7.8 +	[ "$count" = 1 ] && newline
     7.9  	remove
    7.10  	log "Removed package: $pkg"
    7.11  done
     8.1 --- a/spk-up	Thu Feb 16 19:22:27 2017 +0100
     8.2 +++ b/spk-up	Tue Feb 26 12:27:19 2019 +0100
     8.3 @@ -53,7 +53,7 @@
     8.4  	local check="$extradb/*/mirror $PKGS_DB/mirror"
     8.5  	if [ "$mirror" ]; then
     8.6  		check=$extradb/$mirror/mirror
     8.7 -		[ "$mirror" == "main" ] && check=$PKGS_DB/mirror
     8.8 +		[ "$mirror" = "main" ] && check=$PKGS_DB/mirror
     8.9  	fi
    8.10  	for mirror in $check; do
    8.11  		[ -f "$mirror" ] || continue
    8.12 @@ -63,7 +63,7 @@
    8.13  		name=$(basename $(dirname $mirror))
    8.14  		url=$(cat $mirror)
    8.15  		lists="packages.list packages.md5 packages.desc packages.equiv files.list.lzma"
    8.16 -		[ "$(dirname $mirror)" == "$PKGS_DB" ] && name="main"
    8.17 +		[ "$(dirname $mirror)" = "$PKGS_DB" ] && name="main"
    8.18  		[ "$quiet" ] && quiet="-q"
    8.19  
    8.20  		gettext "Checking mirror:"; colorize 34 " $name"
    8.21 @@ -75,7 +75,7 @@
    8.22  		wget -q ${url%/}/ID
    8.23  		debug "ID: $(cat ID)"
    8.24  		debug "ID.bak: $(cat ID.bak)"
    8.25 -		if [ $(cat ID) == $(cat ID.bak) ] && [ ! "$forced" ]; then
    8.26 +		if [ $(cat ID) = $(cat ID.bak) ] && [ ! "$forced" ]; then
    8.27  			gettext "Mirror is up-to-date"; newline
    8.28  			continue
    8.29  		fi
    8.30 @@ -120,7 +120,7 @@
    8.31  
    8.32  	new=$(grep "^$PACKAGE |" $dbdesc | awk '{print $3}')
    8.33  
    8.34 -	if [ "$VERSION" == "$new" ]; then
    8.35 +	if [ "$VERSION" = "$new" ]; then
    8.36  		build_count=$(($build_count + 1))
    8.37  		echo -n $(colorize 34 $(indent 48 $(gettext "New build")))
    8.38  	else
    8.39 @@ -200,7 +200,7 @@
    8.40  			pkg="$arg"
    8.41  			system=no
    8.42  			check_root
    8.43 -			[ "$count" == 0 ] && up_headers
    8.44 +			[ "$count" = 0 ] && up_headers
    8.45  			if is_package_installed $pkg; then
    8.46  				count=$(($count +1))
    8.47  				cd $installed
    8.48 @@ -252,7 +252,7 @@
    8.49  pkgs=$(ls | wc -l)
    8.50  time=$(($(date +%s) - $time))
    8.51  
    8.52 -if [ "$upnb" == 0 ] && [ "$blocked_count" == 0 ]; then
    8.53 +if [ "$upnb" = 0 ] && [ "$blocked_count" = 0 ]; then
    8.54  	gettext "System is up-to-date..."; newline
    8.55  fi
    8.56  separator