Skip to content

Commit

Permalink
Remove ashism ==
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Bellard committed Feb 26, 2019
1 parent 6b5657f commit ee0da13
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion modules/convert
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ convert_tcz() {

PACKAGE_FILE="$(realpath "$PACKAGE_FILE")"
debug "PACKAGE_FILE='$PACKAGE_FILE'"
if [ "$(dd if="$PACKAGE_FILE" bs=8 count=1 skip=1 2>/dev/null)" == 'debian-b' ]; then
if [ "$(dd if="$PACKAGE_FILE" bs=8 count=1 skip=1 2>/dev/null)" = 'debian-b' ]; then
convert_deb
else
case "$PACKAGE_FILE" in
Expand Down
6 changes: 3 additions & 3 deletions modules/get
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ get_cache_path() {

local cache_dir

if [ "$2" == 'extra' ]; then
if [ "$2" = 'extra' ]; then
cache_dir="$SAVE_CACHE_DIR/extra/packages"
elif [ "$1" == "$PKGS_DB" ]; then
elif [ "$1" = "$PKGS_DB" ]; then
# Main repository
cache_dir="$SAVE_CACHE_DIR/$SLITAZ_RELEASE/packages"
else
Expand Down Expand Up @@ -487,7 +487,7 @@ get_pkg_cookmode() {

# Command 'get-install' calls 'get', then 'install' modules. Check package presence here, on the
# first stage, if '--forced' option not given
if [ "$tazpkg_command" == 'get-install' ]; then
if [ "$tazpkg_command" = 'get-install' ]; then
if grep -qs "^$1$" "$BLOCKED"; then
_ 'Package "%s" blocked.' "$1" >&2
exit 1
Expand Down
12 changes: 6 additions & 6 deletions modules/install
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ log_pkg() {

local extra

[ "$1" == 'Installed' ] && \
[ "$1" = 'Installed' ] && \
extra=" - $(fgrep " $PACKAGE-$VERSION" "$PKGS_DB/installed.$SUM" | awk '{print $1}')"
debug " extra='$extra'"

Expand Down Expand Up @@ -150,7 +150,7 @@ install_all_deps() {
"$num")"


if [ "$AUTO_INSTALL_DEPS" == 'yes' ] || [ -n "$quiet" ]; then
if [ "$AUTO_INSTALL_DEPS" = 'yes' ] || [ -n "$quiet" ]; then
# Quietly not displaying anything. Assume 'yes' unless '--noconfirm' is provided
answer=0
[ -n "$noconfirm" ] && answer=1
Expand All @@ -168,7 +168,7 @@ install_all_deps() {

# We can install packages from /home/boot/packages at boot time
# Also we can prefer local packages over mirrored/cached using '--local' option
[ "$dir" == '/home/boot/packages' ] && local='yes'
[ "$dir" = '/home/boot/packages' ] && local='yes'
debug " local='$local'"

# "--nodeps" option prevents to install dependencies
Expand Down Expand Up @@ -219,7 +219,7 @@ install_all_deps() {
# Extract receipt from each matched package
cpio -F "$pkgfile" -i receipt >/dev/null 2>&1
name=$(. ./receipt; echo $PACKAGE)
[ "$name" == "$pkg" ] && found='1' && break
[ "$name" = "$pkg" ] && found='1' && break
# Install the first matched package: normally there is only one package
# with the $PACKAGE matched in the receipt
rm receipt
Expand Down Expand Up @@ -399,7 +399,7 @@ EOT
# Special mode for using in cookutils: clearly show whether freshly used package or cached one
if [ -n "$cookmode" ]; then
f=${PACKAGE_FILE%/*}; f=${f%/*}; f=${f##*/}
if [ "$f" == "$(cat /etc/slitaz-release)" ]; then
if [ "$f" = "$(cat /etc/slitaz-release)" ]; then
_ 'Installing (web/cache): %s' "$(basename $PACKAGE_FILE .tazpkg)"
else
_ 'Installing (pkg/local): %s' "$(basename $PACKAGE_FILE .tazpkg)"
Expand Down Expand Up @@ -460,7 +460,7 @@ EOT
done ;
$check && \
for i in *; do
[ "$i" == "$PACKAGE" ] && continue
[ "$i" = "$PACKAGE" ] && continue
[ -s "$i/files.list" ] || continue
awk "{ printf \"$i %s\\n\",\$1 }" < "$i/files.list"
done;
Expand Down
2 changes: 1 addition & 1 deletion modules/recharge
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ for path in $repo_to_recharge; do
mirror=$(cat mirror); mirror="${mirror%/}/"

# Repository name
if [ "$path" == "$PKGS_DB" ]; then
if [ "$path" = "$PKGS_DB" ]; then
repo_name='Main'
else
repo_name="$(_n 'Undigest %s' "$(basename "$path")")"
Expand Down
2 changes: 1 addition & 1 deletion modules/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tmp_up_list=$(mktemp)

repo_number=1
for repo in $PRIORITY; do
if [ "$repo" == "$PKGS_DB" ]; then
if [ "$repo" = "$PKGS_DB" ]; then
repo_name='Main'
else
repo_name="$(basename "$repo")"
Expand Down
30 changes: 15 additions & 15 deletions tazpanel/pkgs.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ case " $(GET) " in
# Package not installed
data_icon="@pkg@"; responce='n'
equivs=$(grep "^$pkg=" "$PKGS_DB/packages.equiv")
if [ "$(GET pkg)" == "$pkg" -a -n "$equivs" ]; then
if [ "$(GET pkg)" = "$pkg" -a -n "$equivs" ]; then
# Check equivalent packages
for equiv in ${equivs#*=}; do
case $equiv in
Expand All @@ -115,9 +115,9 @@ case " $(GET) " in
fi

# Installed and blocked?
[ "$data_icon" == "@pkgi@" ] && grep -q "^$pkg$" "$BLOCKED" && data_icon="@pkgib@"
[ "$data_icon" = "@pkgi@" ] && grep -q "^$pkg$" "$BLOCKED" && data_icon="@pkgib@"

if [ $(GET web) == 'y' ]; then
if [ $(GET web) = 'y' ]; then
# Request from page http://pkgs.slitaz.org/ for example:
# http://127.0.0.1:82/pkgs.cgi?status&web=y&pkg=nano
# Allow http://pkgs.slitaz.org/ to get information from tazpanel server
Expand Down Expand Up @@ -302,7 +302,7 @@ show_button() {
*add-repo) icon="@add@"; label=$(_n 'Add repository');;
toggle) icon="@toggle@"; label=$(_n 'Toggle all');;
esac
if [ "$button" == 'toggle' ]; then
if [ "$button" = 'toggle' ]; then
echo -n "<span class=\"float-right\"><button data-icon=\"$icon\" onclick=\"checkBoxes()\">$label</button></span>"
else
echo -n "<button data-icon=\"$icon\" name=\"${button%%=*}\" value=\"${button#*=}\"$misc>$label</button>"
Expand Down Expand Up @@ -409,8 +409,8 @@ show_list() {
done
[ -f "$BLOCKED" ] && cat "$BLOCKED"
sed 's|.*|&\ti|' "$PKGS_DB/installed.info"
[ "$cat" == 'extra' ] || [ $1 == 'my' ] || cat "$i/packages.info"
[ "$cat" == 'extra' ] &&
[ "$cat" = 'extra' ] || [ $1 = 'my' ] || cat "$i/packages.info"
[ "$cat" = 'extra' ] &&
sed 's,\([^|]*\)|\([^|]*\)|\([^|]*\)|\([^|]*\)|\([^|]*\).*,\1\t\5\textra\t\2\thttp://mirror.slitaz.org/packages/get/\1\t-\t-\t-\t-,' "$PKGS_DB/extra.list"
# Last list entry will miss, so add fake line
echo 'zzzzzzzz'
Expand Down Expand Up @@ -510,7 +510,7 @@ show_package_link() {

show_info_links() {
if [ -n "$1" ]; then
if [ "$3" == 'tag' ]; then icon="@tag@"; else icon="@clock@"; fi
if [ "$3" = 'tag' ]; then icon="@tag@"; else icon="@clock@"; fi
case "$4" in
provide) echo -n "<tr><td><b>$2</b></td><td>"; noeq=' ';;
'') echo -n "<tr><td><b>$2</b></td><td>"; noeq='';;
Expand Down Expand Up @@ -728,7 +728,7 @@ EOT
[ ! -f $PKGS_DB/packages.info ] && msg warn \
"$(_ 'You can not view a list of all packages until recharging lists.')"

[ "$REMOTE_USER" == "root" ] && cat <<EOT
[ "$REMOTE_USER" = "root" ] && cat <<EOT
<section>
<div>$(_ 'Selected packages:') <span id="countSelected"></span></div>
<footer>
Expand Down Expand Up @@ -769,7 +769,7 @@ EOT
<p>$(_ 'Packages suggested by %s' "<b>$pkg</b>")</p>
EOT

[ "$REMOTE_USER" == "root" ] && cat <<EOT
[ "$REMOTE_USER" = "root" ] && cat <<EOT
<section>
<div>$(_ 'Selected packages:') <span id="countSelected"></span></div>
<footer>
Expand Down Expand Up @@ -981,7 +981,7 @@ EOT
echo "<p>"
show_package_link "$name"
condition=${pkg%:*}
[ "$name" == "$condition" ] ||
[ "$name" = "$condition" ] ||
echo "($(_ "if") $(show_package_link "$condition")$(_ "is installed")) "
echo "</p>"
done
Expand All @@ -1003,7 +1003,7 @@ EOT
if [ -d "$INSTALLED/$pkg" ]; then
. $INSTALLED/$pkg/receipt
files=$(wc -l < $INSTALLED/$pkg/files.list)
[ "$REMOTE_USER" == 'root' ] && show_button do=Remove
[ "$REMOTE_USER" = 'root' ] && show_button do=Remove
else
cd $PKGS_DB
eval "$(awk -F$'\t' -vp=$pkg '
Expand All @@ -1022,7 +1022,7 @@ EOT
fi
PACKED_SIZE=${SIZES% *}
UNPACKED_SIZE=${SIZES#* }
[ "$REMOTE_USER" == 'root' ] &&
[ "$REMOTE_USER" = 'root' ] &&
if [ "${pkg#get-}" != "$pkg" ]; then
show_button 'do=Install&amp;nf'
else
Expand All @@ -1031,7 +1031,7 @@ EOT
fi

# Show Block/Unblock and Repack buttons
[ "$REMOTE_USER" == "root" ] &&
[ "$REMOTE_USER" = "root" ] &&
if [ -d $INSTALLED/$pkg ]; then
if grep -qs "^$pkg$" "$BLOCKED"; then
show_button do=Unblock
Expand Down Expand Up @@ -1235,7 +1235,7 @@ EOT

cache_files=$(find $CACHE_DIR -name '*.tazpkg' | wc -l)
cache_size=$(du -sh $CACHE_DIR | cut -f1 | sed 's|\.0||')
[ "$cache_files" == 0 ] && cache_size="0K"
[ "$cache_files" = 0 ] && cache_size="0K"
mirror=$(cat $PKGS_DB/mirror)
default_mirror=${mirror%/packages/*}
cat <<EOT
Expand Down Expand Up @@ -1493,7 +1493,7 @@ END{
tag=$(GET tag)
tazpanel_header "$(_ 'Tag "%s"' $tag)"

[ "$REMOTE_USER" == 'root' ] && cat <<EOT
[ "$REMOTE_USER" = 'root' ] && cat <<EOT
<section>
<div>$(_ 'Selected packages:') <span id="countSelected"></span></div>
<footer>
Expand Down
4 changes: 2 additions & 2 deletions tazpkg
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ check_dir() {
# If not and user is root we create them.

check_base_dir() {
if [ "$(id -u)" == '0' ]; then
if [ "$(id -u)" = '0' ]; then
check_dir $1$CACHE_DIR
check_dir $1$INSTALLED
check_dir $1$SLITAZ_LOGS
Expand Down Expand Up @@ -214,7 +214,7 @@ process_list() {
log_pkg() {
local extra

[ "$1" == 'Installed' ] && \
[ "$1" = 'Installed' ] && \
extra=" - $(fgrep " $PACKAGE-$VERSION" $PKGS_DB/installed.$SUM | awk '{ print $1 }')"

[ -e "$LOG" ] || touch $LOG
Expand Down
6 changes: 3 additions & 3 deletions tazpkg-notify
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ EOT
if [ ! -f "$PKGS_DB/packages.info" ]; then
tooltip="$(_ 'No packages list found')"
set_yad_action "$cmd_recharge" "$tooltip"
[ "$(notify "$tooltip" '1' "$(_n 'Recharge lists')")" == '1' ] && $cmd_recharge
[ "$(notify "$tooltip" '1' "$(_n 'Recharge lists')")" = '1' ] && $cmd_recharge
quit
fi

# Too old packages list
if [ -n "$mtime" ]; then
tooltip="$(_ 'Your packages list is older than 10 days')"
set_yad_action "$cmd_recharge" "$tooltip"
[ "$(notify "$tooltip" '1' "$(_n 'Recharge lists')")" == '1' ] && $cmd_recharge
[ "$(notify "$tooltip" '1' "$(_n 'Recharge lists')")" = '1' ] && $cmd_recharge
quit
fi

Expand All @@ -96,7 +96,7 @@ EOT
'There are %s upgradeable packages' "$up" \
"<b>$up</b>")"
set_yad_action "$cmd_up" "$tooltip"
[ "$(notify "$tooltip" '1' "$(_n 'Check upgrade')")" == '1' ] && $cmd_up
[ "$(notify "$tooltip" '1' "$(_n 'Check upgrade')")" = '1' ] && $cmd_up
quit
fi

Expand Down

0 comments on commit ee0da13

Please sign in to comment.