diff options
author | B. Watson <yalhcru@gmail.com> | 2022-02-10 03:08:46 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-02-12 00:29:39 +0700 |
commit | b6aae795332e243157382512a1329c5a66b35705 (patch) | |
tree | 9b190eee37f1054298ce35ff6e09ba8cfccb65bc /system/slack-utils | |
parent | a42aeadb4bcd0a3d3569b51e75ba0548aeb77e37 (diff) |
system/slack-utils: Handle weird download filename.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/slack-utils')
-rw-r--r-- | system/slack-utils/slack-utils.SlackBuild | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/system/slack-utils/slack-utils.SlackBuild b/system/slack-utils/slack-utils.SlackBuild index deba95add5998..399a3f0ad9206 100644 --- a/system/slack-utils/slack-utils.SlackBuild +++ b/system/slack-utils/slack-utils.SlackBuild @@ -22,6 +22,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20220210 bkw: Modified by SlackBuilds.org + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=slack-utils @@ -32,15 +34,12 @@ PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; 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 @@ -52,12 +51,21 @@ OUTPUT=${OUTPUT:-/tmp} set -e +# 20220210 bkw: we get gibberish in the filename depending on whether +# the downloader (wget, browser, etc) respects the Content-disposition +# header. Handle either possibility. +TARBALL=$CWD/$PRGNAM-$VERSION.tar.gz +[ -e $TARBALL ] || TARBALL="$( /bin/ls $TARBALL\?* 2>/dev/null | head -1 )" +[ -z "$TARBALL" ] && echo "Can't find the source tarball!" && exit 1 + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +tar xvf $TARBALL cd $PRGNAM-$VERSION +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ # Fix renamed Config -> RbConfig sed -i -e 's/::Config::CONFIG/::RbConfig::CONFIG/' setup.rb |