Skip to content

Commit 3815292

Browse files
committed
Handle base64 encoding after compression. Updated documentation. Prepare for release 2.7.1.
1 parent ce19ea1 commit 3815292

File tree

6 files changed

+125
-17
lines changed

6 files changed

+125
-17
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to Makeself are documented here.
44

5+
## 2.7.1
6+
7+
- Base64 encoding now runs after compression, consistent with other post-compression encryption/encoding options.
8+
- Documentation updated to reflect that compression can be combined with encryption/encoding.
9+
510
## 2.7.0
611

712
- Compression now precedes encryption so both can be enabled together.

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ makeself.sh [args] archive_dir file_name label startup_script [script_args]
8686
* **`--lz4`** : Use lz4 instead of gzip for better compression. The lz4 command must be available in the command path. It is recommended that the archive extension be set to something like '.lz4.run' for the archive, so that potential users know that they'll need lz4 to extract it.
8787
* **`--zstd`** : Use zstd instead of gzip for better compression. The zstd command must be available in the command path. It is recommended that the archive extension be set to something like '.zstd.run' for the archive, so that potential users know that they'll need zstd to extract it.
8888
* **`--pigz`** : Use pigz for compression.
89-
* **`--base64`** : Encode the archive to ASCII in Base64 format instead of compressing (base64 command required).
90-
* **`--gpg-encrypt`** : Encrypt the archive using `gpg -ac -z $COMPRESS_LEVEL`. This will prompt for a password to encrypt with. Assumes that potential users have `gpg` installed.
91-
* **`--ssl-encrypt`** : Encrypt the archive using `openssl aes-256-cbc -a -salt`. This will prompt for a password to encrypt with. Assumes that the potential users have the OpenSSL tools installed.
89+
* **`--base64`** : Base64-encode the final compressed archive (base64 command required). This is applied after compression and can be combined with any compressor.
90+
* **`--gpg-encrypt`** : Encrypt the archive using `gpg -ac -z $COMPRESS_LEVEL`. This is applied after compression. Assumes that potential users have `gpg` installed.
91+
* **`--ssl-encrypt`** : Encrypt the archive using `openssl aes-256-cbc -a -salt`. This is applied after compression. Assumes that the potential users have the OpenSSL tools installed.
9292
* **`--compress`** : Use the UNIX `compress` command to compress the data. This should be the default on all platforms that don't have gzip available.
9393
* **`--nocomp`** : Do not use any compression for the archive, which will then be an uncompressed TAR.
9494
* **`--complevel`** : Specify the compression level for gzip, bzip2, pbzip2, zstd, xz, lzo or lz4. (defaults to 9)
@@ -189,13 +189,13 @@ I will gladly consider merging your pull requests on the [GitHub][10] repository
189189

190190
## Download
191191

192-
Get the latest official distribution [on Github here][9] (version 2.7.0).
192+
Get the latest official distribution [on Github here][9] (version 2.7.1).
193193

194194
The latest development version can be grabbed from [GitHub][10]. Feel free to submit any patches there through the fork and pull request process.
195195

196196
## Changelog
197197

