Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
megastep authored Mar 23, 2024
2 parents 9c26407 + 1e94247 commit 691ef76
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 32 deletions.
66 changes: 38 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ jobs:
container: 'ubuntu:latest'
artifact: 'ubuntu'

- os: ubuntu-latest
- os: alpine-latest
container: 'alpine:latest'
artifact: 'alpine'


- os: rockylinux
container: 'rockylinux:9' # they do not have latest, but 9 will be covered for all the defaults for all latest 9 version
artifact: 'rockylinux'

- os: windows-latest
artifact: 'windows'

Expand All @@ -29,7 +33,13 @@ jobs:
run: |
apt update
apt -y install git make pbzip2 binutils bzip2 zstd gnupg
- name: Install RockyLinux packages
if: matrix.container == 'rockylinux:9'
run: |
dnf groupinstall -y "Development Tools" "RPM Development Tools"
dnf install -y zstd binutils binutils-devel gnupg2 pbzip2
- name: Install Alpine packages
if: matrix.container == 'alpine:latest'
run: apk add --no-cache bash git make libarchive-tools gnupg coreutils binutils bzip2 zstd
Expand All @@ -39,14 +49,14 @@ jobs:
run: brew install pbzip2 coreutils zstd

- name: Checkout Makeself
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Build release
run: make

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.artifact }}
path: release
Expand All @@ -56,13 +66,13 @@ jobs:

test-freebsd:
needs: test
runs-on: macos-12
runs-on: ubuntu-latest
name: Test Makeself on FreeBSD
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Test on FreeBSD
uses: vmactions/freebsd-vm@v0
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: pkg install -y pbzip2
Expand All @@ -72,45 +82,45 @@ jobs:
test-openbsd:
needs: test
runs-on: macos-12
runs-on: ubuntu-latest
name: Test Makeself on OpenBSD
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Test on OpenBSD
uses: vmactions/openbsd-vm@v0
uses: vmactions/openbsd-vm@v1
with:
usesh: true
prepare: pkg_add pbzip2
prepare: /usr/sbin/pkg_add pbzip2
run: |
pwd
sh ./test/run-makeself.sh
test-netbsd:
needs: test
runs-on: macos-12
runs-on: ubuntu-latest
name: Test Makeself on NetBSD
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Test on NetBSD
uses: vmactions/netbsd-vm@v0
uses: vmactions/netbsd-vm@v1
with:
usesh: true
prepare: pkg_add pbzip2
prepare: /usr/sbin/pkg_add pbzip2
run: |
pwd
sh ./test/run-makeself.sh
test-solaris:
needs: test
runs-on: macos-12
runs-on: ubuntu-latest
name: Test Makeself on Solaris
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Test on Solaris
uses: vmactions/solaris-vm@v0
uses: vmactions/solaris-vm@v1
with:
mem: 2048
prepare: pkgutil -y -i pbzip2
Expand All @@ -124,8 +134,8 @@ jobs:
runs-on: ubuntu-latest
container: alpine:latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Test on Alpine
run: sh ./test/run-makeself.sh

Expand All @@ -137,8 +147,8 @@ jobs:
IMAGE_NAME: mcr.microsoft.com/windows/nanoserver:ltsc2022-amd64

steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4

- name: pull windows container ${{ env.IMAGE_NAME }}
shell: cmd
Expand All @@ -159,7 +169,7 @@ jobs:

steps:
- name: Checkout Makeself
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run ShellCheck
uses: megastep/shell-linter@develop
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
run: sudo env DEBIAN_FRONTEND=noninteractive apt-get -qq -y install pbzip2

- name: Checkout Makeself
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build release
run: |
Expand Down
6 changes: 5 additions & 1 deletion makeself-header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ MS_PrintLicense()
if test x"\$licensetxt" != x; then
PAGER_PATH=\`exec <&- 2>&-; which \$PAGER || command -v \$PAGER || type \$PAGER\`
if test -x "\$PAGER_PATH" && test x"\$accept" != xy; then
echo "\$licensetxt" | \$PAGER
echo "\$licensetxt" | \$PAGER -e
else
echo "\$licensetxt"
fi
Expand Down Expand Up @@ -191,6 +191,10 @@ Makeself version $MS_VERSION
--cleanup-args args Arguments to the cleanup script. Wrap in quotes to provide
multiple arguments.
-- Following arguments will be passed to the embedded script\${helpheader}
ENVIRONMENT
SETUP_NOCHECK
If set to 1, then checksum validation will be skipped.
EOH
}
Expand Down
3 changes: 3 additions & 0 deletions makeself.1
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ Append a license file.
.TP
.B --packaging-date date
Use provided string as the packaging date instead of the current date.
.SH "ENVIRONMENT"
.TP
.B SETUP_NOCHECK
If set to 1, then checksum validation will be skipped.
.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
Expand Down
8 changes: 6 additions & 2 deletions makeself.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ MS_Usage()
echo " --keep-umask : Keep the umask set to shell default, rather than overriding when executing self-extracting archive."
echo " --export-conf : Export configuration variables to startup_script"
echo
echo "ENVIRONMENT"
echo " SETUP_NOCHECK"
echo " If set to 1, then checksum validation will be skipped."
echo
echo "Do not forget to give a fully qualified startup script name"
echo "(i.e. with a ./ prefix if inside the archive)."
exit 1
Expand Down Expand Up @@ -542,8 +546,8 @@ if test x"$ENCRYPT" = x"openssl"; then
echo "Appending to existing archive is not compatible with OpenSSL encryption." >&2
fi

ENCRYPT_CMD="openssl enc -aes-256-cbc -salt"
DECRYPT_CMD="openssl enc -aes-256-cbc -d"
ENCRYPT_CMD="openssl enc -aes-256-cbc -salt -pbkdf2"
DECRYPT_CMD="openssl enc -aes-256-cbc -d -salt -pbkdf2"

if test x"$OPENSSL_NO_MD" != x"y"; then
ENCRYPT_CMD="$ENCRYPT_CMD -md sha256"
Expand Down
42 changes: 42 additions & 0 deletions test/nochecktest
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
set -eu
THIS="$(readlink -f "$0")"
THISDIR="$(dirname "${THIS}")"
SUT="$(dirname "${THISDIR}")/makeself.sh"

testNoCheck() {
# Create a directory with a simple payload.
local archive_dir
archive_dir="$(mktemp -dt archive_dir.XXXXXX)"
(
cd "${archive_dir}"
touch foo.txt bar.txt qux.txt
)

# Create a self-extracting archive.
local file_name
file_name="$(mktemp -t file_name.XXXXXX)"
"${SUT}" --nox11 --sha256 "${archive_dir}" "${file_name}" "no check test" true
assertEquals "$?" 0

printf '\nArchive verification enabled:\n' >&2
sync
"${file_name}" 2>&1
assertEquals "$?" 0

"${file_name}" 2>&1 | grep -qF 'Verifying archive integrity...'
assertEquals "$?" 0

printf '\nArchive verification disabled:\n' >&2
SETUP_NOCHECK=1 "${file_name}" 2>&1
assertEquals "$?" 0

SETUP_NOCHECK=1 "${file_name}" 2>&1 | grep -qFv 'Verifying archive integrity...'
assertEquals "$?" 0

# Clean up.
rm -rf "${archive_dir}" "${file_name}"
}

# Load and run shUnit2.
source "./shunit2/shunit2"

0 comments on commit 691ef76

Please sign in to comment.