commit makeself for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package makeself for openSUSE:Factory checked in at 2021-02-01 13:29:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/makeself (Old) and /work/SRC/openSUSE:Factory/.makeself.new.28504 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "makeself" Mon Feb 1 13:29:06 2021 rev:13 rq:868300 version:2.4.3 Changes: -------- --- /work/SRC/openSUSE:Factory/makeself/makeself.changes 2020-06-16 13:47:00.942380835 +0200 +++ /work/SRC/openSUSE:Factory/.makeself.new.28504/makeself.changes 2021-02-01 13:30:59.130348484 +0100 @@ -1,0 +2,8 @@ +Sat Jan 30 15:51:03 UTC 2021 - Dirk M��ller <dmueller@suse.com> + +- update to 2.4.3: + * includes a number of bug fixes. + * POSIX tar archive format is now explicitly set to increase compatibility + between GNU and BSD variants of the command. + +------------------------------------------------------------------- Old: ---- makeself-2.4.2.tar.gz New: ---- makeself-2.4.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ makeself.spec ++++++ --- /var/tmp/diff_new_pack.q9PjQT/_old 2021-02-01 13:30:59.758349258 +0100 +++ /var/tmp/diff_new_pack.q9PjQT/_new 2021-02-01 13:30:59.758349258 +0100 @@ -18,7 +18,7 @@ Name: makeself -Version: 2.4.2 +Version: 2.4.3 Release: 0 Summary: Make self-extractable archives on Unix License: GPL-2.0-or-later ++++++ makeself-2.4.2.tar.gz -> makeself-2.4.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/.github/workflows/build.yml new/makeself-release-2.4.3/.github/workflows/build.yml --- old/makeself-release-2.4.2/.github/workflows/build.yml 2020-04-27 12:59:03.000000000 +0200 +++ new/makeself-release-2.4.3/.github/workflows/build.yml 2021-01-16 14:33:11.000000000 +0100 @@ -42,7 +42,7 @@ - name: Checkout Makeself uses: actions/checkout@v2 - name: Run ShellCheck - uses: azohra/shell-linter@feature/add-severity-mode + uses: megastep/shell-linter@develop with: path: "makeself.sh" severity: "error" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/README.md new/makeself-release-2.4.3/README.md --- old/makeself-release-2.4.2/README.md 2020-04-27 12:59:03.000000000 +0200 +++ new/makeself-release-2.4.3/README.md 2021-01-16 14:33:11.000000000 +0100 @@ -111,7 +111,6 @@ * **`--packaging-date date`** : Use provided string as the packaging date instead of the current date. * **`--license`** : Append a license file. * **`--nooverwrite`** : Do not extract the archive if the specified target directory already exists. - * **`--header file`** : Specify the location of the header script file (default `makeself-header.sh`) * **`--help-header file`** : Add a header to the archive's `--help` output. * `archive_dir` is the name of the directory that contains the files to be archived * `file_name` is the name of the archive to be created @@ -200,11 +199,12 @@ * **v2.1.3:** Bug fixes with the command line when spawning terminals. Added `--tar`, `--noexec` for archives. Added `--nomd5` and `--nocrc` to avoid creating checksums in archives. The embedded script is now run through "eval". The `--info` output now includes the command used to create the archive. A man page was contributed by Bartosz Fenski. * **v2.1.4:** Fixed `--info` output. Generate random directory name when extracting files to . to avoid problems. Better handling of errors with wrong permissions for the directory containing the files. Avoid some race conditions, Unset the $CDPATH variable to avoid problems if it is set. Better handling of dot files in the archive directory. * **v2.1.5:** Made the md5sum detection consistent with the header code. Check for the presence of the archive directory. Added `--encrypt` for symmetric encryption through gpg (Eric Windisch). Added support for the digest command on Solaris 10 for MD5 checksums. Check for available disk space before extracting to the target directory (Andreas Schweitzer). Allow extraction to run asynchronously (patch by Peter Hatch). Use file descriptors internally to avoid error messages (patch by Kay Tiong Khoo). - * **v2.1.6:** Replaced one dot per file progress with a realtime progress percentage and a spining cursor. Added `--noprogress` to prevent showing the progress during the decompression. Added `--target` dir to allow extracting directly to a target directory. (Guy Baconniere) + * **v2.1.6:** Replaced one dot per file progress with a realtime progress percentage and a spinning cursor. Added `--noprogress` to prevent showing the progress during the decompression. Added `--target` dir to allow extracting directly to a target directory. (Guy Baconniere) * **v2.2.0:** First major new release in years! Includes many bugfixes and user contributions. Please look at the [project page on Github][10] for all the details. * **v2.3.0:** Support for archive encryption via GPG or OpenSSL. Added LZO and LZ4 compression support. Options to set the packaging date and stop the umask from being overriden. Optionally ignore check for available disk space when extracting. New option to check for root permissions before extracting. * **v2.3.1:** Various compatibility updates. Added unit tests for Travis CI in the GitHub repo. New `--tar-extra`, `--untar-extra`, `--gpg-extra`, `--gpg-asymmetric-encrypt-sign` options. * **v2.4.0:** Added optional support for SHA256 archive integrity checksums. + * **v2.4.2:** New --cleanup and --cleanup-args arguments for cleanup scripts. Added threading support for supported compressors. Now supports zstd compression. ## Links diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/VERSION new/makeself-release-2.4.3/VERSION --- old/makeself-release-2.4.2/VERSION 2020-04-27 12:59:03.000000000 +0200 +++ new/makeself-release-2.4.3/VERSION 2021-01-16 14:33:11.000000000 +0100 @@ -1 +1 @@ -2.4.2 +2.4.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/makeself-header.sh new/makeself-release-2.4.3/makeself-header.sh --- old/makeself-release-2.4.2/makeself-header.sh 2020-04-27 12:59:03.000000000 +0200 +++ new/makeself-release-2.4.3/makeself-header.sh 2021-01-16 14:33:11.000000000 +0100 @@ -14,7 +14,7 @@ TMPROOT=\${TMPDIR:=/tmp} USER_PWD="\$PWD" export USER_PWD -ARCHIVE_DIR=`dirname \$0` +ARCHIVE_DIR=\`dirname "\$0"\` export ARCHIVE_DIR label="$LABEL" @@ -25,6 +25,7 @@ helpheader='$HELPHEADER' targetdir="$archdirname" filesizes="$filesizes" +totalsize="$totalsize" keep="$KEEP" nooverwrite="$NOOVERWRITE" quiet="n" @@ -96,9 +97,14 @@ { blocks=\`expr \$3 / 1024\` bytes=\`expr \$3 % 1024\` - dd if="\$1" ibs=\$2 skip=1 obs=1024 conv=sync 2> /dev/null | \\ - { test \$blocks -gt 0 && dd ibs=1024 obs=1024 count=\$blocks ; \\ - test \$bytes -gt 0 && dd ibs=1 obs=1024 count=\$bytes ; } 2> /dev/null + # Test for ibs, obs and conv feature + if dd if=/dev/zero of=/dev/null count=1 ibs=512 obs=512 conv=sync 2> /dev/null; then + dd if="\$1" ibs=\$2 skip=1 obs=1024 conv=sync 2> /dev/null | \\ + { test \$blocks -gt 0 && dd ibs=1024 obs=1024 count=\$blocks ; \\ + test \$bytes -gt 0 && dd ibs=1 obs=1024 count=\$bytes ; } 2> /dev/null + else + dd if="\$1" bs=\$2 skip=1 2> /dev/null + fi } MS_dd_Progress() @@ -201,6 +207,11 @@ MS_Printf "Verifying archive integrity..." fi offset=\`head -n "\$skip" "\$1" | wc -c | tr -d " "\` + fsize=\`cat "\$1" | wc -c | tr -d " "\` + if test \$totalsize -ne \`expr \$fsize - \$offset\`; then + echo " Unexpected archive size." >&2 + exit 2 + fi verb=\$2 i=1 for s in \$filesizes @@ -337,7 +348,7 @@ echo Encryption: $ENCRYPT fi echo Date of packaging: $DATE - echo Built with Makeself version $MS_VERSION on $OSTYPE + echo Built with Makeself version $MS_VERSION echo Build command was: "$MS_COMMAND" if test x"\$script" != x; then echo Script run after extraction: @@ -366,6 +377,7 @@ echo NOOVERWRITE=$NOOVERWRITE echo COMPRESS=$COMPRESS echo filesizes=\"\$filesizes\" + echo totalsize=\"\$totalsize\" echo CRCsum=\"\$CRCsum\" echo MD5sum=\"\$MD5sum\" echo SHAsum=\"\$SHAsum\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/makeself.1 new/makeself-release-2.4.3/makeself.1 --- old/makeself-release-2.4.2/makeself.1 2020-04-27 12:59:03.000000000 +0200 +++ new/makeself-release-2.4.3/makeself.1 2021-01-16 14:33:11.000000000 +0100 @@ -1,19 +1,14 @@ -.TH "makeself" "1" "2.1.6" +.TH "MAKESELF" "1" "2.1.6" .SH "NAME" makeself \- An utility to generate self-extractable archives. .SH "SYNTAX" -.LP -.B makeself [\fIoptions\fP] archive_dir file_name label +.B makeself [\fIoptions\fP] archive_dir file_name label .B [\fIstartup_script\fP] [\fIargs\fP] .SH "DESCRIPTION" -.LP -This program is a free (GPL) utility designed to create self-extractable -archives from a directory. -.br +This program is a free (GPL) utility designed to create self-extractable +archives from a directory. .SH "OPTIONS" -.LP The following options are supported. -.LP .TP 15 .B -v, --version Prints out the makeself version number and exits. @@ -55,7 +50,7 @@ Specify the compression level for gzip,bzip2,pbzui2,xz,lzo or lz4 .TP .B --notemp -The archive will create archive_dir in the current directory and +The archive will create archive_dir in the current directory and uncompress in ./archive_dir. .TP .B --copy @@ -71,7 +66,7 @@ Extract directly to a target directory. Directory path can be either absolute or relative. .TP .B --header file -Specify location of the header script. +Specify location of the header script. .TP .B --cleanup file Specify a cleanup script that executes on interrupt and when finished successfully. @@ -98,10 +93,18 @@ LSM file describing the package. .B --packaging-date date Use provided string as the packaging date instead of the current date. -.PD +.SH "EXAMPLES" +Here is an example, assuming the user has a package image stored in a /home/joe/mysoft, +and he wants to generate a self-extracting package named mysoft.sh, which will launch +the "setup" script initially stored in /home/joe/mysoft: +.TP +makeself.sh /home/joe/mysoft mysoft.sh "Joe's Nice Software Package" ./setup +.TP +Here is also how I created the makeself.run archive which contains the Makeself distribution: +.TP +makeself.sh --notemp makeself makeself.run "Makeself by Stephane Peter" echo "Makeself has extracted itself" .SH "AUTHORS" -.LP -Makeself has been written by St�phane Peter <megastep@megastep.org>. -.BR -This man page was originally written by Bartosz Fenski <fenio@o2.pl> for the +Makeself has been written by St��phane Peter <megastep@megastep.org>. +.BR +This man page was originally written by Bartosz Fenski <fenio@o2.pl> for the Debian GNU/Linux distribution (but it may be used by others). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/makeself.sh new/makeself-release-2.4.3/makeself.sh --- old/makeself-release-2.4.2/makeself.sh 2020-04-27 12:59:03.000000000 +0200 +++ new/makeself-release-2.4.3/makeself.sh 2021-01-16 14:33:11.000000000 +0100 @@ -70,15 +70,16 @@ # - 2.4.0 : Optional support for SHA256 checksums in archives. # - 2.4.2 : Add support for threads for several compressors. (M. Limber) # Added zstd support. +# - 2.4.3 : Make explicit POSIX tar archives for increased compatibility. # -# (C) 1998-2020 by Stephane Peter <megastep@megastep.org> +# (C) 1998-2021 by Stephane Peter <megastep@megastep.org> # # This software is released under the terms of the GNU GPL version 2 and above # Please read the license at http://www.gnu.org/copyleft/gpl.html # Self-extracting archives created with this script are explictly NOT released under the term of the GPL # -MS_VERSION=2.4.2 +MS_VERSION=2.4.3 MS_COMMAND="$0" unset CDPATH @@ -97,8 +98,8 @@ MS_Usage() { - echo "Usage: $0 [params] archive_dir file_name label startup_script [args]" - echo "params can be one or more of the following :" + echo "Usage: $0 [args] archive_dir file_name label startup_script [script_args]" + echo "args can be one or more of the following :" echo " --version | -v : Print out Makeself version number and exit" echo " --help | -h : Print out this help message" echo " --tar-quietly : Suppress verbose output from the tar command" @@ -173,10 +174,13 @@ } # Default settings -if type gzip > /dev/null 2>&1; then +if type gzip >/dev/null 2>&1; then COMPRESS=gzip +elif type compress >/dev/null 2>&1; then + COMPRESS=compress else - COMPRESS=Unix + echo "ERROR: missing commands: gzip, compress" >&2 + MS_Usage fi ENCRYPT=n PASSWD="" @@ -251,7 +255,7 @@ shift ;; --compress) - COMPRESS=Unix + COMPRESS=compress shift ;; --base64) @@ -444,7 +448,7 @@ if test "$QUIET" = "y" || test "$TAR_QUIETLY" = "y"; then if test "$TAR_ARGS" = "rvf"; then TAR_ARGS="rf" - elif test "$TAR_ARGS" = "rvhf";then + elif test "$TAR_ARGS" = "rvhf"; then TAR_ARGS="rhf" fi fi @@ -461,6 +465,7 @@ exit 1 else eval "$OLDENV" + OLDSKIP=`expr $SKIP + 1` fi else if test "$KEEP" = n -a $# = 3; then @@ -550,9 +555,9 @@ GUNZIP_CMD="gpg --yes -d" ENCRYPT="gpg" ;; -Unix) - GZIP_CMD="compress -cf" - GUNZIP_CMD="exec 2>&-; uncompress -c || test \\\$? -eq 2 || gzip -cd" +compress) + GZIP_CMD="compress -fc" + GUNZIP_CMD="(type compress >/dev/null 2>&1 && compress -fcd || gzip -cd)" ;; none) GZIP_CMD="cat" @@ -587,22 +592,21 @@ archname="$tmpfile" # Generate a fake header to count its lines SKIP=0 - . "$HEADER" - SKIP=`cat "$tmpfile" |wc -l` + . "$HEADER" + SKIP=`cat "$tmpfile" |wc -l` # Get rid of any spaces SKIP=`expr $SKIP` rm -f "$tmpfile" - if test "$QUIET" = "n";then - echo "Header is $SKIP lines long" >&2 - fi - + if test "$QUIET" = "n"; then + echo "Header is $SKIP lines long" >&2 + fi archname="$oldarchname" else echo "Unable to open header file: $HEADER" >&2 exit 1 fi -if test "$QUIET" = "n";then +if test "$QUIET" = "n"; then echo fi @@ -629,13 +633,29 @@ tmparch="${TMPDIR:-/tmp}/mkself$$.tar" ( if test "$APPEND" = "y"; then - tail -n "+$OLDSKIP" "$archname" | $GUNZIP_CMD > "$tmparch" + tail -n "+$OLDSKIP" "$archname" | eval "$GUNZIP_CMD" > "$tmparch" fi cd "$archdir" - find . ! -type d -o -links 2 \ + # "Determining if a directory is empty" + # https://www.etalabs.net/sh_tricks.html + find . \ + \( \ + ! -type d \ + -o \ + \( -links 2 -exec sh -c ' + is_empty () ( + cd "$1" + set -- .[!.]* ; test -f "$1" && return 1 + set -- ..?* ; test -f "$1" && return 1 + set -- * ; test -f "$1" && return 1 + return 0 + ) + is_empty "$0"' {} \; \ + \) \ + \) -print \ | LC_ALL=C sort \ | sed 's/./\\&/g' \ - | xargs tar $TAR_EXTRA -$TAR_ARGS "$tmparch" + | xargs tar $TAR_EXTRA --posix -$TAR_ARGS "$tmparch" ) || { echo "ERROR: failed to create temporary archive: $tmparch" rm -f "$tmparch" "$tmpfile" @@ -666,12 +686,12 @@ crcsum=0000000000 if test "$NOCRC" = y; then - if test "$QUIET" = "n";then + if test "$QUIET" = "n"; then echo "skipping crc at user request" fi else crcsum=`CMD_ENV=xpg4 cksum < "$tmpfile" | sed -e 's/ /Z/' -e 's/ /Z/' | cut -dZ -f1` - if test "$QUIET" = "n";then + if test "$QUIET" = "n"; then echo "CRC: $crcsum" fi fi @@ -693,7 +713,7 @@ fi fi if test "$NOMD5" = y; then - if test "$QUIET" = "n";then + if test "$QUIET" = "n"; then echo "Skipping md5sum at user request" fi else @@ -710,16 +730,22 @@ MD5_ARG="-a md5" fi md5sum=`eval "$MD5_PATH $MD5_ARG" < "$tmpfile" | cut -b-32` - if test "$QUIET" = "n";then + if test "$QUIET" = "n"; then echo "MD5: $md5sum" fi else - if test "$QUIET" = "n";then + if test "$QUIET" = "n"; then echo "MD5: none, MD5 command not found" fi fi fi +totalsize=0 +for size in $fsize; +do + totalsize=`expr $totalsize + $size` +done + if test "$APPEND" = y; then mv "$archname" "$archname".bak || exit @@ -735,7 +761,7 @@ chmod +x "$archname" rm -f "$archname".bak - if test "$QUIET" = "n";then + if test "$QUIET" = "n"; then echo "Self-extractable archive \"$archname\" successfully updated." fi else @@ -748,12 +774,12 @@ . "$HEADER" # Append the compressed tar data after the stub - if test "$QUIET" = "n";then + if test "$QUIET" = "n"; then echo fi cat "$tmpfile" >> "$archname" chmod +x "$archname" - if test "$QUIET" = "n";then + if test "$QUIET" = "n"; then echo Self-extractable archive \"$archname\" successfully created. fi fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/test/appendtest new/makeself-release-2.4.3/test/appendtest --- old/makeself-release-2.4.2/test/appendtest 2020-04-27 12:59:03.000000000 +0200 +++ new/makeself-release-2.4.3/test/appendtest 2021-01-16 14:33:11.000000000 +0100 @@ -1,48 +1,100 @@ #!/bin/bash +# FIXME: These tests need to check that the concatenation of archives works -SUT=$(realpath $(dirname $0)/../makeself.sh) -SOURCE=$(realpath ..) +set -eu -setupTests() { - temp=`mktemp -d -t appendtest.XXXXX` - cd "$temp" - mkdir archive - cp -a $SOURCE archive/ - $SUT $* archive makeself-test.run "Test $*" echo Testing --tar-extra="--exclude .git" - mkdir -p append/append_dir/ - cp -a $SOURCE/makeself.sh append/append_dir/ +THIS="$(realpath "$0")" +WHAT="$(basename "${THIS}")" +HERE="$(dirname "${THIS}")" +SRCDIR="$(dirname "${HERE}")" +SUT="${SRCDIR}/makeself.sh" + +readonly archive_dir_create="$(mktemp -dt archive_dir_create.XXXXXX)" +readonly archive_dir_append="$(mktemp -dt archive_dir_append.XXXXXX)" +touch "${archive_dir_create}/fee" +touch "${archive_dir_create}/fie" +touch "${archive_dir_append}/foe" +touch "${archive_dir_append}/fum" + +evalAssert() { + eval "$@" + assertEqual "$?" "0" } +# $1 : file_name +doInfoListCheckExec() { + evalAssert "$1" --info + evalAssert "$1" --list + evalAssert "$1" --check + evalAssert "$1" +} -testGzip() -{ - setupTests --gzip - - $SUT --append append/ makeself-test.run - assertEqual $? 0 - ./makeself-test.run --check - assertEqual $? 0 +# $1 : file_name +# rest : content basenames +assertContains() { + local file_name="" + file_name="$(realpath "$1")" + shift + local target="${file_name}.d" + rm -rf "${target}" + mkdir -p "${target}" + evalAssert "${file_name}" --target "${target}" + assertEqual \ + "$(find "${target}" -type f -exec basename -a {} + | sort)" \ + "$(echo "$@" | sort)" + rm -rf "${target}" } +# $@ : makeself options +doTestOpts() { + local stem="" + stem="$(printf '%s' "${WHAT}" "$@" | tr -sc '[:alnum:]_.-' '_')" + local file_name="" + file_name="$(realpath "${stem}.run")" + + evalAssert "${SUT}" "$@" --sha256 \ + "${archive_dir_create}" \ + "${file_name}" \ + "${stem}" \ + "echo ${stem}" + doInfoListCheckExec "${file_name}" + assertContains "${file_name}" "fee" "fie" + + evalAssert "${SUT}" "$@" --sha256 \ + --append "${archive_dir_append}" \ + "${file_name}" + doInfoListCheckExec "${file_name}" + assertContains "${file_name}" "fee" "fie" "foe" "fum" -testNocomp() -{ - setupTests --nocomp - - $SUT --append append/ makeself-test.run - assertEqual $? 0 - ./makeself-test.run --check - assertEqual $? 0 + rm -f "${file_name}" } -testBzip2() -{ - setupTests --bzip2 - - $SUT --append append/ makeself-test.run - assertEqual $? 0 - ./makeself-test.run --check - assertEqual $? 0 +# $1 : compression option +doTestComp() { + if ! command -v "${1#--*}" >/dev/null 2>&1; then + echo "WARNING: missing command: ${1#--*}" >&2 + return 0 + fi + doTestOpts "$1" } +################################################################################ + +testDefault() { doTestOpts; } + +testNocomp() { doTestOpts --nocomp; } + +testBase64() { doTestComp --base64; } +testBzip2() { doTestComp --bzip2; } +testCompress() { doTestComp --compress; } +testGzip() { doTestComp --gzip; } +testLz4() { doTestComp --lz4; } +testLzo() { doTestComp --lzo; } +testPbzip2() { doTestComp --pbzip2; } +testPigz() { doTestComp --pigz; } +testXz() { doTestComp --xz; } +testZstd() { doTestComp --zstd; } + source bashunit/bashunit.bash + +rm -rf "${archive_dir_create}" "${archive_dir_append}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/test/corrupttest new/makeself-release-2.4.3/test/corrupttest --- old/makeself-release-2.4.2/test/corrupttest 1970-01-01 01:00:00.000000000 +0100 +++ new/makeself-release-2.4.3/test/corrupttest 2021-01-16 14:33:11.000000000 +0100 @@ -0,0 +1,38 @@ +#!/bin/bash +# Test that corrupted archives actually fail validation + +SUT=$(realpath $(dirname $0)/../makeself.sh) +SOURCE=$(realpath ..) + +setupTests() { + temp=`mktemp -d -t appendtest.XXXXX` + cd "$temp" + mkdir archive + cp -a $SOURCE archive/ + $SUT $* archive makeself-test.run "Test $*" echo Testing --tar-extra="--exclude .git" +} + +testExtraBytes() { + setupTests --sha256 + + ./makeself-test.run --check + assertEqual $? 0 + + echo "Adding a bunch of random characters at the end!!" >> makeself-test.run + + ./makeself-test.run --check + assertNotEqual $? 0 +} + +testTruncated() { + setupTests --sha256 + + ./makeself-test.run --check + assertEqual $? 0 + + dd if=makeself-test.run of=truncated.run bs=1 count=34303 + bash truncated.run --check + assertNotEqual $? 0 +} + +source bashunit/bashunit.bash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/test/infotest new/makeself-release-2.4.3/test/infotest --- old/makeself-release-2.4.2/test/infotest 1970-01-01 01:00:00.000000000 +0100 +++ new/makeself-release-2.4.3/test/infotest 2021-01-16 14:33:11.000000000 +0100 @@ -0,0 +1,122 @@ +#!/bin/bash + +# makeself/test/infotest + +THIS="$(realpath "$0")" +HERE="$(dirname "${THIS}")" +SRCDIR="$(dirname "${HERE}")" +VERSION="$(xargs printf '%s' <"${SRCDIR}/VERSION")" + +################################################################################ + +# Take makeself options, generate a predefined archive, print --info to stdout. +# +# $@ : makeself options +haveInfo() ( + cd "${SRCDIR}" || return 1 + mkdir -p infotest + ./makeself.sh "$@" ./infotest ./infotest.run infotest ls -lah >/dev/null 2>&1 + assertEqual "$?" 0 >&2 + ./infotest.run --info + assertEqual "$?" 0 >&2 + rm -rf infotest infotest.run +) + +# Read want.info from stdin. Generate have.info using given options. Invoke +# diff want.info have.info and return its exit status +# +# $@ : makeself options +diffInfo() { + local rc="" + cd "$(mktemp -d)" || return 1 + cat >want.info + haveInfo "$@" >have.info + if diff want.info have.info >&2; then + rc="$?" + else + rc="$?" + fi + rm -f have.info want.info + return "${rc}" +} + +testDefault() ( + cd "$(mktemp -d)" || return 1 + diffInfo --packaging-date "@0" <<EOF +Identification: infotest +Target directory: infotest +Uncompressed size: 12 KB +Compression: gzip +Encryption: n +Date of packaging: @0 +Built with Makeself version ${VERSION} +Build command was: ./makeself.sh \\ + "--packaging-date" \\ + "@0" \\ + "./infotest" \\ + "./infotest.run" \\ + "infotest" \\ + "ls" \\ + "-lah" +Script run after extraction: + ls -lah +infotest will be removed after extraction +EOF + assertEqual "$?" 0 +) + +testNocomp() ( + cd "$(mktemp -d)" || return 1 + diffInfo --packaging-date "@0" --nocomp <<EOF +Identification: infotest +Target directory: infotest +Uncompressed size: 12 KB +Compression: none +Encryption: n +Date of packaging: @0 +Built with Makeself version ${VERSION} +Build command was: ./makeself.sh \\ + "--packaging-date" \\ + "@0" \\ + "--nocomp" \\ + "./infotest" \\ + "./infotest.run" \\ + "infotest" \\ + "ls" \\ + "-lah" +Script run after extraction: + ls -lah +infotest will be removed after extraction +EOF + assertEqual "$?" 0 +) + +testNotemp() ( + cd "$(mktemp -d)" || return 1 + diffInfo --packaging-date "@0" --notemp <<EOF +Identification: infotest +Target directory: infotest +Uncompressed size: 12 KB +Compression: gzip +Encryption: n +Date of packaging: @0 +Built with Makeself version ${VERSION} +Build command was: ./makeself.sh \\ + "--packaging-date" \\ + "@0" \\ + "--notemp" \\ + "./infotest" \\ + "./infotest.run" \\ + "infotest" \\ + "ls" \\ + "-lah" +Script run after extraction: + ls -lah +directory infotest is permanent +EOF + assertEqual "$?" 0 +) + +################################################################################ + +source "${HERE}/bashunit/bashunit.bash" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/makeself-release-2.4.2/test/variabletest new/makeself-release-2.4.3/test/variabletest --- old/makeself-release-2.4.2/test/variabletest 1970-01-01 01:00:00.000000000 +0100 +++ new/makeself-release-2.4.3/test/variabletest 2021-01-16 14:33:11.000000000 +0100 @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +SUT=$(realpath $(dirname $0)/../makeself.sh) +SOURCE=$(realpath ..) + +setupTests() { + temp=`mktemp -d -t XXXXX` + cd "$temp" + mkdir archive + touch archive/file + + # $SUT archive makeself-test.run "Test $1" declare -p "${1}" + $SUT archive makeself-test.run "Test $1" echo \\\"\${${1}}\\\" +} + +testArchiveDir() +{ + setupTests ARCHIVE_DIR + local ans=$'./complicated\n dir\twith spaces' + mkdir "${ans}" + mv ./makeself-test.run "${ans}/" + actual_archive_dir="$("${ans}/makeself-test.run" --quiet)" + + assertEqual "${actual_archive_dir}" "${ans}" +} + +testTmpRoot() +{ + setupTests TMPROOT + local ans="${temp}"$'/complicated\n dir\twith spaces' + mkdir -p "${ans}" + + actual_tmp_root="$(TMPDIR="${ans}" "./makeself-test.run" --quiet)" + + assertEqual "${actual_tmp_root}" "${ans}" +} + +testUserPWD() +{ + setupTests USER_PWD + local ans="${temp}"$'/complicated\n dir\twith spaces' + mkdir -p "${ans}" + cd "${ans}" + + actual_user_pwd="$("${temp}/makeself-test.run" --quiet)" + + assertEqual "${actual_user_pwd}" "${ans}" +} + + +source bashunit/bashunit.bash
participants (1)
-
Source-Sync