[Git][cmucl/cmucl][sparc64-dev] Replace version arch os args with switches

Raymond Toy rtoy at common-lisp.net
Tue Dec 27 18:50:21 UTC 2016


Raymond Toy pushed to branch sparc64-dev at cmucl / cmucl


Commits:
2e5a64c1 by Raymond Toy at 2016-12-27T10:50:00-08:00
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.

- - - - -


1 changed file:

- bin/make-dist.sh


Changes:

=====================================
bin/make-dist.sh
=====================================
--- a/bin/make-dist.sh
+++ b/bin/make-dist.sh
@@ -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 $
 
 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 "  -b           Use bzip2 compression"
     echo "  -g           Use gzip compression"
@@ -24,10 +24,10 @@ usage() {
     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 "                 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 "   version     Version (usually date and/or other version info)"
-    echo "   arch        Architecture (x86, sparc, etc.)"
-    echo "   os          OS (linux, solaris8, etc.)"
     echo ""
     echo "If the -I option is given, directly install all of the files to the"
     echo "specified directory.  Otherwise, Make a CMUCL distribution consisting"
@@ -57,7 +57,7 @@ def_arch_os () {
       SunOS)
 	  case `uname -m` in
 	    sun*)
-		ARCH=sparcv9 ;;
+		ARCH=sparc ;;
 	    i*)
 		ARCH=x86 ;;
 	  esac
@@ -90,7 +90,21 @@ def_arch_os () {
       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
     case $arg in
 	G) GROUP=$OPTARG ;;
@@ -100,47 +114,18 @@ do
 	b) ENABLE_BZIP=-b ;;
 	g) ENABLE_GZIP=-g  ;;
         S) MAKE_SRC_DIST=yes ;;
+        A) ARCH=$OPTARG ;;
+        o) OS=$OPTARG ;;
+        V) VERSION=$OPTARG ;;
 	h | \?) usage; exit 1 ;;
     esac
 done
 
 shift `expr $OPTIND - 1`
 
-# Figure out the architecture and OS
-ARCH=
-OS=
-
-# 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
+# Directory is required; exit if not given
+if [ $# -lt 1 ]; then
+    usage
 fi
 
 if [ ! -d "$1" ]



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/2e5a64c10f75627c6479a9fc66330c64611d0f29
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20161227/0b4e9c34/attachment-0001.html>


More information about the cmucl-cvs mailing list