From 6f554d40368c33d947714ffbbb6b8e3f53ae2776 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Tue, 16 Apr 2024 09:22:45 +0200 Subject: [PATCH] shellchecked --- xap/hpemung/SlackBuild | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/xap/hpemung/SlackBuild b/xap/hpemung/SlackBuild index 52c77f4a..8de0490a 100755 --- a/xap/hpemung/SlackBuild +++ b/xap/hpemung/SlackBuild @@ -3,13 +3,12 @@ set -x CWD=$(pwd) -PRGNAM=$(basename $CWD) +PRGNAM=$(basename "$CWD") BUILD=1 VERSION=${VERSION:-latest} ARCH=$(uname -m) -LIBSUFFIX=$(echo $ARCH | grep -o "\(64\)") TAG=gwh OUTPUT=/tmp @@ -23,21 +22,21 @@ PREFIX=/usr mkdir -p $TMP # Cleaning -rm -fr $TMP/$PRGNAM $PKG +rm -fr "${TMP:?}"/"$PRGNAM" "$PKG" # Fetching sources -[ ! -e $REPOSITORY ] && git clone https://codeberg.org/gwh/hpemung.git $REPOSITORY -cd $REPOSITORY +[ ! -e "$REPOSITORY" ] && git clone https://codeberg.org/gwh/hpemung.git "$REPOSITORY" +cd "$REPOSITORY" || exit 1 git pull --all -cp -R $REPOSITORY $TMP/$PRGNAM +cp -R "$REPOSITORY" "$TMP"/"$PRGNAM" # Preparation -cd $TMP/$PRGNAM +cd "$TMP"/"$PRGNAM" || exit 1 -[ "x$VERSION" == "xlatest" ] && VERSION=$(git describe --tags --abbrev=0) -[ "x$VERSION" == "x" ] && VERSION=trunk -[ "x$VERSION" == "xtrunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout $VERSION +[ "$VERSION" == "latest" ] && VERSION=$(git describe --tags --abbrev=0) +[ "$VERSION" == "" ] && VERSION=trunk +[ "$VERSION" == "trunk" ] && VERSION="git_r$(git rev-list --count HEAD)_$(git log -1 --format=%h)" || git checkout "$VERSION" chown -R root:root . find . \ @@ -50,16 +49,16 @@ find . \ make all PREFIX=/usr # Installation -make install DESTDIR=$PKG PREFIX=/usr +make install DESTDIR="$PKG" PREFIX=/usr # # Cleaning # cd $PKG # find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null # find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null -cd $PKG +cd "$PKG" || exit 1 -[ -d $PKG$PREFIX/man ] && find $PKG$PREFIX/man -type f -name "*.?" -exec gzip -9 {} \; +[ -d "$PKG""$PREFIX"/man ] && find "$PKG""$PREFIX"/man -type f -name "*.?" -exec gzip -9 {} \; chown -R root:root . find . \ @@ -74,7 +73,7 @@ cat < install/slack-desc $PRGNAM: $PRGNAM (HP48 emulator) $PRGNAM: $PRGNAM: hpemung is an emulator of the Saturn Processor and the I/O of an -$PRGNAM: HP48 calculator. There is a debugger for the Saturn Processor. +$PRGNAM: HP 48G/GX calculator. $PRGNAM: $PRGNAM: initialization: $PRGNAM: $ $PREFIX/share/$PRGNAM/setup-hpemung-home.sh @@ -84,5 +83,4 @@ $PRGNAM: https://codeberg.org/gwh/hpemung.git $PRGNAM: EOF -rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la -/sbin/makepkg --linkadd y --chown n --prepend $OUTPUT/$PRGNAM-$(echo $VERSION | tr -d '-')-$ARCH-$BUILD$TAG.txz +/sbin/makepkg --linkadd y --chown n --prepend "$OUTPUT"/"$PRGNAM"-"$(echo "$VERSION" | tr -d '-')"-"$ARCH"-"$BUILD""$TAG".txz