Commit 96739d95 authored by Raymond Toy's avatar Raymond Toy
Browse files

Replace version arch os args with switches

The positional version, arch, and os args are now commandline
switches.  This allows the user to specify arch and os names, for
example, without specifying a version.  This allows the version to be
defaulted.  Previously, the version had to be specified if arch or os
were desired.  

The original default values are used if these options aren't given.
parent 2b0b4aaf
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/tools/make-dist.sh,v 1.20 2011/04/11 16:34:49 rtoy Exp $ # $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/tools/make-dist.sh,v 1.20 2011/04/11 16:34:49 rtoy Exp $
usage() { usage() {
echo "make-dist.sh: [-hbg] [-G group] [-O owner] [-I destdir] [-M mandir] dir [version arch os]" echo "make-dist.sh: [-hbg] [-G group] [-O owner] [-I destdir] [-M mandir] [-A arch] [-V version] [-o OS] dir"
echo " -h This help" echo " -h This help"
echo " -b Use bzip2 compression" echo " -b Use bzip2 compression"
echo " -g Use gzip compression" echo " -g Use gzip compression"
...@@ -24,10 +24,10 @@ usage() { ...@@ -24,10 +24,10 @@ usage() {
echo " The compressed tar file is named cmucl-src-<VERSION>.tar.<ext>" echo " The compressed tar file is named cmucl-src-<VERSION>.tar.<ext>"
echo " If -I is also given, the -S means that the sources are " echo " If -I is also given, the -S means that the sources are "
echo " installed in the <destdir>/src" echo " installed in the <destdir>/src"
echo " -A arch Architecture (x86, sparc, ppc, etc.)"
echo " -o OS OS (linux, solaris10, etc.)"
echo " -V version Version (usually date and/or other version info)"
echo " dir Directory where the build is located" echo " dir Directory where the build is located"
echo " version Version (usually date and/or other version info)"
echo " arch Architecture (x86, sparc, etc.)"
echo " os OS (linux, solaris8, etc.)"
echo "" echo ""
echo "If the -I option is given, directly install all of the files to the" echo "If the -I option is given, directly install all of the files to the"
echo "specified directory. Otherwise, Make a CMUCL distribution consisting" echo "specified directory. Otherwise, Make a CMUCL distribution consisting"
...@@ -57,7 +57,7 @@ def_arch_os () { ...@@ -57,7 +57,7 @@ def_arch_os () {
SunOS) SunOS)
case `uname -m` in case `uname -m` in
sun*) sun*)
ARCH=sparcv9 ;; ARCH=sparc ;;
i*) i*)
ARCH=x86 ;; ARCH=x86 ;;
esac esac
...@@ -90,7 +90,21 @@ def_arch_os () { ...@@ -90,7 +90,21 @@ def_arch_os () {
esac esac
} }
while getopts "G:O:I:M:bghS?" arg # Figure out the architecture and OS in case options aren't given
def_arch_os
# Choose a version based on the git hash as the default version.
GIT_HASH="`(cd src; git describe --dirty 2>/dev/null)`"
if expr "X${GIT_HASH}" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]' > /dev/null; then
VERSION=`expr "${GIT_HASH}" : "snapshot-\(.*\)"`
fi
if expr "X${GIT_HASH}" : 'X[0-9][0-9][a-f]' > /dev/null; then
VERSION="${GIT_HASH}"
fi
while getopts "G:O:I:M:bghSA:o:V:?" arg
do do
case $arg in case $arg in
G) GROUP=$OPTARG ;; G) GROUP=$OPTARG ;;
...@@ -100,47 +114,18 @@ do ...@@ -100,47 +114,18 @@ do
b) ENABLE_BZIP=-b ;; b) ENABLE_BZIP=-b ;;
g) ENABLE_GZIP=-g ;; g) ENABLE_GZIP=-g ;;
S) MAKE_SRC_DIST=yes ;; S) MAKE_SRC_DIST=yes ;;
A) ARCH=$OPTARG ;;
o) OS=$OPTARG ;;
V) VERSION=$OPTARG ;;
h | \?) usage; exit 1 ;; h | \?) usage; exit 1 ;;
esac esac
done done
shift `expr $OPTIND - 1` shift `expr $OPTIND - 1`
# Figure out the architecture and OS # Directory is required; exit if not given
ARCH= if [ $# -lt 1 ]; then
OS= usage
# Figure out the architecture and OS
def_arch_os
if [ -n "${INSTALL_DIR}" ]; then
# Doing direct installation
if [ $# -lt 1 ]; then
usage
else
def_arch_os
fi
elif [ $# -lt 2 ]; then
# Version not specified so choose a version based on the git hash.
GIT_HASH="`(cd src; git describe --dirty 2>/dev/null)`"
if expr "X${GIT_HASH}" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]' > /dev/null; then
VERSION=`expr "${GIT_HASH}" : "snapshot-\(.*\)"`
fi
if expr "X${GIT_HASH}" : 'X[0-9][0-9][a-f]' > /dev/null; then
VERSION="${GIT_HASH}"
fi
echo "Defaulting version to $VERSION"
else
VERSION="$2"
if [ $# -eq 3 ]; then
ARCH=$3
elif [ $# -eq 4 ]; then
ARCH=$3
OS=$4
fi
fi fi
if [ ! -d "$1" ] if [ ! -d "$1" ]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment