CURLOPT=""
RSYNCOPT=""
+DITTOOPT=""
HDIUTILOPT="-quiet"
# set options
VERBOSE=1
CURLOPT="-v"
RSYNCOPT="-v"
+ DITTOOPT="-V"
HDIUTILOPT="-verbose"
;;
y)
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
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 )
[ -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
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