From: Ben Soares Date: Mon, 26 Aug 2024 18:31:43 +0000 (+0100) Subject: JAL-3631 Fix interpolative quotation marks in new grep X-Git-Tag: Release_2_11_4_0~14^2~8^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b28a43feb85d380c9912cf67a80761f2ccd7fa9b;p=jalview.git JAL-3631 Fix interpolative quotation marks in new grep --- diff --git a/utils/install4j/macos-install-jalview.sh b/utils/install4j/macos-install-jalview.sh index 9b40271..4d2d01b 100755 --- a/utils/install4j/macos-install-jalview.sh +++ b/utils/install4j/macos-install-jalview.sh @@ -59,6 +59,7 @@ TMP="/tmp" CURLOPT="" RSYNCOPT="" +DITTOOPT="" HDIUTILOPT="-quiet" # set options @@ -88,6 +89,7 @@ while getopts "hdi:a:vyqu:c:USPR" opt; do VERBOSE=1 CURLOPT="-v" RSYNCOPT="-v" + DITTOOPT="-V" HDIUTILOPT="-verbose" ;; y) @@ -146,15 +148,20 @@ if [ "${DISABLEROOTCHECK}" != 1 -a "${EUID}" != 0 ]; then fi # check channel -case "$CHANNEL" in - release|test-release|develop) - myecho "Using channel ${CHANNEL}" - ;; - *) - echo "-c channel must be one of 'release', 'test-release' or 'develop'" - exit 3 - ;; -esac +if [ ! -z "$DMGFILE" -a -e "$DMGFILE" ]; then + myecho "Using DMG file '${DMGFILE}'" + CHANNEL="dmg" +else + case "$CHANNEL" in + release|test-release|develop) + myecho "Using channel ${CHANNEL}" + ;; + *) + echo "-c channel must be one of 'release', 'test-release' or 'develop'" + exit 3 + ;; + esac +fi # convert uarch to jarch case $UARCH in @@ -225,6 +232,8 @@ myecho "Mounting disk image '${DMGFILE}' on '${VOLUMEDIR}'" hdiutil attach ${HDIUTILOPT} -mountpoint "${VOLUMEDIR}" "${DMGFILE}" [ $? != 0 ] && echo "Could not mount '${DMGFILE}' on mount point '${VOLUMEDIR}'" && exit 9 +myecho "MOUNTED" + # difficult to use a wildcard for a non-user-readable folder without inserting sudo directly into the command # i.e. what I really want to do here is # APP=$( sudo sh -c "ls -1d ${VOLUMEDIR}/Jalview*.app" | head -1 ) @@ -240,12 +249,15 @@ done <<< "$VOLUMEFILES" [ -z "$APP" ] && echo "Could not find Jalview\*.app in the volume '${VOLUMEDIR}'" && exit 10 APPNAME=$( basename "$APP" ) +myecho "Found application '${APP}'" # ensure no trailing slash on APPNAME or APPLICATIONFOLDER (important for rsync) -while [ "${APPLICATIONFOLDER}" != "/" ]; do - APPLICATIONFOLDER=${APPLICATIONFOLDER%/} +while [ "${APPLICATIONFOLDER}" != "${APPLICATIONFOLDER%/}" ]; do + myecho "Removing trailing slash from APPLICATIONFOLDER='${APPLICATIONFOLDER}'" + APPLICATIONFOLDER="${APPLICATIONFOLDER%/}" done while [ "${APPNAME}" != "${APPNAME%/}" ]; do + myecho "Removing trailing slash from APPNAME='${APPNAME}'" APPNAME=${APPNAME%/} done [ -z "$APPNAME" -o "${APPNAME%.app}" = "$APPNAME" ] && echo "Could not find suitable Jalview\*.app in the volume '${VOLUMEDIR}'" && exit 11 @@ -266,7 +278,7 @@ if [ -e "$APPPATH" ]; then fi mv "$APPPATH" "$OLDAPPPATH" fi -ditto "${VOLUMEDIR}/${APPNAME}" "$APPPATH" && [ -e "$OLDAPPPATH" ] && rm -Rf "$OLDAPPPATH" +ditto ${DITTOOPT} "${VOLUMEDIR}/${APPNAME}" "$APPPATH" && [ -e "$OLDAPPPATH" ] && rm -Rf "$OLDAPPPATH" myecho "Finished copying '${APPNAME}'" EXIT=0