Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

4 changed files:

Changes:

  • bin/make-dist.sh
    ... ... @@ -12,10 +12,10 @@
    12 12
     # $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/tools/make-dist.sh,v 1.20 2011/04/11 16:34:49 rtoy Exp $
    
    13 13
     
    
    14 14
     usage() {
    
    15
    -    echo "make-dist.sh: [-hbg] [-G group] [-O owner] [-I destdir] [-M mandir] [-A arch] [-V version] [-o OS] dir"
    
    15
    +    echo "make-dist.sh: [-h] [-C compress] [-G group] [-O owner] [-I destdir] [-M mandir] [-A arch] [-V version] [-o OS] dir"
    
    16 16
         echo "  -h           This help"
    
    17
    -    echo "  -b           Use bzip2 compression"
    
    18
    -    echo "  -g           Use gzip compression"
    
    17
    +    echo "  -C compress  Compression method to use for the tar archives.  Must be one of"
    
    18
    +    echo "                 bzip2, xz, or gzip.  The default depends on the OS"
    
    19 19
         echo "  -G group     Group to use"
    
    20 20
         echo "  -O owner     Owner to use"
    
    21 21
         echo "  -I destdir   Install directly to given directory instead of creating a tarball"
    
    ... ... @@ -109,15 +109,20 @@ if expr "X${GIT_HASH}" : 'X[0-9][0-9][a-f]' > /dev/null; then
    109 109
         DEFAULT_VERSION="${GIT_HASH}"
    
    110 110
     fi
    
    111 111
     
    
    112
    -while getopts "G:O:I:M:bghSA:o:V:?" arg
    
    112
    +# Default compression is -J (xz).  These variables are passed to the
    
    113
    +# other scripts via the environmen, so export them.
    
    114
    +COMPRESS=-J
    
    115
    +COMPRESS_EXT=xz
    
    116
    +COMPRESS_NAME=xz
    
    117
    +
    
    118
    +while getopts "C:G:O:I:M:hSA:o:V:?" arg
    
    113 119
     do
    
    114 120
         case $arg in
    
    121
    +	C) COMPRESS_ARG=$OPTARG ;;
    
    115 122
     	G) GROUP=$OPTARG ;;
    
    116 123
     	O) OWNER=$OPTARG ;;
    
    117 124
             I) INSTALL_DIR=$OPTARG ;;
    
    118 125
             M) MANDIR=$OPTARG ;;
    
    119
    -	b) ENABLE_BZIP=-b ;;
    
    120
    -	g) ENABLE_GZIP=-g  ;;
    
    121 126
             S) MAKE_SRC_DIST=yes ;;
    
    122 127
             A) ARCH=$OPTARG ;;
    
    123 128
             o) OS=$OPTARG ;;
    
    ... ... @@ -133,6 +138,27 @@ if [ $# -lt 1 ]; then
    133 138
         usage
    
    134 139
     fi
    
    135 140
     
    
    141
    +# Verify that the -C option is valid
    
    142
    +if [ -n "$COMPRESS_ARG" ]; then
    
    143
    +    case $COMPRESS_ARG in
    
    144
    +	bzip2)
    
    145
    +	    COMPRESS=-j
    
    146
    +	    COMPRESS_EXT=bz2
    
    147
    +	    COMPRESS_NAME=bzip2
    
    148
    +	    ;;
    
    149
    +	xz) # Defaults work
    
    150
    +	    ;;
    
    151
    +	gzip)
    
    152
    +	    COMPRESS=-z
    
    153
    +	    COMPRESS_EXT=gz
    
    154
    +	    COMPRESS_NAME=gzip
    
    155
    +	    ;;
    
    156
    +	*) echo '-C option "'$COMPRESS_ARG'" must be one of bzip2, xz or gzip'
    
    157
    +	   exit 1
    
    158
    +	   ;;
    
    159
    +    esac
    
    160
    +fi
    
    161
    +
    
    136 162
     if [ -z "$VERSION" ]; then
    
    137 163
         # If a default version exists, use it. Otherwise this is an
    
    138 164
         # error---at least one of these must not be empty.
    
    ... ... @@ -171,21 +197,17 @@ fi
    171 197
     echo cmucl-$VERSION-$ARCH-$OS
    
    172 198
     ROOT=`dirname $0`
    
    173 199
     
    
    174
    -# If no compression options given, default to bzip
    
    175
    -if [ -z "$ENABLE_GZIP" -a -z "$ENABLE_BZIP" ]; then
    
    176
    -    ENABLE_BZIP="-b"
    
    177
    -fi
    
    178
    -
    
    179
    -OPTIONS="${GROUP:+ -G ${GROUP}} ${OWNER:+ -O ${OWNER}} ${INSTALL_DIR:+ -I ${INSTALL_DIR}} $ENABLE_GZIP $ENABLE_BZIP"
    
    200
    +GTAR_OPTS="-t ${GTAR:-tar}"
    
    201
    +EXTRA_OPTS="${GROUP:+ -G ${GROUP}} ${OWNER:+ -O ${OWNER}}"
    
    202
    +INSTALL_OPTS="${INSTALL_DIR:+ -I ${INSTALL_DIR}}"
    
    180 203
     MANDIR="${MANDIR:+ -M ${MANDIR}}"
    
    204
    +OPTIONS="${GTAR_OPTS} ${EXTRA_OPTS} ${INSTALL_OPTS} ${MANDIR}"
    
    181 205
     
    
    206
    +set -x
    
    182 207
     echo Creating distribution for $ARCH $OS
    
    183
    -$ROOT/make-main-dist.sh $OPTIONS ${MANDIR} $TARGET $VERSION $ARCH $OS || exit 1
    
    184
    -$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
    
    185 210
     
    
    186 211
     if [ X"$MAKE_SRC_DIST" = "Xyes" ]; then
    
    187
    -    # If tar is not GNU tar, set the environment variable GTAR to
    
    188
    -    # point to GNU tar.
    
    189
    -    OPTIONS="${INSTALL_DIR:+ -I ${INSTALL_DIR}} $ENABLE_GZIP $ENABLE_BZIP"
    
    190
    -    $ROOT/make-src-dist.sh $OPTIONS -t ${GTAR:-tar} $VERSION
    
    212
    +    $ROOT/make-src-dist.sh -C $COMPRESS -E $COMPRESS_EXT ${GTAR_OPTS} ${INSTALL_OPTS} $VERSION
    
    191 213
     fi

  • bin/make-extra-dist.sh
    1 1
     #!/bin/sh
    
    2 2
     
    
    3
    -while getopts "G:O:I:bgh?" arg
    
    3
    +usage() {
    
    4
    +    cat <<EOF
    
    5
    +`basename $0` -C option -E ext [-t tar] [-I destdir] [-G group] [-O owner]
    
    6
    +  -h           This help
    
    7
    +  -?           This help
    
    8
    +  -t tar       Tar program to use
    
    9
    +  -C option    Tar option for compressing the tarball; required.
    
    10
    +  -E ext       Extension to use for the tarball.  Must be consistent with
    
    11
    +                 -C option.  Required.
    
    12
    +  -I destdir   Install directly to given directory instead of creating a tarball
    
    13
    +  -G group     Group to use
    
    14
    +  -O owner     Owner to use
    
    15
    +
    
    16
    +This is generally called by make-dist.sh and not normally invoked by the user
    
    17
    +
    
    18
    +Create a tarball of the extra components for cmucl.  This includes things like 
    
    19
    +CLX; Hemlock; CLM; contrib library not already included in the main
    
    20
    +distribution; locale messages.
    
    21
    +EOF
    
    22
    +    exit 1
    
    23
    +}
    
    24
    +
    
    25
    +GTAR=tar
    
    26
    +while getopts "C:E:G:O:I:t:h?" arg
    
    4 27
     do
    
    5 28
         case $arg in
    
    29
    +	C) COMPRESS=$OPTARG ;;
    
    30
    +	E) COMPRESS_EXT=$OPTARG ;;
    
    6 31
     	G) GROUP="-g $OPTARG" ;;
    
    7 32
     	O) OWNER="-o $OPTARG" ;;
    
    8 33
             I) INSTALL_DIR=$OPTARG ;;
    
    9
    -	b) ENABLE_BZIP=-b ;;
    
    10
    -	g) ENABLE_GZIP=-g  ;;
    
    34
    +	t) GTAR=$OPTARG ;;
    
    11 35
     	h | \?) usage; exit 1 ;;
    
    12 36
         esac
    
    13 37
     done
    
    14 38
     
    
    15 39
     shift `expr $OPTIND - 1`
    
    16 40
     
    
    41
    +# -C and -E options are required
    
    42
    +if [ -z "$COMPRESS" ]; then
    
    43
    +    echo "-C option is required"
    
    44
    +    exit 2
    
    45
    +fi
    
    46
    +
    
    47
    +if [ -z "$COMPRESS_EXT" ]; then
    
    48
    +    echo "-E option is required"
    
    49
    +    exit 2
    
    50
    +fi
    
    51
    +
    
    17 52
     if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ]
    
    18 53
     then
    
    19
    -	echo "Usage: $0 target-directory version arch os"
    
    20
    -	exit 1
    
    54
    +    usage
    
    21 55
     fi
    
    22 56
     
    
    23 57
     if [ ! -d "$1" ]
    
    ... ... @@ -134,16 +168,7 @@ done
    134 168
     if [ -z "$INSTALL_DIR" ]; then
    
    135 169
         sync ; sleep 1 ; sync ; sleep 1 ; sync
    
    136 170
         echo Tarring extra components
    
    137
    -    if [ -n "$ENABLE_GZIP" ]; then
    
    138
    -	echo "  Compressing with gzip"
    
    139
    -	( cd $DESTDIR >/dev/null ; tar cf - lib ) | \
    
    140
    -	 gzip -c > cmucl-$VERSION-$ARCH-$OS.extra.tar.gz
    
    141
    -    fi
    
    142
    -    if [ -n "$ENABLE_BZIP" ]; then
    
    143
    -	echo "  Compressing with bzip"
    
    144
    -	( cd $DESTDIR >/dev/null ; tar cf - lib ) | \
    
    145
    -	 bzip2 > cmucl-$VERSION-$ARCH-$OS.extra.tar.bz2
    
    146
    -    fi
    
    171
    +    $GTAR -C $DESTDIR $COMPRESS -cf cmucl-$VERSION-$ARCH-$OS.extra.tar.$COMPRESS_EXT lib
    
    147 172
     
    
    148 173
         echo Cleaning $DESTDIR
    
    149 174
         [ -d $DESTDIR ] && rm -rf $DESTDIR
    

  • bin/make-main-dist.sh
    1 1
     #!/bin/sh
    
    2 2
     
    
    3
    -# set -x
    
    4
    -while getopts "G:O:I:M:bgh?" arg
    
    3
    +usage() {
    
    4
    +    cat <<EOF
    
    5
    +`basename $0`  -C option -E ext [-h?] [-t tar][-I destdir] [-G group] [-O owner] [-M mandir]
    
    6
    +        target-directory version arch os
    
    7
    +  -h           This help
    
    8
    +  -?           This help
    
    9
    +  -t tar       Tar program to use
    
    10
    +  -C option    Tar option for compressing the tarball; required.
    
    11
    +  -E ext       Extension to use for the tarball.  Must be consistent with
    
    12
    +                 -C option.  Required.
    
    13
    +  -I destdir   Install directly to given directory instead of creating a tarball
    
    14
    +  -G group     Group to use
    
    15
    +  -O owner     Owner to use
    
    16
    +  -M mandir    Install manpages in this subdirectory.  Default is man/man1
    
    17
    +
    
    18
    +This is generally called by make-dist.sh and not normally invoked by the user
    
    19
    +
    
    20
    +Create a tarball consisting of the main components needed to distribute
    
    21
    +a binary installation of cmucl.  This includes the C executable and support
    
    22
    +libraries; the subsystems like Gray streams, and simple streams; external
    
    23
    +formats; contribs like asdf and defsystem; manpages and READMEs."
    
    24
    +EOF
    
    25
    +    exit 1
    
    26
    +}
    
    27
    +    
    
    28
    +GTAR=tar
    
    29
    +while getopts "C:E:G:O:I:M:t:h?" arg
    
    5 30
     do
    
    6 31
         case $arg in
    
    32
    +	C) COMPRESS=$OPTARG ;;
    
    33
    +	E) COMPRESS_EXT=$OPTARG ;;
    
    7 34
     	G) GROUP="-g $OPTARG" ;;
    
    8 35
     	O) OWNER="-o $OPTARG" ;;
    
    9 36
             I) INSTALL_DIR=$OPTARG ;;
    
    10 37
             M) MANDIR=$OPTARG ;;
    
    11
    -	b) ENABLE_BZIP=-b ;;
    
    12
    -	g) ENABLE_GZIP=-g  ;;
    
    38
    +	t) GTAR=$OPTARG ;;
    
    13 39
     	h | \?) usage; exit 1 ;;
    
    14 40
         esac
    
    15 41
     done
    
    16 42
     
    
    17 43
     shift `expr $OPTIND - 1`
    
    18 44
     
    
    45
    +# -C and -E options are required
    
    46
    +if [ -z "$COMPRESS" ]; then
    
    47
    +    echo "-C option is required"
    
    48
    +    exit 2
    
    49
    +fi
    
    50
    +
    
    51
    +if [ -z "$COMPRESS_EXT" ]; then
    
    52
    +    echo "-E option is required"
    
    53
    +    exit 2
    
    54
    +fi
    
    55
    +
    
    19 56
     if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ]
    
    20 57
     then
    
    21
    -	echo "Usage: $0 target-directory version arch os"
    
    22
    -	exit 1
    
    58
    +    usage
    
    23 59
     fi
    
    24 60
     
    
    25 61
     if [ ! -d "$1" ]
    
    ... ... @@ -178,16 +214,7 @@ fi
    178 214
     if [ -z "$INSTALL_DIR" ]; then
    
    179 215
         sync ; sleep 1 ; sync ; sleep 1 ; sync
    
    180 216
         echo Tarring main components
    
    181
    -    if [ -n "$ENABLE_GZIP" ]; then
    
    182
    -	echo "  Compressing with gzip"
    
    183
    -	( cd $DESTDIR >/dev/null ; tar cf - . ) | \
    
    184
    -	  gzip -c > cmucl-$VERSION-$ARCH-$OS.tar.gz
    
    185
    -    fi
    
    186
    -    if [ -n "$ENABLE_BZIP" ]; then
    
    187
    -	echo "  Compressing with bzip"
    
    188
    -	( cd $DESTDIR >/dev/null ; tar cf - . ) | \
    
    189
    -	  bzip2 > cmucl-$VERSION-$ARCH-$OS.tar.bz2
    
    190
    -    fi
    
    217
    +    $GTAR -C $DESTDIR $COMPRESS -cf cmucl-$VERSION-$ARCH-$OS.tar.$COMPRESS_EXT .
    
    191 218
     
    
    192 219
         echo Cleaning $DESTDIR
    
    193 220
         [ -d $DESTDIR ] && rm -rf $DESTDIR
    

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