makeself.sh 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-3.0-or-later
  3. #
  4. # Makeself version 2.3.x
  5. # by Stephane Peter <megastep@megastep.org>
  6. #
  7. # Utility to create self-extracting tar.gz archives.
  8. # The resulting archive is a file holding the tar.gz archive with
  9. # a small Shell script stub that uncompresses the archive to a temporary
  10. # directory and then executes a given script from within that directory.
  11. #
  12. # Makeself home page: http://makeself.io/
  13. #
  14. # Version 2.0 is a rewrite of version 1.0 to make the code easier to read and maintain.
  15. #
  16. # Version history :
  17. # - 1.0 : Initial public release
  18. # - 1.1 : The archive can be passed parameters that will be passed on to
  19. # the embedded script, thanks to John C. Quillan
  20. # - 1.2 : Package distribution, bzip2 compression, more command line options,
  21. # support for non-temporary archives. Ideas thanks to Francois Petitjean
  22. # - 1.3 : More patches from Bjarni R. Einarsson and Francois Petitjean:
  23. # Support for no compression (--nocomp), script is no longer mandatory,
  24. # automatic launch in an xterm, optional verbose output, and -target
  25. # archive option to indicate where to extract the files.
  26. # - 1.4 : Improved UNIX compatibility (Francois Petitjean)
  27. # Automatic integrity checking, support of LSM files (Francois Petitjean)
  28. # - 1.5 : Many bugfixes. Optionally disable xterm spawning.
  29. # - 1.5.1 : More bugfixes, added archive options -list and -check.
  30. # - 1.5.2 : Cosmetic changes to inform the user of what's going on with big
  31. # archives (Quake III demo)
  32. # - 1.5.3 : Check for validity of the DISPLAY variable before launching an xterm.
  33. # More verbosity in xterms and check for embedded command's return value.
  34. # Bugfix for Debian 2.0 systems that have a different "print" command.
  35. # - 1.5.4 : Many bugfixes. Print out a message if the extraction failed.
  36. # - 1.5.5 : More bugfixes. Added support for SETUP_NOCHECK environment variable to
  37. # bypass checksum verification of archives.
  38. # - 1.6.0 : Compute MD5 checksums with the md5sum command (patch from Ryan Gordon)
  39. # - 2.0 : Brand new rewrite, cleaner architecture, separated header and UNIX ports.
  40. # - 2.0.1 : Added --copy
  41. # - 2.1.0 : Allow multiple tarballs to be stored in one archive, and incremental updates.
  42. # Added --nochown for archives
  43. # Stopped doing redundant checksums when not necessary
  44. # - 2.1.1 : Work around insane behavior from certain Linux distros with no 'uncompress' command
  45. # Cleaned up the code to handle error codes from compress. Simplified the extraction code.
  46. # - 2.1.2 : Some bug fixes. Use head -n to avoid problems.
  47. # - 2.1.3 : Bug fixes with command line when spawning terminals.
  48. # Added --tar for archives, allowing to give arbitrary arguments to tar on the contents of the archive.
  49. # Added --noexec to prevent execution of embedded scripts.
  50. # Added --nomd5 and --nocrc to avoid creating checksums in archives.
  51. # Added command used to create the archive in --info output.
  52. # Run the embedded script through eval.
  53. # - 2.1.4 : Fixed --info output.
  54. # Generate random directory name when extracting files to . to avoid problems. (Jason Trent)
  55. # Better handling of errors with wrong permissions for the directory containing the files. (Jason Trent)
  56. # Avoid some race conditions (Ludwig Nussel)
  57. # Unset the $CDPATH variable to avoid problems if it is set. (Debian)
  58. # Better handling of dot files in the archive directory.
  59. # - 2.1.5 : Made the md5sum detection consistent with the header code.
  60. # Check for the presence of the archive directory
  61. # Added --encrypt for symmetric encryption through gpg (Eric Windisch)
  62. # Added support for the digest command on Solaris 10 for MD5 checksums
  63. # Check for available disk space before extracting to the target directory (Andreas Schweitzer)
  64. # Allow extraction to run asynchronously (patch by Peter Hatch)
  65. # Use file descriptors internally to avoid error messages (patch by Kay Tiong Khoo)
  66. # - 2.1.6 : Replaced one dot per file progress with a realtime progress percentage and a spinning cursor (Guy Baconniere)
  67. # Added --noprogress to prevent showing the progress during the decompression (Guy Baconniere)
  68. # Added --target dir to allow extracting directly to a target directory (Guy Baconniere)
  69. # - 2.2.0 : Many bugfixes, updates and contributions from users. Check out the project page on Github for the details.
  70. # - 2.3.0 : Option to specify packaging date to enable byte-for-byte reproducibility. (Marc Pawlowsky)
  71. #
  72. # (C) 1998-2017 by Stephane Peter <megastep@megastep.org>
  73. #
  74. # This software is released under the terms of the GNU GPL version 2 and above
  75. # Please read the license at http://www.gnu.org/copyleft/gpl.html
  76. #
  77. MS_VERSION=2.3.1
  78. MS_COMMAND="$0"
  79. unset CDPATH
  80. for f in "${1+"$@"}"; do
  81. MS_COMMAND="$MS_COMMAND \\\\
  82. \\\"$f\\\""
  83. done
  84. # For Solaris systems
  85. if test -d /usr/xpg4/bin; then
  86. PATH=/usr/xpg4/bin:$PATH
  87. export PATH
  88. fi
  89. # Procedures
  90. MS_Usage()
  91. {
  92. echo "Usage: $0 [params] archive_dir file_name label startup_script [args]"
  93. echo "params can be one or more of the following :"
  94. echo " --version | -v : Print out Makeself version number and exit"
  95. echo " --help | -h : Print out this help message"
  96. echo " --tar-quietly : Suppress verbose output from the tar command"
  97. echo " --quiet | -q : Do not print any messages other than errors."
  98. echo " --gzip : Compress using gzip (default if detected)"
  99. echo " --pigz : Compress with pigz"
  100. echo " --bzip2 : Compress using bzip2 instead of gzip"
  101. echo " --pbzip2 : Compress using pbzip2 instead of gzip"
  102. echo " --xz : Compress using xz instead of gzip"
  103. echo " --lzo : Compress using lzop instead of gzip"
  104. echo " --lz4 : Compress using lz4 instead of gzip"
  105. echo " --compress : Compress using the UNIX 'compress' command"
  106. echo " --complevel lvl : Compression level for gzip pigz xz lzo lz4 bzip2 and pbzip2 (default 9)"
  107. echo " --base64 : Instead of compressing, encode the data using base64"
  108. echo " --gpg-encrypt : Instead of compressing, encrypt the data using GPG"
  109. echo " --gpg-asymmetric-encrypt-sign"
  110. echo " : Instead of compressing, asymmetrically encrypt and sign the data using GPG"
  111. echo " --gpg-extra opt : Append more options to the gpg command line"
  112. echo " --ssl-encrypt : Instead of compressing, encrypt the data using OpenSSL"
  113. echo " --nocomp : Do not compress the data"
  114. echo " --notemp : The archive will create archive_dir in the"
  115. echo " current directory and uncompress in ./archive_dir"
  116. echo " --needroot : Check that the root user is extracting the archive before proceeding"
  117. echo " --copy : Upon extraction, the archive will first copy itself to"
  118. echo " a temporary directory"
  119. echo " --append : Append more files to an existing Makeself archive"
  120. echo " The label and startup scripts will then be ignored"
  121. echo " --target dir : Extract directly to a target directory"
  122. echo " directory path can be either absolute or relative"
  123. echo " --nooverwrite : Do not extract the archive if the specified target directory exists"
  124. echo " --current : Files will be extracted to the current directory"
  125. echo " Both --current and --target imply --notemp"
  126. echo " --tar-extra opt : Append more options to the tar command line"
  127. echo " --untar-extra opt : Append more options to the during the extraction of the tar archive"
  128. echo " --nomd5 : Don't calculate an MD5 for archive"
  129. echo " --nocrc : Don't calculate a CRC for archive"
  130. echo " --header file : Specify location of the header script"
  131. echo " --follow : Follow the symlinks in the archive"
  132. echo " --noprogress : Do not show the progress during the decompression"
  133. echo " --nox11 : Disable automatic spawn of a xterm"
  134. echo " --nowait : Do not wait for user input after executing embedded"
  135. echo " program from an xterm"
  136. echo " --lsm file : LSM file describing the package"
  137. echo " --license file : Append a license file"
  138. echo " --help-header file : Add a header to the archive's --help output"
  139. echo " --packaging-date date"
  140. echo " : Use provided string as the packaging date"
  141. echo " instead of the current date."
  142. echo
  143. echo " --keep-umask : Keep the umask set to shell default, rather than overriding when executing self-extracting archive."
  144. echo " --export-conf : Export configuration variables to startup_script"
  145. echo
  146. echo "Do not forget to give a fully qualified startup script name"
  147. echo "(i.e. with a ./ prefix if inside the archive)."
  148. exit 1
  149. }
  150. # Default settings
  151. if type gzip 2>&1 > /dev/null; then
  152. COMPRESS=gzip
  153. else
  154. COMPRESS=Unix
  155. fi
  156. COMPRESS_LEVEL=9
  157. KEEP=n
  158. CURRENT=n
  159. NOX11=n
  160. NOWAIT=n
  161. APPEND=n
  162. TAR_QUIETLY=n
  163. KEEP_UMASK=n
  164. QUIET=n
  165. NOPROGRESS=n
  166. COPY=none
  167. NEED_ROOT=n
  168. TAR_ARGS=cvf
  169. TAR_EXTRA=""
  170. GPG_EXTRA=""
  171. DU_ARGS=-ks
  172. HEADER=`dirname "$0"`/makeself-header.sh
  173. TARGETDIR=""
  174. NOOVERWRITE=n
  175. DATE=`LC_ALL=C date`
  176. EXPORT_CONF=n
  177. # LSM file stuff
  178. LSM_CMD="echo No LSM. >> \"\$archname\""
  179. while true
  180. do
  181. case "$1" in
  182. --version | -v)
  183. echo Makeself version $MS_VERSION
  184. exit 0
  185. ;;
  186. --pbzip2)
  187. COMPRESS=pbzip2
  188. shift
  189. ;;
  190. --bzip2)
  191. COMPRESS=bzip2
  192. shift
  193. ;;
  194. --gzip)
  195. COMPRESS=gzip
  196. shift
  197. ;;
  198. --pigz)
  199. COMPRESS=pigz
  200. shift
  201. ;;
  202. --xz)
  203. COMPRESS=xz
  204. shift
  205. ;;
  206. --lzo)
  207. COMPRESS=lzo
  208. shift
  209. ;;
  210. --lz4)
  211. COMPRESS=lz4
  212. shift
  213. ;;
  214. --compress)
  215. COMPRESS=Unix
  216. shift
  217. ;;
  218. --base64)
  219. COMPRESS=base64
  220. shift
  221. ;;
  222. --gpg-encrypt)
  223. COMPRESS=gpg
  224. shift
  225. ;;
  226. --gpg-asymmetric-encrypt-sign)
  227. COMPRESS=gpg-asymmetric
  228. shift
  229. ;;
  230. --gpg-extra)
  231. GPG_EXTRA="$2"
  232. if ! shift 2; then MS_Help; exit 1; fi
  233. ;;
  234. --ssl-encrypt)
  235. COMPRESS=openssl
  236. shift
  237. ;;
  238. --nocomp)
  239. COMPRESS=none
  240. shift
  241. ;;
  242. --complevel)
  243. COMPRESS_LEVEL="$2"
  244. if ! shift 2; then MS_Help; exit 1; fi
  245. ;;
  246. --notemp)
  247. KEEP=y
  248. shift
  249. ;;
  250. --copy)
  251. COPY=copy
  252. shift
  253. ;;
  254. --current)
  255. CURRENT=y
  256. KEEP=y
  257. shift
  258. ;;
  259. --tar-extra)
  260. TAR_EXTRA="$2"
  261. if ! shift 2; then MS_Help; exit 1; fi
  262. ;;
  263. --untar-extra)
  264. UNTAR_EXTRA="$2"
  265. if ! shift 2; then MS_Help; exit 1; fi
  266. ;;
  267. --target)
  268. TARGETDIR="$2"
  269. KEEP=y
  270. if ! shift 2; then MS_Help; exit 1; fi
  271. ;;
  272. --nooverwrite)
  273. NOOVERWRITE=y
  274. shift
  275. ;;
  276. --needroot)
  277. NEED_ROOT=y
  278. shift
  279. ;;
  280. --header)
  281. HEADER="$2"
  282. if ! shift 2; then MS_Help; exit 1; fi
  283. ;;
  284. --license)
  285. LICENSE=`cat $2`
  286. if ! shift 2; then MS_Help; exit 1; fi
  287. ;;
  288. --follow)
  289. TAR_ARGS=cvhf
  290. DU_ARGS=-ksL
  291. shift
  292. ;;
  293. --noprogress)
  294. NOPROGRESS=y
  295. shift
  296. ;;
  297. --nox11)
  298. NOX11=y
  299. shift
  300. ;;
  301. --nowait)
  302. NOWAIT=y
  303. shift
  304. ;;
  305. --nomd5)
  306. NOMD5=y
  307. shift
  308. ;;
  309. --nocrc)
  310. NOCRC=y
  311. shift
  312. ;;
  313. --append)
  314. APPEND=y
  315. shift
  316. ;;
  317. --lsm)
  318. LSM_CMD="cat \"$2\" >> \"\$archname\""
  319. if ! shift 2; then MS_Help; exit 1; fi
  320. ;;
  321. --packaging-date)
  322. DATE="$2"
  323. if ! shift 2; then MS_Help; exit 1; fi
  324. ;;
  325. --help-header)
  326. HELPHEADER=`sed -e "s/'/'\\\\\''/g" $2`
  327. if ! shift 2; then MS_Help; exit 1; fi
  328. [ -n "$HELPHEADER" ] && HELPHEADER="$HELPHEADER
  329. "
  330. ;;
  331. --tar-quietly)
  332. TAR_QUIETLY=y
  333. shift
  334. ;;
  335. --keep-umask)
  336. KEEP_UMASK=y
  337. shift
  338. ;;
  339. --export-conf)
  340. EXPORT_CONF=y
  341. shift
  342. ;;
  343. -q | --quiet)
  344. QUIET=y
  345. shift
  346. ;;
  347. -h | --help)
  348. MS_Usage
  349. ;;
  350. -*)
  351. echo Unrecognized flag : "$1"
  352. MS_Usage
  353. ;;
  354. *)
  355. break
  356. ;;
  357. esac
  358. done
  359. if test $# -lt 1; then
  360. MS_Usage
  361. else
  362. if test -d "$1"; then
  363. archdir="$1"
  364. else
  365. echo "Directory $1 does not exist." >&2
  366. exit 1
  367. fi
  368. fi
  369. archname="$2"
  370. if test "$QUIET" = "y" || test "$TAR_QUIETLY" = "y"; then
  371. if test "$TAR_ARGS" = "cvf"; then
  372. TAR_ARGS="cf"
  373. elif test "$TAR_ARGS" = "cvhf";then
  374. TAR_ARGS="chf"
  375. fi
  376. fi
  377. if test "$APPEND" = y; then
  378. if test $# -lt 2; then
  379. MS_Usage
  380. fi
  381. # Gather the info from the original archive
  382. OLDENV=`sh "$archname" --dumpconf`
  383. if test $? -ne 0; then
  384. echo "Unable to update archive: $archname" >&2
  385. exit 1
  386. else
  387. eval "$OLDENV"
  388. fi
  389. else
  390. if test "$KEEP" = n -a $# = 3; then
  391. echo "ERROR: Making a temporary archive with no embedded command does not make sense!" >&2
  392. echo >&2
  393. MS_Usage
  394. fi
  395. # We don't want to create an absolute directory unless a target directory is defined
  396. if test "$CURRENT" = y; then
  397. archdirname="."
  398. elif test x$TARGETDIR != x; then
  399. archdirname="$TARGETDIR"
  400. else
  401. archdirname=`basename "$1"`
  402. fi
  403. if test $# -lt 3; then
  404. MS_Usage
  405. fi
  406. LABEL="$3"
  407. SCRIPT="$4"
  408. test "x$SCRIPT" = x || shift 1
  409. shift 3
  410. SCRIPTARGS="$*"
  411. fi
  412. if test "$KEEP" = n -a "$CURRENT" = y; then
  413. echo "ERROR: It is A VERY DANGEROUS IDEA to try to combine --notemp and --current." >&2
  414. exit 1
  415. fi
  416. case $COMPRESS in
  417. gzip)
  418. GZIP_CMD="gzip -c$COMPRESS_LEVEL"
  419. GUNZIP_CMD="gzip -cd"
  420. ;;
  421. pigz)
  422. GZIP_CMD="pigz -$COMPRESS_LEVEL"
  423. GUNZIP_CMD="gzip -cd"
  424. ;;
  425. pbzip2)
  426. GZIP_CMD="pbzip2 -c$COMPRESS_LEVEL"
  427. GUNZIP_CMD="bzip2 -d"
  428. ;;
  429. bzip2)
  430. GZIP_CMD="bzip2 -$COMPRESS_LEVEL"
  431. GUNZIP_CMD="bzip2 -d"
  432. ;;
  433. xz)
  434. GZIP_CMD="xz -c$COMPRESS_LEVEL"
  435. GUNZIP_CMD="xz -d"
  436. ;;
  437. lzo)
  438. GZIP_CMD="lzop -c$COMPRESS_LEVEL"
  439. GUNZIP_CMD="lzop -d"
  440. ;;
  441. lz4)
  442. GZIP_CMD="lz4 -c$COMPRESS_LEVEL"
  443. GUNZIP_CMD="lz4 -d"
  444. ;;
  445. base64)
  446. GZIP_CMD="base64"
  447. GUNZIP_CMD="base64 -d -i"
  448. ;;
  449. gpg)
  450. GZIP_CMD="gpg $GPG_EXTRA -ac -z$COMPRESS_LEVEL"
  451. GUNZIP_CMD="gpg -d"
  452. ;;
  453. gpg-asymmetric)
  454. GZIP_CMD="gpg $GPG_EXTRA -z$COMPRESS_LEVEL -es"
  455. GUNZIP_CMD="gpg --yes -d"
  456. ;;
  457. openssl)
  458. GZIP_CMD="openssl aes-256-cbc -a -salt -md sha256"
  459. GUNZIP_CMD="openssl aes-256-cbc -d -a -md sha256"
  460. ;;
  461. Unix)
  462. GZIP_CMD="compress -cf"
  463. GUNZIP_CMD="exec 2>&-; uncompress -c || test \\\$? -eq 2 || gzip -cd"
  464. ;;
  465. none)
  466. GZIP_CMD="cat"
  467. GUNZIP_CMD="cat"
  468. ;;
  469. esac
  470. tmpfile="${TMPDIR:=/tmp}/mkself$$"
  471. if test -f "$HEADER"; then
  472. oldarchname="$archname"
  473. archname="$tmpfile"
  474. # Generate a fake header to count its lines
  475. SKIP=0
  476. . "$HEADER"
  477. SKIP=`cat "$tmpfile" |wc -l`
  478. # Get rid of any spaces
  479. SKIP=`expr $SKIP`
  480. rm -f "$tmpfile"
  481. if test "$QUIET" = "n";then
  482. echo Header is $SKIP lines long >&2
  483. fi
  484. archname="$oldarchname"
  485. else
  486. echo "Unable to open header file: $HEADER" >&2
  487. exit 1
  488. fi
  489. if test "$QUIET" = "n";then
  490. echo
  491. fi
  492. if test "$APPEND" = n; then
  493. if test -f "$archname"; then
  494. echo "WARNING: Overwriting existing file: $archname" >&2
  495. fi
  496. fi
  497. USIZE=`du $DU_ARGS "$archdir" | awk '{print $1}'`
  498. if test "." = "$archdirname"; then
  499. if test "$KEEP" = n; then
  500. archdirname="makeself-$$-`date +%Y%m%d%H%M%S`"
  501. fi
  502. fi
  503. test -d "$archdir" || { echo "Error: $archdir does not exist."; rm -f "$tmpfile"; exit 1; }
  504. if test "$QUIET" = "n";then
  505. echo About to compress $USIZE KB of data...
  506. echo Adding files to archive named \"$archname\"...
  507. fi
  508. exec 3<> "$tmpfile"
  509. ( cd "$archdir" && ( tar $TAR_EXTRA -$TAR_ARGS - . | eval "$GZIP_CMD" >&3 ) ) || \
  510. { echo Aborting: archive directory not found or temporary file: "$tmpfile" could not be created.; exec 3>&-; rm -f "$tmpfile"; exit 1; }
  511. exec 3>&- # try to close the archive
  512. fsize=`cat "$tmpfile" | wc -c | tr -d " "`
  513. # Compute the checksums
  514. md5sum=00000000000000000000000000000000
  515. crcsum=0000000000
  516. if test "$NOCRC" = y; then
  517. if test "$QUIET" = "n";then
  518. echo "skipping crc at user request"
  519. fi
  520. else
  521. crcsum=`cat "$tmpfile" | CMD_ENV=xpg4 cksum | sed -e 's/ /Z/' -e 's/ /Z/' | cut -dZ -f1`
  522. if test "$QUIET" = "n";then
  523. echo "CRC: $crcsum"
  524. fi
  525. fi
  526. if test "$NOMD5" = y; then
  527. if test "$QUIET" = "n";then
  528. echo "skipping md5sum at user request"
  529. fi
  530. else
  531. # Try to locate a MD5 binary
  532. OLD_PATH=$PATH
  533. PATH=${GUESS_MD5_PATH:-"$OLD_PATH:/bin:/usr/bin:/sbin:/usr/local/ssl/bin:/usr/local/bin:/opt/openssl/bin"}
  534. MD5_ARG=""
  535. MD5_PATH=`exec <&- 2>&-; which md5sum || command -v md5sum || type md5sum`
  536. test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which md5 || command -v md5 || type md5`
  537. test -x "$MD5_PATH" || MD5_PATH=`exec <&- 2>&-; which digest || command -v digest || type digest`
  538. PATH=$OLD_PATH
  539. if test -x "$MD5_PATH"; then
  540. if test `basename ${MD5_PATH}`x = digestx; then
  541. MD5_ARG="-a md5"
  542. fi
  543. md5sum=`cat "$tmpfile" | eval "$MD5_PATH $MD5_ARG" | cut -b-32`;
  544. if test "$QUIET" = "n";then
  545. echo "MD5: $md5sum"
  546. fi
  547. else
  548. if test "$QUIET" = "n";then
  549. echo "MD5: none, MD5 command not found"
  550. fi
  551. fi
  552. fi
  553. if test "$APPEND" = y; then
  554. mv "$archname" "$archname".bak || exit
  555. # Prepare entry for new archive
  556. filesizes="$filesizes $fsize"
  557. CRCsum="$CRCsum $crcsum"
  558. MD5sum="$MD5sum $md5sum"
  559. USIZE=`expr $USIZE + $OLDUSIZE`
  560. # Generate the header
  561. . "$HEADER"
  562. # Append the original data
  563. tail -n +$OLDSKIP "$archname".bak >> "$archname"
  564. # Append the new data
  565. cat "$tmpfile" >> "$archname"
  566. chmod +x "$archname"
  567. rm -f "$archname".bak
  568. if test "$QUIET" = "n";then
  569. echo Self-extractable archive \"$archname\" successfully updated.
  570. fi
  571. else
  572. filesizes="$fsize"
  573. CRCsum="$crcsum"
  574. MD5sum="$md5sum"
  575. # Generate the header
  576. . "$HEADER"
  577. # Append the compressed tar data after the stub
  578. if test "$QUIET" = "n";then
  579. echo
  580. fi
  581. cat "$tmpfile" >> "$archname"
  582. chmod +x "$archname"
  583. if test "$QUIET" = "n";then
  584. echo Self-extractable archive \"$archname\" successfully created.
  585. fi
  586. fi
  587. rm -f "$tmpfile"