198-
The full release history has moved to `CHANGELOG.md`.
198+
The full release history has moved to [`CHANGELOG.md`](https://makeself.io/changes).
199199

200200
## Links
201201

@@ -224,7 +224,7 @@ This project is now hosted on GitHub. Feel free to submit patches and bug report
224224
[6]: http://earth.google.com/
225225
[7]: http://www.virtualbox.org/
226226
[8]: http://www.gnu.org/copyleft/gpl.html
227-
[9]: https://github.com/megastep/makeself/releases/download/release-2.7.0/makeself-2.7.0.run
227+
[9]: https://github.com/megastep/makeself/releases/download/release-2.7.1/makeself-2.7.1.run
228228
[10]: https://github.com/megastep/makeself
229229
[11]: https://github.com/megastep/loki_setup/
230230
[14]: http://bre.klaki.net/programs/setup.sh/

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.0
1+
2.7.1

makeself.1

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "MAKESELF" "1" "2.7.0"
1+
.TH "MAKESELF" "1" "2.7.1"
22
.SH "NAME"
33
makeself \- An utility to generate self-extractable archives.
44
.SH "SYNTAX"
@@ -54,14 +54,29 @@ Compress using pigz.
5454
Compress using zstd.
5555
.TP
5656
.B --base64
57-
Encode the archive to ASCII in Base64 format instead of compressing (base64 command required).
57+
Base64-encode the final compressed archive (base64 command required). This runs after compression and can be combined with any compressor.
5858
.TP
5959
.B --gpg-encrypt
6060
Encrypt the archive using GPG. This will prompt for a password to encrypt with.
6161
.TP
62+
.B --gpg-asymmetric-encrypt-sign
63+
Asymmetrically encrypt and sign the archive using GPG.
64+
.TP
65+
.B --gpg-extra opt
66+
Append more options to the gpg command line.
67+
.TP
6268
.B --ssl-encrypt
6369
Encrypt the archive using OpenSSL. This will prompt for a password to encrypt with.
6470
.TP
71+
.B --ssl-passwd pass
72+
Use the given password to encrypt the data using OpenSSL.
73+
.TP
74+
.B --ssl-pass-src src
75+
Use the given src as the source of password to encrypt the data using OpenSSL.
76+
.TP
77+
.B --ssl-no-md
78+
Do not use "-md" option (for older OpenSSL).
79+
.TP
6580
.B --keep-umask
6681
Keep the umask set to shell default, rather than overriding when executing the self-extracting archive.
6782
.TP
@@ -86,6 +101,9 @@ Specify the number of threads to be used by compressors that support paralleliza
86101
.B --tar-extra opt
87102
Append more options to the tar command line.
88103
.TP
104+
.B --untar-extra opt
105+
Append more options when extracting the tar archive.
106+
.TP
89107
.B --notemp
90108
The archive will create archive_dir in the current directory and
91109
uncompress in ./archive_dir.
@@ -114,6 +132,9 @@ Specify a pre-extraction script.
114132
.B --cleanup file
115133
Specify a cleanup script that executes on interrupt and when finished successfully.
116134
.TP
135+
.B --cleanup-args args
136+
Arguments to the cleanup script (wrap in quotes to provide multiple arguments).
137+
.TP
117138
.B --follow
118139
Follow the symlinks in the archive.
119140
.TP
@@ -129,6 +150,12 @@ Disable automatic spawn of an xterm if running in X11.
129150
.B --nowait
130151
Do not wait for user input after executing embedded program from an xterm.
131152
.TP
153+
.B --nochown
154+
Do not give the target folder to the current user.
155+
.TP
156+
.B --chown
157+
Give the target folder to the current user recursively.
158+
.TP
132159
.B --nomd5
133160
Do not create a MD5 checksum for the archive.
134161
.TP
@@ -146,6 +173,12 @@ Append a license file.
146173
.TP
147174
.B --packaging-date date
148175
Use provided string as the packaging date instead of the current date.
176+
.TP
177+
.B --needroot
178+
Require root permissions for extraction.
179+
.TP
180+
.B --export-conf
181+
Export configuration variables to the startup script.
149182
.SH "ENVIRONMENT"
150183
.TP
151184
.B SETUP_NOCHECK

makeself.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Self-extracting archives created with this script are explictly NOT released under the term of the GPL
1818
#
1919

20-
MS_VERSION=2.7.0
20+
MS_VERSION=2.7.1
2121
MS_COMMAND="$0"
2222
MS_SIGN_NEXT=n
2323
unset CDPATH
@@ -152,6 +152,7 @@ ENCRYPT=n
152152
ENCRYPT_MODE=n
153153
ENCRYPT_CMD=""
154154
DECRYPT_CMD=""
155+
BASE64_MODE=n
155156
PASSWD=""
156157
PASSWD_SRC=""
157158
OPENSSL_NO_MD=n
@@ -237,8 +238,9 @@ do
237238
shift
238239
;;
239240
--base64)
240-
COMPRESS=base64
241-
shift
241+
ENCRYPT_MODE=base64
242+
BASE64_MODE=y
243+
shift
242244
;;
243245
--gpg-encrypt)
244246
ENCRYPT_MODE=gpg
@@ -551,10 +553,6 @@ lz4)
551553
GZIP_CMD="lz4 -c$COMPRESS_LEVEL"
552554
GUNZIP_CMD="lz4 -d"
553555
;;
554-
base64)
555-
GZIP_CMD="base64"
556-
GUNZIP_CMD="base64 --decode -i -"
557-
;;
558556
compress)
559557
GZIP_CMD="compress -fc"
560558
GUNZIP_CMD="(type compress >/dev/null 2>&1 && compress -fcd || gzip -cd)"
@@ -597,6 +595,10 @@ gpg-asymmetric)
597595
ENCRYPT_CMD="gpg $GPG_EXTRA -z$COMPRESS_LEVEL -es -o -"
598596
DECRYPT_CMD="gpg $GPG_EXTRA --yes -d"
599597
;;
598+
base64)
599+
ENCRYPT_CMD="base64"
600+
DECRYPT_CMD="base64 --decode"
601+
;;
600602
n)
601603
;;
602604
esac
@@ -656,7 +658,11 @@ test -x "$TAR" || TAR=tar
656658
tmparch="${TMPDIR:-/tmp}/mkself$$.tar"
657659
(
658660
if test "$APPEND" = "y"; then
659-
tail -n "+$OLDSKIP" "$archname" | eval "$GUNZIP_CMD" > "$tmparch"
661+
if test x"$ENCRYPT_MODE" != xn; then
662+
tail -n "+$OLDSKIP" "$archname" | eval "$DECRYPT_CMD" | eval "$GUNZIP_CMD" > "$tmparch"
663+
else
664+
tail -n "+$OLDSKIP" "$archname" | eval "$GUNZIP_CMD" > "$tmparch"
665+
fi
660666
fi
661667
cd "$archdir"
662668
# "Determining if a directory is empty"

test/infotest

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ sslDiffInfo() {
4747
diffInfo "$@"
4848
}
4949

50+
base64DiffInfo() {
51+
if ! command -v base64 >/dev/null 2>&1; then
52+
# Skip gracefully if base64 is not available
53+
return 0
54+
fi
55+
diffInfo "$@"
56+
}
57+
5058
gpgDiffInfo() {
5159
if ! command -v gpg >/dev/null 2>&1; then
5260
# Skip gracefully if gpg is not available
@@ -285,6 +293,62 @@ EOF
285293
assertEquals "$?" 0
286294
)
287295

296+
testBase64WithGzipCompression() (
297+
cd "$(mktemp -d)" || return 1
298+
base64DiffInfo --packaging-date "@0" --base64 <<EOF
299+
Identification: infotest
300+
Target directory: infotest
301+
Uncompressed size: ${UNCOMPRESSED_PLACEHOLDER}
302+
Compression: gzip
303+
Encryption: base64
304+
Date of packaging: @0
305+
Built with Makeself version ${VERSION}
306+
Build command was: ./makeself.sh \\
307+
"--packaging-date" \\
308+
"@0" \\
309+
"--base64" \\
310+
"./infotest" \\
311+
"./infotest.run" \\
312+
"infotest" \\
313+
"ls" \\
314+
"-lah"
315+
Script run after extraction:
316+
ls -lah
317+
infotest will be removed after extraction
318+
EOF
319+
assertEquals "$?" 0
320+
)
321+
322+
testBase64WithZstdCompression() (
323+
cd "$(mktemp -d)" || return 1
324+
if ! command -v zstd >/dev/null 2>&1; then
325+
return 0
326+
fi
327+
base64DiffInfo --packaging-date "@0" --base64 --zstd <<EOF
328+
Identification: infotest
329+
Target directory: infotest
330+
Uncompressed size: ${UNCOMPRESSED_PLACEHOLDER}
331+
Compression: zstd
332+
Encryption: base64
333+
Date of packaging: @0
334+
Built with Makeself version ${VERSION}
335+
Build command was: ./makeself.sh \\
336+
"--packaging-date" \\
337+
"@0" \\
338+
"--base64" \\
339+
"--zstd" \\
340+
"./infotest" \\
341+
"./infotest.run" \\
342+
"infotest" \\
343+
"ls" \\
344+
"-lah"
345+
Script run after extraction:
346+
ls -lah
347+
infotest will be removed after extraction
348+
EOF
349+
assertEquals "$?" 0
350+
)
351+
288352
################################################################################
289353

290354
# Load and run shUnit2.

0 commit comments

Comments
 (0)