diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-11-30 08:32:58 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-11-30 08:32:58 -0500 |
| commit | b4ef259ed064187a8bda00f815854738a14dfc63 (patch) | |
| tree | d72e60dcbd0456b10ec33519c6cecfddc1068942 | |
| parent | ea08c505099c6a230d89b570a397aee3529824ce (diff) | |
| download | sbo-maintainer-tools-b4ef259ed064187a8bda00f815854738a14dfc63.tar.gz | |
upkg: replace tab indents with 2 spaces each.
| -rwxr-xr-x | upkg | 120 |
1 files changed, 60 insertions, 60 deletions
@@ -4,7 +4,7 @@ SELF="$( basename $0 )" VERSION=0.9.11 if [ "$1" = "--help" ]; then - cat <<EOF + cat <<EOF upkg - upgrade/install/reinstall a Slackware package. Usage: upkg [package [<package> ...]] @@ -19,15 +19,15 @@ Actual package installation is done with: upgradepkg --reinstall --install-new <package> EOF - exit 0 + exit 0 elif [ "$1" = "--version" ]; then - echo $VERSION - exit 0 + echo $VERSION + exit 0 fi die() { - echo "$SELF: $@" 1>&2 - exit 1 + echo "$SELF: $@" 1>&2 + exit 1 } OUTPUT=${OUTPUT:-/tmp} @@ -52,60 +52,60 @@ esac # and extract BUILD from the SlackBuild. if [ -z "$*" ]; then - script="$( echo *.SlackBuild)" - [ "$script" = '*.SlackBuild' ] && die "no .SlackBuild file in current dir" - script1=$( echo *.SlackBuild | cut -d' ' -f1 ) - [ "$script" != "$script1" ] && die "multiple .SlackBuild files found in current dir" - if grep -q PRINT_PACKAGE_NAME $script; then - pkgfile="$( PRINT_PACKAGE_NAME=1 sh $script )" - if [ -e "$OUTPUT/$pkgfile" ]; then - found="$OUTPUT/$pkgfile" - else - die "No $pkgfile found in $OUTPUT, build one!" - fi - else - infofile=$( echo *.info ) - - [ "$infofile" = '*.info' ] && die "no .info file in current dir" - - infofile1=$( echo *.info | cut -d' ' -f1 ) - [ "$infofile" != "$infofile1" ] && die "multiple .info files found in current dir" - - pkgname=$(basename $infofile .info) - [ ! -e "$pkgname.SlackBuild" ] && die "$pkgname.SlackBuild not found in current dir" - - source ./$pkgname.info - [ -z "$PRGNAM" -o -z "$VERSION" ] && die "bad/incomplete .info file, bailing" - - [ "$PRGNAM" != "$pkgname" ] && die "bad PRGNAM=$PRGNAM in $pkgname.info" - - buildline=$(grep "^ *BUILD=" $pkgname.SlackBuild) - [ -z "$buildline" ] && die "missing BUILD= in $pkgname.SlackBuild" - - eval $buildline - - for myarch in noarch $ARCHES; do - myglob="$OUTPUT/$PRGNAM-$VERSION-$myarch-$BUILD*.t?z" - myfile=$( echo $myglob ) - - if [ "$myglob" = "$myfile" ]; then - : # do naught - elif [ "$( /bin/ls $myfile 2>/dev/null | wc -l )" -gt "1" ]; then - die "Multiple packages match, not installing anything: $( /bin/ls $myfile )" - else - if [ -n "$found" ]; then - die "Multiple packages/arches, not installing anything: $myfile $found" - else - found=$myfile - echo found $found - fi - fi - done - fi - - [ -z "$found" ] && die "No $PRGNAM-$VERSION-(noarch|$ARCH)-$BUILD*.t?z package in $OUTPUT, build one!" - - set "$found" + script="$( echo *.SlackBuild)" + [ "$script" = '*.SlackBuild' ] && die "no .SlackBuild file in current dir" + script1=$( echo *.SlackBuild | cut -d' ' -f1 ) + [ "$script" != "$script1" ] && die "multiple .SlackBuild files found in current dir" + if grep -q PRINT_PACKAGE_NAME $script; then + pkgfile="$( PRINT_PACKAGE_NAME=1 sh $script )" + if [ -e "$OUTPUT/$pkgfile" ]; then + found="$OUTPUT/$pkgfile" + else + die "No $pkgfile found in $OUTPUT, build one!" + fi + else + infofile=$( echo *.info ) + + [ "$infofile" = '*.info' ] && die "no .info file in current dir" + + infofile1=$( echo *.info | cut -d' ' -f1 ) + [ "$infofile" != "$infofile1" ] && die "multiple .info files found in current dir" + + pkgname=$(basename $infofile .info) + [ ! -e "$pkgname.SlackBuild" ] && die "$pkgname.SlackBuild not found in current dir" + + source ./$pkgname.info + [ -z "$PRGNAM" -o -z "$VERSION" ] && die "bad/incomplete .info file, bailing" + + [ "$PRGNAM" != "$pkgname" ] && die "bad PRGNAM=$PRGNAM in $pkgname.info" + + buildline=$(grep "^ *BUILD=" $pkgname.SlackBuild) + [ -z "$buildline" ] && die "missing BUILD= in $pkgname.SlackBuild" + + eval $buildline + + for myarch in noarch $ARCHES; do + myglob="$OUTPUT/$PRGNAM-$VERSION-$myarch-$BUILD*.t?z" + myfile=$( echo $myglob ) + + if [ "$myglob" = "$myfile" ]; then + : # do naught + elif [ "$( /bin/ls $myfile 2>/dev/null | wc -l )" -gt "1" ]; then + die "Multiple packages match, not installing anything: $( /bin/ls $myfile )" + else + if [ -n "$found" ]; then + die "Multiple packages/arches, not installing anything: $myfile $found" + else + found=$myfile + echo found $found + fi + fi + done + fi + + [ -z "$found" ] && die "No $PRGNAM-$VERSION-(noarch|$ARCH)-$BUILD*.t?z package in $OUTPUT, build one!" + + set "$found" fi sudo /sbin/upgradepkg --reinstall --install-new "$@" |
