Raymond Toy pushed to branch issue-352-new-compression-for-dist at cmucl / cmucl

Commits:

4 changed files:

Changes:

  • bin/make-dist.sh
    ... ... @@ -114,7 +114,6 @@ fi
    114 114
     COMPRESS=-J
    
    115 115
     COMPRESS_EXT=xz
    
    116 116
     COMPRESS_NAME=xz
    
    117
    -export COMPRESS COMPRESS_EXT COMPRESS_NAME
    
    118 117
     
    
    119 118
     while getopts "C:G:O:I:M:hSA:o:V:?" arg
    
    120 119
     do
    
    ... ... @@ -198,7 +197,7 @@ fi
    198 197
     echo cmucl-$VERSION-$ARCH-$OS
    
    199 198
     ROOT=`dirname $0`
    
    200 199
     
    
    201
    -GTAR_OPTS="-t ${GTAR:-gtar}"
    
    200
    +GTAR_OPTS="-t ${GTAR:-tar}"
    
    202 201
     EXTRA_OPTS="${GROUP:+ -G ${GROUP}} ${OWNER:+ -O ${OWNER}}"
    
    203 202
     INSTALL_OPTS="${INSTALL_DIR:+ -I ${INSTALL_DIR}}"
    
    204 203
     MANDIR="${MANDIR:+ -M ${MANDIR}}"
    
    ... ... @@ -206,9 +205,9 @@ OPTIONS="${GTAR_OPTS} ${EXTRA_OPTS} ${INSTALL_OPTS} ${MANDIR}"
    206 205
     
    
    207 206
     set -x
    
    208 207
     echo Creating distribution for $ARCH $OS
    
    209
    -$ROOT/make-main-dist.sh $OPTIONS ${MANDIR} $TARGET $VERSION $ARCH $OS || exit 1
    
    210
    -$ROOT/make-extra-dist.sh $OPTIONS $TARGET $VERSION $ARCH $OS || exit 2
    
    208
    +$ROOT/make-main-dist.sh -C $COMPRESS -E $COMPRESS_EXT $OPTIONS ${MANDIR} $TARGET $VERSION $ARCH $OS || exit 1
    
    209
    +$ROOT/make-extra-dist.sh -C $COMPRESS -E $COMPRESS_EXT $OPTIONS $TARGET $VERSION $ARCH $OS || exit 2
    
    211 210
     
    
    212 211
     if [ X"$MAKE_SRC_DIST" = "Xyes" ]; then
    
    213
    -    $ROOT/make-src-dist.sh ${GTAR_OPTS} ${INSTALL_OPTS} $VERSION
    
    212
    +    $ROOT/make-src-dist.sh -C $COMPRESS -E $COMPRESS_EXT ${GTAR_OPTS} ${INSTALL_OPTS} $VERSION
    
    214 213
     fi

  • bin/make-extra-dist.sh
    1 1
     #!/bin/sh
    
    2 2
     
    
    3 3
     usage() {
    
    4
    -    echo "make-extra-dist.sh [-t tar] [-I destdir] [-G group] [-O owner]"
    
    4
    +    echo "make-extra-dist.sh -C option -E ext [-t tar] [-I destdir] [-G group] [-O owner]"
    
    5 5
         echo "  -h           This help"
    
    6 6
         echo "  -?           This help"
    
    7 7
         echo "  -t tar       Tar program to use"
    
    8
    +    echo "  -C option    Tar option for compressing the tarball; required."
    
    9
    +    echo "  -E ext       Extension to use for the tarball.  Must be consistent with"
    
    10
    +    echo "                 -C option.  Required."
    
    8 11
         echo "  -I destdir   Install directly to given directory instead of creating a tarball"
    
    9 12
         echo "  -G group     Group to use"
    
    10 13
         echo "  -O owner     Owner to use"
    
    ... ... @@ -18,9 +21,11 @@ usage() {
    18 21
     }
    
    19 22
     
    
    20 23
     GTAR=tar
    
    21
    -while getopts "G:O:I:t:h?" arg
    
    24
    +while getopts "C:E:G:O:I:t:h?" arg
    
    22 25
     do
    
    23 26
         case $arg in
    
    27
    +	C) COMPRESS=$OPTARG ;;
    
    28
    +	E) COMPRESS_EXT=$OPTARG ;;
    
    24 29
     	G) GROUP="-g $OPTARG" ;;
    
    25 30
     	O) OWNER="-o $OPTARG" ;;
    
    26 31
             I) INSTALL_DIR=$OPTARG ;;
    
    ... ... @@ -31,6 +36,17 @@ done
    31 36
     
    
    32 37
     shift `expr $OPTIND - 1`
    
    33 38
     
    
    39
    +# -C and -E options are required
    
    40
    +if [ -z "$COMPRESS" ]; then
    
    41
    +    echo "-C option is required"
    
    42
    +    exit 2
    
    43
    +fi
    
    44
    +
    
    45
    +if [ -z "$COMPRESS_EXT" ]; then
    
    46
    +    echo "-E option is required"
    
    47
    +    exit 2
    
    48
    +fi
    
    49
    +
    
    34 50
     if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ]
    
    35 51
     then
    
    36 52
         usage
    

  • bin/make-main-dist.sh
    1 1
     #!/bin/sh
    
    2 2
     
    
    3 3
     usage() {
    
    4
    -    echo "make-main-dist.sh [-h?] [-t tar]  [-I destdir] [-G group] [-O owner] [-M mandir]"
    
    4
    +    echo "make-main-dist.sh  -C option -E ext [-h?] [-t tar][-I destdir] [-G group] [-O owner] [-M mandir]"
    
    5 5
         echo "        target-directory version arch os"
    
    6 6
         echo "  -h           This help"
    
    7 7
         echo "  -?           This help"
    
    8 8
         echo "  -t tar       Tar program to use"
    
    9
    +    echo "  -C option    Tar option for compressing the tarball; required."
    
    10
    +    echo "  -E ext       Extension to use for the tarball.  Must be consistent with"
    
    11
    +    echo "                 -C option.  Required."
    
    9 12
         echo "  -I destdir   Install directly to given directory instead of creating a tarball"
    
    10 13
         echo "  -G group     Group to use"
    
    11 14
         echo "  -O owner     Owner to use"
    
    ... ... @@ -21,9 +24,11 @@ usage() {
    21 24
     }
    
    22 25
         
    
    23 26
     GTAR=tar
    
    24
    -while getopts "G:O:I:M:t:h?" arg
    
    27
    +while getopts "C:E:G:O:I:M:t:h?" arg
    
    25 28
     do
    
    26 29
         case $arg in
    
    30
    +	C) COMPRESS=$OPTARG ;;
    
    31
    +	E) COMPRESS_EXT=$OPTARG ;;
    
    27 32
     	G) GROUP="-g $OPTARG" ;;
    
    28 33
     	O) OWNER="-o $OPTARG" ;;
    
    29 34
             I) INSTALL_DIR=$OPTARG ;;
    
    ... ... @@ -35,6 +40,17 @@ done
    35 40
     
    
    36 41
     shift `expr $OPTIND - 1`
    
    37 42
     
    
    43
    +# -C and -E options are required
    
    44
    +if [ -z "$COMPRESS" ]; then
    
    45
    +    echo "-C option is required"
    
    46
    +    exit 2
    
    47
    +fi
    
    48
    +
    
    49
    +if [ -z "$COMPRESS_EXT" ]; then
    
    50
    +    echo "-E option is required"
    
    51
    +    exit 2
    
    52
    +fi
    
    53
    +
    
    38 54
     if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ]
    
    39 55
     then
    
    40 56
         usage
    

  • bin/make-src-dist.sh
    1 1
     #!/bin/sh
    
    2 2
     
    
    3 3
     usage() {
    
    4
    -    echo "make-src-dist.sh: [-bgh] [-t gnutar] [-I destdir] version"
    
    4
    +    echo "make-src-dist.sh: -C option -E ext [-h?] [-t gnutar] [-I destdir] [version]"
    
    5 5
         echo "  -h           This help"
    
    6
    -    echo "  -b           Use bzip2 compression"
    
    7
    -    echo "  -g           Use gzip compression"
    
    6
    +    echo "  -?           This help"
    
    8 7
         echo "  -t tar       Name/path to GNU tar"
    
    8
    +    echo "  -C option    Tar option for compressing the tarball; required."
    
    9
    +    echo "  -E ext       Extension to use for the tarball.  Must be consistent with"
    
    10
    +    echo "                 -C option.  Required."
    
    9 11
         echo "  -I destdir   Install directly to given directory instead of creating a tarball"
    
    12
    +    echo "   version     The version.  Defaults to the current date"
    
    10 13
         echo ""
    
    11
    -    echo 'Create a tar ball of the cmucl sources.  The tarball is named '
    
    12
    -    echo 'cmucl-src-$version.tar.bz2  (or gz if using gzip compression)'
    
    14
    +    echo "This is generally called by make-dist.sh and not normally invoked by the user"
    
    15
    +    echo ""
    
    16
    +    echo "Create a tar ball of the cmucl sources."
    
    13 17
     }
    
    14 18
     
    
    15
    -while getopts "bgh?t:I:" arg
    
    19
    +while getopts "C:E:h?t:I:" arg
    
    16 20
     do
    
    17 21
         case $arg in
    
    18
    -	b) ENABLE_BZIP=-b ;;
    
    19
    -	g) ENABLE_GZIP=-g  ;;
    
    22
    +	C) COMPRESS=$OPTARG ;;
    
    23
    +	E) COMPRESS_EXT=$OPTARG ;;
    
    20 24
             t) GTAR=$OPTARG ;;
    
    21 25
             I) INSTALL_DIR=$OPTARG ;;
    
    22 26
     	h | \?) usage; exit 1 ;;
    
    ... ... @@ -25,10 +29,15 @@ done
    25 29
     
    
    26 30
     shift `expr $OPTIND - 1`
    
    27 31
     
    
    28
    -# If no compression given, default to gzip (on the assumption that
    
    29
    -# that is available everywhere.)
    
    30
    -if [ -z "$ENABLE_BZIP" -a -z "$ENABLE_GZIP" ]; then
    
    31
    -    ENABLE_GZIP=-b
    
    32
    +# -C and -E options are required
    
    33
    +if [ -z "$COMPRESS" ]; then
    
    34
    +    echo "-C option is required"
    
    35
    +    exit 2
    
    36
    +fi
    
    37
    +
    
    38
    +if [ -z "$COMPRESS_EXT" ]; then
    
    39
    +    echo "-E option is required"
    
    40
    +    exit 2
    
    32 41
     fi
    
    33 42
     
    
    34 43
     # If no version is given, default to today's date
    
    ... ... @@ -39,15 +48,6 @@ else
    39 48
     fi
    
    40 49
     
    
    41 50
     echo Creating source distribution
    
    42
    -if [ -n "$ENABLE_GZIP" ]; then
    
    43
    -    ZIP="gzip -c"
    
    44
    -    ZIPEXT="gz"
    
    45
    -fi
    
    46
    -if [ -n "$ENABLE_BZIP" ]; then
    
    47
    -    ZIP="bzip2"
    
    48
    -    ZIPEXT="bz2"
    
    49
    -fi
    
    50
    -
    
    51 51
     GTAR_OPTIONS="--exclude=.git --exclude='*.pot.~*~'"
    
    52 52
     if [ -z "$INSTALL_DIR" ]; then
    
    53 53
         # echo "  Compressing with $ZIP"