From 64cfcf14f00ed1092b9dc845a0f8f263a64ca423 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 16 Feb 2022 16:39:03 -0500 Subject: [PATCH] libraries/avbin: Handle weird download filenames. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- libraries/avbin/avbin.SlackBuild | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/libraries/avbin/avbin.SlackBuild b/libraries/avbin/avbin.SlackBuild index ba8bb1acb2..b2d396336b 100644 --- a/libraries/avbin/avbin.SlackBuild +++ b/libraries/avbin/avbin.SlackBuild @@ -38,9 +38,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -73,23 +70,24 @@ fi SRCNAM=install-$PRGNAM-linux-x86-$AR-v$VERSION +# 20220216 bkw: depending on what was used to download the file, it +# may have a bunch of amazon-gibberish in the filename +CWDSRC="$CWD/$SRCNAM" +if [ ! -e "$CWDSRC" ]; then + CWDSRC="$( /bin/ls $CWDSRC\?* | head -1)" +fi + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION mkdir -p $PRGNAM-$VERSION cd $PRGNAM-$VERSION -chmod 0755 $CWD/$SRCNAM -sh $CWD/$SRCNAM --noexec --target . +sh "$CWDSRC" --noexec --target . chown -R root:root . -find -L . \ - \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ - \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +chmod 644 * -find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +strip --strip-unneeded *.so.* mkdir -p $PKG/usr/lib${LIBDIRSUFFIX} install -D -m0755 lib${PRGNAM}.so.${VERSION} $PKG/usr/lib${LIBDIRSUFFIX}