Raymond Toy pushed to branch issue-352-new-compression-for-dist at cmucl / cmucl
Commits: 48cabd23 by Raymond Toy at 2024-08-27T16:18:25-07:00 Clean up usage message
We don't support `-b` and `-g` options anymore so remove them from the usage message. Add note about `version` being optional and the default value.
- - - - - c21d6a97 by Raymond Toy at 2024-08-27T16:22:33-07:00 More cleanups for usage message and compression code
Remove the `-b` and `-g` options from the usage options and add `-?`. Also don't recognize these as command-line options. Finally, remove the code that handled the these options.
- - - - - 3a98c0ab by Raymond Toy at 2024-08-27T16:39:25-07:00 Add -C and -E options to specify compression info for sub-scripts
Use the `-C` and `-E` options to set the appropriate tar compression option and the corresponding extension. These are set in make-dist.sh to tell make-main-dist.sh, make-extra-dist.sh, and make-src-dist.sh how to compress the tarball with the appropriate extension.
- - - - - d7825bf9 by Raymond Toy at 2024-08-27T16:40:11-07:00 Remove code for old -b and -g options
These aren't used anymore so remove the code for that.
- - - - - 2b4e1278 by Raymond Toy at 2024-08-27T16:46:57-07:00 More cleanups
Forgot tell make-src-dist.sh that -C and -E are valid options. And also forgot to supply these options when make-dist.sh calls make-src-dist.sh.
Enforce the requirement that -C and -E are required for make-main-dist.sh and friends.
- - - - -
4 changed files:
- bin/make-dist.sh - bin/make-extra-dist.sh - bin/make-main-dist.sh - bin/make-src-dist.sh
Changes:
===================================== bin/make-dist.sh ===================================== @@ -114,7 +114,6 @@ fi COMPRESS=-J COMPRESS_EXT=xz COMPRESS_NAME=xz -export COMPRESS COMPRESS_EXT COMPRESS_NAME
while getopts "C:G:O:I:M:hSA:o:V:?" arg do @@ -198,7 +197,7 @@ fi echo cmucl-$VERSION-$ARCH-$OS ROOT=`dirname $0`
-GTAR_OPTS="-t ${GTAR:-gtar}" +GTAR_OPTS="-t ${GTAR:-tar}" EXTRA_OPTS="${GROUP:+ -G ${GROUP}} ${OWNER:+ -O ${OWNER}}" INSTALL_OPTS="${INSTALL_DIR:+ -I ${INSTALL_DIR}}" MANDIR="${MANDIR:+ -M ${MANDIR}}" @@ -206,9 +205,9 @@ OPTIONS="${GTAR_OPTS} ${EXTRA_OPTS} ${INSTALL_OPTS} ${MANDIR}"
set -x echo Creating distribution for $ARCH $OS -$ROOT/make-main-dist.sh $OPTIONS ${MANDIR} $TARGET $VERSION $ARCH $OS || exit 1 -$ROOT/make-extra-dist.sh $OPTIONS $TARGET $VERSION $ARCH $OS || exit 2 +$ROOT/make-main-dist.sh -C $COMPRESS -E $COMPRESS_EXT $OPTIONS ${MANDIR} $TARGET $VERSION $ARCH $OS || exit 1 +$ROOT/make-extra-dist.sh -C $COMPRESS -E $COMPRESS_EXT $OPTIONS $TARGET $VERSION $ARCH $OS || exit 2
if [ X"$MAKE_SRC_DIST" = "Xyes" ]; then - $ROOT/make-src-dist.sh ${GTAR_OPTS} ${INSTALL_OPTS} $VERSION + $ROOT/make-src-dist.sh -C $COMPRESS -E $COMPRESS_EXT ${GTAR_OPTS} ${INSTALL_OPTS} $VERSION fi
===================================== bin/make-extra-dist.sh ===================================== @@ -1,10 +1,13 @@ #!/bin/sh
usage() { - echo "make-extra-dist.sh [-t tar] [-I destdir] [-G group] [-O owner]" + echo "make-extra-dist.sh -C option -E ext [-t tar] [-I destdir] [-G group] [-O owner]" echo " -h This help" echo " -? This help" echo " -t tar Tar program to use" + echo " -C option Tar option for compressing the tarball; required." + echo " -E ext Extension to use for the tarball. Must be consistent with" + echo " -C option. Required." echo " -I destdir Install directly to given directory instead of creating a tarball" echo " -G group Group to use" echo " -O owner Owner to use" @@ -18,9 +21,11 @@ usage() { }
GTAR=tar -while getopts "G:O:I:t:h?" arg +while getopts "C:E:G:O:I:t:h?" arg do case $arg in + C) COMPRESS=$OPTARG ;; + E) COMPRESS_EXT=$OPTARG ;; G) GROUP="-g $OPTARG" ;; O) OWNER="-o $OPTARG" ;; I) INSTALL_DIR=$OPTARG ;; @@ -31,6 +36,17 @@ done
shift `expr $OPTIND - 1`
+# -C and -E options are required +if [ -z "$COMPRESS" ]; then + echo "-C option is required" + exit 2 +fi + +if [ -z "$COMPRESS_EXT" ]; then + echo "-E option is required" + exit 2 +fi + if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ] then usage
===================================== bin/make-main-dist.sh ===================================== @@ -1,11 +1,14 @@ #!/bin/sh
usage() { - echo "make-main-dist.sh [-h?] [-t tar] [-I destdir] [-G group] [-O owner] [-M mandir]" + echo "make-main-dist.sh -C option -E ext [-h?] [-t tar][-I destdir] [-G group] [-O owner] [-M mandir]" echo " target-directory version arch os" echo " -h This help" echo " -? This help" echo " -t tar Tar program to use" + echo " -C option Tar option for compressing the tarball; required." + echo " -E ext Extension to use for the tarball. Must be consistent with" + echo " -C option. Required." echo " -I destdir Install directly to given directory instead of creating a tarball" echo " -G group Group to use" echo " -O owner Owner to use" @@ -21,9 +24,11 @@ usage() { }
GTAR=tar -while getopts "G:O:I:M:t:h?" arg +while getopts "C:E:G:O:I:M:t:h?" arg do case $arg in + C) COMPRESS=$OPTARG ;; + E) COMPRESS_EXT=$OPTARG ;; G) GROUP="-g $OPTARG" ;; O) OWNER="-o $OPTARG" ;; I) INSTALL_DIR=$OPTARG ;; @@ -35,6 +40,17 @@ done
shift `expr $OPTIND - 1`
+# -C and -E options are required +if [ -z "$COMPRESS" ]; then + echo "-C option is required" + exit 2 +fi + +if [ -z "$COMPRESS_EXT" ]; then + echo "-E option is required" + exit 2 +fi + if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ] then usage
===================================== bin/make-src-dist.sh ===================================== @@ -1,22 +1,26 @@ #!/bin/sh
usage() { - echo "make-src-dist.sh: [-bgh] [-t gnutar] [-I destdir] version" + echo "make-src-dist.sh: -C option -E ext [-h?] [-t gnutar] [-I destdir] [version]" echo " -h This help" - echo " -b Use bzip2 compression" - echo " -g Use gzip compression" + echo " -? This help" echo " -t tar Name/path to GNU tar" + echo " -C option Tar option for compressing the tarball; required." + echo " -E ext Extension to use for the tarball. Must be consistent with" + echo " -C option. Required." echo " -I destdir Install directly to given directory instead of creating a tarball" + echo " version The version. Defaults to the current date" echo "" - echo 'Create a tar ball of the cmucl sources. The tarball is named ' - echo 'cmucl-src-$version.tar.bz2 (or gz if using gzip compression)' + echo "This is generally called by make-dist.sh and not normally invoked by the user" + echo "" + echo "Create a tar ball of the cmucl sources." }
-while getopts "bgh?t:I:" arg +while getopts "C:E:h?t:I:" arg do case $arg in - b) ENABLE_BZIP=-b ;; - g) ENABLE_GZIP=-g ;; + C) COMPRESS=$OPTARG ;; + E) COMPRESS_EXT=$OPTARG ;; t) GTAR=$OPTARG ;; I) INSTALL_DIR=$OPTARG ;; h | ?) usage; exit 1 ;; @@ -25,10 +29,15 @@ done
shift `expr $OPTIND - 1`
-# If no compression given, default to gzip (on the assumption that -# that is available everywhere.) -if [ -z "$ENABLE_BZIP" -a -z "$ENABLE_GZIP" ]; then - ENABLE_GZIP=-b +# -C and -E options are required +if [ -z "$COMPRESS" ]; then + echo "-C option is required" + exit 2 +fi + +if [ -z "$COMPRESS_EXT" ]; then + echo "-E option is required" + exit 2 fi
# If no version is given, default to today's date @@ -39,15 +48,6 @@ else fi
echo Creating source distribution -if [ -n "$ENABLE_GZIP" ]; then - ZIP="gzip -c" - ZIPEXT="gz" -fi -if [ -n "$ENABLE_BZIP" ]; then - ZIP="bzip2" - ZIPEXT="bz2" -fi - GTAR_OPTIONS="--exclude=.git --exclude='*.pot.~*~'" if [ -z "$INSTALL_DIR" ]; then # echo " Compressing with $ZIP"
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/376c4ce694508d94f9e1341...