tazpkg rev 972
Remove ashism ==
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 26 08:21:22 2019 +0100 (2019-02-26) |
parents | d2dc3d5ed06d |
children | 8fea88638913 |
files | modules/convert modules/get modules/install modules/recharge modules/upgrade tazpanel/pkgs.cgi tazpkg tazpkg-notify |
line diff
1.1 --- a/modules/convert Mon Nov 26 20:27:56 2018 +0200 1.2 +++ b/modules/convert Tue Feb 26 08:21:22 2019 +0100 1.3 @@ -755,7 +755,7 @@ 1.4 1.5 PACKAGE_FILE="$(realpath "$PACKAGE_FILE")" 1.6 debug "PACKAGE_FILE='$PACKAGE_FILE'" 1.7 -if [ "$(dd if="$PACKAGE_FILE" bs=8 count=1 skip=1 2>/dev/null)" == 'debian-b' ]; then 1.8 +if [ "$(dd if="$PACKAGE_FILE" bs=8 count=1 skip=1 2>/dev/null)" = 'debian-b' ]; then 1.9 convert_deb 1.10 else 1.11 case "$PACKAGE_FILE" in
2.1 --- a/modules/get Mon Nov 26 20:27:56 2018 +0200 2.2 +++ b/modules/get Tue Feb 26 08:21:22 2019 +0100 2.3 @@ -65,9 +65,9 @@ 2.4 2.5 local cache_dir 2.6 2.7 - if [ "$2" == 'extra' ]; then 2.8 + if [ "$2" = 'extra' ]; then 2.9 cache_dir="$SAVE_CACHE_DIR/extra/packages" 2.10 - elif [ "$1" == "$PKGS_DB" ]; then 2.11 + elif [ "$1" = "$PKGS_DB" ]; then 2.12 # Main repository 2.13 cache_dir="$SAVE_CACHE_DIR/$SLITAZ_RELEASE/packages" 2.14 else 2.15 @@ -487,7 +487,7 @@ 2.16 2.17 # Command 'get-install' calls 'get', then 'install' modules. Check package presence here, on the 2.18 # first stage, if '--forced' option not given 2.19 -if [ "$tazpkg_command" == 'get-install' ]; then 2.20 +if [ "$tazpkg_command" = 'get-install' ]; then 2.21 if grep -qs "^$1$" "$BLOCKED"; then 2.22 _ 'Package "%s" blocked.' "$1" >&2 2.23 exit 1
3.1 --- a/modules/install Mon Nov 26 20:27:56 2018 +0200 3.2 +++ b/modules/install Tue Feb 26 08:21:22 2019 +0100 3.3 @@ -27,7 +27,7 @@ 3.4 3.5 local extra 3.6 3.7 - [ "$1" == 'Installed' ] && \ 3.8 + [ "$1" = 'Installed' ] && \ 3.9 extra=" - $(fgrep " $PACKAGE-$VERSION" "$PKGS_DB/installed.$SUM" | awk '{print $1}')" 3.10 debug " extra='$extra'" 3.11 3.12 @@ -150,7 +150,7 @@ 3.13 "$num")" 3.14 3.15 3.16 - if [ "$AUTO_INSTALL_DEPS" == 'yes' ] || [ -n "$quiet" ]; then 3.17 + if [ "$AUTO_INSTALL_DEPS" = 'yes' ] || [ -n "$quiet" ]; then 3.18 # Quietly not displaying anything. Assume 'yes' unless '--noconfirm' is provided 3.19 answer=0 3.20 [ -n "$noconfirm" ] && answer=1 3.21 @@ -168,7 +168,7 @@ 3.22 3.23 # We can install packages from /home/boot/packages at boot time 3.24 # Also we can prefer local packages over mirrored/cached using '--local' option 3.25 - [ "$dir" == '/home/boot/packages' ] && local='yes' 3.26 + [ "$dir" = '/home/boot/packages' ] && local='yes' 3.27 debug " local='$local'" 3.28 3.29 # "--nodeps" option prevents to install dependencies 3.30 @@ -219,7 +219,7 @@ 3.31 # Extract receipt from each matched package 3.32 cpio -F "$pkgfile" -i receipt >/dev/null 2>&1 3.33 name=$(. ./receipt; echo $PACKAGE) 3.34 - [ "$name" == "$pkg" ] && found='1' && break 3.35 + [ "$name" = "$pkg" ] && found='1' && break 3.36 # Install the first matched package: normally there is only one package 3.37 # with the $PACKAGE matched in the receipt 3.38 rm receipt 3.39 @@ -399,7 +399,7 @@ 3.40 # Special mode for using in cookutils: clearly show whether freshly used package or cached one 3.41 if [ -n "$cookmode" ]; then 3.42 f=${PACKAGE_FILE%/*}; f=${f%/*}; f=${f##*/} 3.43 - if [ "$f" == "$(cat /etc/slitaz-release)" ]; then 3.44 + if [ "$f" = "$(cat /etc/slitaz-release)" ]; then 3.45 _ 'Installing (web/cache): %s' "$(basename $PACKAGE_FILE .tazpkg)" 3.46 else 3.47 _ 'Installing (pkg/local): %s' "$(basename $PACKAGE_FILE .tazpkg)" 3.48 @@ -460,7 +460,7 @@ 3.49 done ; 3.50 $check && \ 3.51 for i in *; do 3.52 - [ "$i" == "$PACKAGE" ] && continue 3.53 + [ "$i" = "$PACKAGE" ] && continue 3.54 [ -s "$i/files.list" ] || continue 3.55 awk "{ printf \"$i %s\\n\",\$1 }" < "$i/files.list" 3.56 done;
4.1 --- a/modules/recharge Mon Nov 26 20:27:56 2018 +0200 4.2 +++ b/modules/recharge Tue Feb 26 08:21:22 2019 +0100 4.3 @@ -81,7 +81,7 @@ 4.4 mirror=$(cat mirror); mirror="${mirror%/}/" 4.5 4.6 # Repository name 4.7 - if [ "$path" == "$PKGS_DB" ]; then 4.8 + if [ "$path" = "$PKGS_DB" ]; then 4.9 repo_name='Main' 4.10 else 4.11 repo_name="$(_n 'Undigest %s' "$(basename "$path")")"
5.1 --- a/modules/upgrade Mon Nov 26 20:27:56 2018 +0200 5.2 +++ b/modules/upgrade Tue Feb 26 08:21:22 2019 +0100 5.3 @@ -28,7 +28,7 @@ 5.4 5.5 repo_number=1 5.6 for repo in $PRIORITY; do 5.7 - if [ "$repo" == "$PKGS_DB" ]; then 5.8 + if [ "$repo" = "$PKGS_DB" ]; then 5.9 repo_name='Main' 5.10 else 5.11 repo_name="$(basename "$repo")"
6.1 --- a/tazpanel/pkgs.cgi Mon Nov 26 20:27:56 2018 +0200 6.2 +++ b/tazpanel/pkgs.cgi Tue Feb 26 08:21:22 2019 +0100 6.3 @@ -92,7 +92,7 @@ 6.4 # Package not installed 6.5 data_icon="@pkg@"; responce='n' 6.6 equivs=$(grep "^$pkg=" "$PKGS_DB/packages.equiv") 6.7 - if [ "$(GET pkg)" == "$pkg" -a -n "$equivs" ]; then 6.8 + if [ "$(GET pkg)" = "$pkg" -a -n "$equivs" ]; then 6.9 # Check equivalent packages 6.10 for equiv in ${equivs#*=}; do 6.11 case $equiv in 6.12 @@ -115,9 +115,9 @@ 6.13 fi 6.14 6.15 # Installed and blocked? 6.16 - [ "$data_icon" == "@pkgi@" ] && grep -q "^$pkg$" "$BLOCKED" && data_icon="@pkgib@" 6.17 + [ "$data_icon" = "@pkgi@" ] && grep -q "^$pkg$" "$BLOCKED" && data_icon="@pkgib@" 6.18 6.19 - if [ $(GET web) == 'y' ]; then 6.20 + if [ $(GET web) = 'y' ]; then 6.21 # Request from page http://pkgs.slitaz.org/ for example: 6.22 # http://127.0.0.1:82/pkgs.cgi?status&web=y&pkg=nano 6.23 # Allow http://pkgs.slitaz.org/ to get information from tazpanel server 6.24 @@ -302,7 +302,7 @@ 6.25 *add-repo) icon="@add@"; label=$(_n 'Add repository');; 6.26 toggle) icon="@toggle@"; label=$(_n 'Toggle all');; 6.27 esac 6.28 - if [ "$button" == 'toggle' ]; then 6.29 + if [ "$button" = 'toggle' ]; then 6.30 echo -n "<span class=\"float-right\"><button data-icon=\"$icon\" onclick=\"checkBoxes()\">$label</button></span>" 6.31 else 6.32 echo -n "<button data-icon=\"$icon\" name=\"${button%%=*}\" value=\"${button#*=}\"$misc>$label</button>" 6.33 @@ -409,8 +409,8 @@ 6.34 done 6.35 [ -f "$BLOCKED" ] && cat "$BLOCKED" 6.36 sed 's|.*|&\ti|' "$PKGS_DB/installed.info" 6.37 - [ "$cat" == 'extra' ] || [ $1 == 'my' ] || cat "$i/packages.info" 6.38 - [ "$cat" == 'extra' ] && 6.39 + [ "$cat" = 'extra' ] || [ $1 = 'my' ] || cat "$i/packages.info" 6.40 + [ "$cat" = 'extra' ] && 6.41 sed 's,\([^|]*\)|\([^|]*\)|\([^|]*\)|\([^|]*\)|\([^|]*\).*,\1\t\5\textra\t\2\thttp://mirror.slitaz.org/packages/get/\1\t-\t-\t-\t-,' "$PKGS_DB/extra.list" 6.42 # Last list entry will miss, so add fake line 6.43 echo 'zzzzzzzz' 6.44 @@ -510,7 +510,7 @@ 6.45 6.46 show_info_links() { 6.47 if [ -n "$1" ]; then 6.48 - if [ "$3" == 'tag' ]; then icon="@tag@"; else icon="@clock@"; fi 6.49 + if [ "$3" = 'tag' ]; then icon="@tag@"; else icon="@clock@"; fi 6.50 case "$4" in 6.51 provide) echo -n "<tr><td><b>$2</b></td><td>"; noeq=' ';; 6.52 '') echo -n "<tr><td><b>$2</b></td><td>"; noeq='';; 6.53 @@ -728,7 +728,7 @@ 6.54 [ ! -f $PKGS_DB/packages.info ] && msg warn \ 6.55 "$(_ 'You can not view a list of all packages until recharging lists.')" 6.56 6.57 - [ "$REMOTE_USER" == "root" ] && cat <<EOT 6.58 + [ "$REMOTE_USER" = "root" ] && cat <<EOT 6.59 <section> 6.60 <div>$(_ 'Selected packages:') <span id="countSelected"></span></div> 6.61 <footer> 6.62 @@ -769,7 +769,7 @@ 6.63 <p>$(_ 'Packages suggested by %s' "<b>$pkg</b>")</p> 6.64 EOT 6.65 6.66 - [ "$REMOTE_USER" == "root" ] && cat <<EOT 6.67 + [ "$REMOTE_USER" = "root" ] && cat <<EOT 6.68 <section> 6.69 <div>$(_ 'Selected packages:') <span id="countSelected"></span></div> 6.70 <footer> 6.71 @@ -981,7 +981,7 @@ 6.72 echo "<p>" 6.73 show_package_link "$name" 6.74 condition=${pkg%:*} 6.75 - [ "$name" == "$condition" ] || 6.76 + [ "$name" = "$condition" ] || 6.77 echo "($(_ "if") $(show_package_link "$condition")$(_ "is installed")) " 6.78 echo "</p>" 6.79 done 6.80 @@ -1003,7 +1003,7 @@ 6.81 if [ -d "$INSTALLED/$pkg" ]; then 6.82 . $INSTALLED/$pkg/receipt 6.83 files=$(wc -l < $INSTALLED/$pkg/files.list) 6.84 - [ "$REMOTE_USER" == 'root' ] && show_button do=Remove 6.85 + [ "$REMOTE_USER" = 'root' ] && show_button do=Remove 6.86 else 6.87 cd $PKGS_DB 6.88 eval "$(awk -F$'\t' -vp=$pkg ' 6.89 @@ -1022,7 +1022,7 @@ 6.90 fi 6.91 PACKED_SIZE=${SIZES% *} 6.92 UNPACKED_SIZE=${SIZES#* } 6.93 - [ "$REMOTE_USER" == 'root' ] && 6.94 + [ "$REMOTE_USER" = 'root' ] && 6.95 if [ "${pkg#get-}" != "$pkg" ]; then 6.96 show_button 'do=Install&nf' 6.97 else 6.98 @@ -1031,7 +1031,7 @@ 6.99 fi 6.100 6.101 # Show Block/Unblock and Repack buttons 6.102 - [ "$REMOTE_USER" == "root" ] && 6.103 + [ "$REMOTE_USER" = "root" ] && 6.104 if [ -d $INSTALLED/$pkg ]; then 6.105 if grep -qs "^$pkg$" "$BLOCKED"; then 6.106 show_button do=Unblock 6.107 @@ -1235,7 +1235,7 @@ 6.108 6.109 cache_files=$(find $CACHE_DIR -name '*.tazpkg' | wc -l) 6.110 cache_size=$(du -sh $CACHE_DIR | cut -f1 | sed 's|\.0||') 6.111 - [ "$cache_files" == 0 ] && cache_size="0K" 6.112 + [ "$cache_files" = 0 ] && cache_size="0K" 6.113 mirror=$(cat $PKGS_DB/mirror) 6.114 default_mirror=${mirror%/packages/*} 6.115 cat <<EOT 6.116 @@ -1493,7 +1493,7 @@ 6.117 tag=$(GET tag) 6.118 tazpanel_header "$(_ 'Tag "%s"' $tag)" 6.119 6.120 - [ "$REMOTE_USER" == 'root' ] && cat <<EOT 6.121 + [ "$REMOTE_USER" = 'root' ] && cat <<EOT 6.122 <section> 6.123 <div>$(_ 'Selected packages:') <span id="countSelected"></span></div> 6.124 <footer>
7.1 --- a/tazpkg Mon Nov 26 20:27:56 2018 +0200 7.2 +++ b/tazpkg Tue Feb 26 08:21:22 2019 +0100 7.3 @@ -114,7 +114,7 @@ 7.4 # If not and user is root we create them. 7.5 7.6 check_base_dir() { 7.7 - if [ "$(id -u)" == '0' ]; then 7.8 + if [ "$(id -u)" = '0' ]; then 7.9 check_dir $1$CACHE_DIR 7.10 check_dir $1$INSTALLED 7.11 check_dir $1$SLITAZ_LOGS 7.12 @@ -214,7 +214,7 @@ 7.13 log_pkg() { 7.14 local extra 7.15 7.16 - [ "$1" == 'Installed' ] && \ 7.17 + [ "$1" = 'Installed' ] && \ 7.18 extra=" - $(fgrep " $PACKAGE-$VERSION" $PKGS_DB/installed.$SUM | awk '{ print $1 }')" 7.19 7.20 [ -e "$LOG" ] || touch $LOG
8.1 --- a/tazpkg-notify Mon Nov 26 20:27:56 2018 +0200 8.2 +++ b/tazpkg-notify Tue Feb 26 08:21:22 2019 +0100 8.3 @@ -77,7 +77,7 @@ 8.4 if [ ! -f "$PKGS_DB/packages.info" ]; then 8.5 tooltip="$(_ 'No packages list found')" 8.6 set_yad_action "$cmd_recharge" "$tooltip" 8.7 - [ "$(notify "$tooltip" '1' "$(_n 'Recharge lists')")" == '1' ] && $cmd_recharge 8.8 + [ "$(notify "$tooltip" '1' "$(_n 'Recharge lists')")" = '1' ] && $cmd_recharge 8.9 quit 8.10 fi 8.11 8.12 @@ -85,7 +85,7 @@ 8.13 if [ -n "$mtime" ]; then 8.14 tooltip="$(_ 'Your packages list is older than 10 days')" 8.15 set_yad_action "$cmd_recharge" "$tooltip" 8.16 - [ "$(notify "$tooltip" '1' "$(_n 'Recharge lists')")" == '1' ] && $cmd_recharge 8.17 + [ "$(notify "$tooltip" '1' "$(_n 'Recharge lists')")" = '1' ] && $cmd_recharge 8.18 quit 8.19 fi 8.20 8.21 @@ -96,7 +96,7 @@ 8.22 'There are %s upgradeable packages' "$up" \ 8.23 "<b>$up</b>")" 8.24 set_yad_action "$cmd_up" "$tooltip" 8.25 - [ "$(notify "$tooltip" '1' "$(_n 'Check upgrade')")" == '1' ] && $cmd_up 8.26 + [ "$(notify "$tooltip" '1' "$(_n 'Check upgrade')")" = '1' ] && $cmd_up 8.27 quit 8.28 fi 8.29