55# Written by Dave Dykstra 17 April 2019
66#
77
8- SUPPORTEDTYPES=" rhel7-x86_64 rhel8-aarch64 rhel8-x86_64 rhel8-ppc64le rhel9-x86_64 suse15-x86_64"
8+ SUPPORTEDTYPES=" rhel7-x86_64 rhel8-aarch64 rhel8-x86_64 rhel8-ppc64le rhel9-aarch64 rhel9-x86_64 rhel9-ppc64le suse15-x86_64"
9+
10+ supportedtypes () {
11+ typeset LASTDISTRO=" "
12+ typeset TYPES=" "
13+ typeset TYPE THISDISTRO
14+ for TYPE in $SUPPORTEDTYPES ; do
15+ THISDISTRO=" ${TYPE% -* } "
16+ if [ " $THISDISTRO " != " $LASTDISTRO " ]; then
17+ if [ -n " $TYPES " ]; then
18+ echo " $1 $TYPES " >&2
19+ fi
20+ LASTDISTRO=" $THISDISTRO "
21+ TYPES=" $TYPE "
22+ else
23+ TYPES=" $TYPES $TYPE "
24+ fi
25+ done
26+ echo " $1 $TYPES " >&2
27+ }
928
1029usage ()
1130{
@@ -15,7 +34,7 @@ usage()
1534 echo " The first usage creates a distribution in 'dist' directory."
1635 echo " The -m option selects machinetype for the distribution."
1736 echo " The default is the current machine. Supported types:"
18- echo " $SUPPORTEDTYPES "
37+ supportedtypes " "
1938 echo " The second usage puts 'dist' and cvmfsexec tools into one script with the"
2039 echo " given file name that self extracts and executes cvmfsexec."
2140 echo " After extraction, files are left behind under '.cvmfsexec' in the same"
@@ -84,12 +103,14 @@ DISTRO="`distroname`"
84103VERS=" ` distroversion` "
85104ARCH=" ` distroarch` "
86105
87- MACHTYPE=$DISTRO$VERS -$ARCH
106+ if [ -z " $MACHTYPE " ]; then
107+ MACHTYPE=$DISTRO$VERS -$ARCH
108+ fi
88109
89110if [[ " $SUPPORTEDTYPES " != * " $MACHTYPE " * ]]; then
90111 echo " $MACHTYPE not a supported machine type" >&2
91112 echo " Supported types are:" >&2
92- echo " $SUPPORTEDTYPES " >&2
113+ supportedtypes " " >&2
93114 exit 1
94115fi
95116
@@ -235,6 +256,7 @@ if [ "$ARCH" = "ppc64le" ]; then
235256 fi
236257 CVMFSURL=" $( dirname $CVMFSRPMURL ) "
237258 CVMFSRPMNAME=" $( basename $CVMFSRPMURL ) "
259+ CVMFSVERSION=" ` echo " $CVMFSRPMNAME " ' s/.*cvmfs-\([^-]*\)-.*/\1/' ` "
238260else
239261 # Now that we can figure out the latest cvmfs version, download the
240262 # corresponding cvmfs packages from CERN instead
0 commit comments