system/slack-utils: Handle weird download filename.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
parent
a42aeadb4b
commit
b6aae79533
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue