From 3d0a1b5453d54fe09f2158fe4b0506349fea6602 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Mon, 21 Feb 2022 01:50:37 +0000 Subject: [PATCH] Revert localiso feature Mixing an option parser with the existing argv/arvc style parser creates a confusing set of conditionals with large if/then inside a case statement. On reflection, I don't think this feature has a place in quickget. For anyone with existing iso image, quickemu configurations can be hand crafted. Perhaps the additional of a "quickconf" would be a better way to quickly create VM configs from existing ISO images. --- quickget | 122 +++++-------------------------------------------------- 1 file changed, 10 insertions(+), 112 deletions(-) diff --git a/quickget b/quickget index 3341a20..f930b4c 100755 --- a/quickget +++ b/quickget @@ -534,41 +534,9 @@ function check_hash() { fi } -function copy_local(){ - case $OS in - windows) - echo "${OS} not (yet?) supported for local isos" ;; - macos) - # echo "${OS} not (yet?) supported for local isos" ;; - if [ -n "${ISODIR}" ]; then - for macfile in RecoveryImage.dmg RecoveryImage.chunklist - do - find "${ISODIR}" -type f -name "${macfile}" -exec cp -pv \{\} "$DIR"/ \; - done - fi;; - *) - if [ -n "${ISODIR}" ]; then - # use supplied filename or default to original distro ISO name - if [ -z "${LOCALISO}" ]; then - LOCALISO=${FILE} - fi - LOCALFILE=$(find "${ISODIR}" -type f -name "${LOCALISO}" -print -quit ) - if [ -f "${DIR}/${FILE}" ]; then - echo "ERROR! File Exists - not copying over local file" - echo "Move it out of the way to replace it with a local file" - exit 1 - else - cp -pv "${LOCALFILE}" "${DIR}"/"${FILE}" - # if ! ; then echo ERROR! Failed to copy ${LOCALFILE}" to ${DIR}/${FILE}" - fi - fi - esac -} - function web_get() { local DIR="${2}" local FILE="" - local LOCALFILE="" local URL="${1}" if [ -n "${3}" ]; then @@ -582,14 +550,6 @@ function web_get() { exit 1 fi - if [ -n "${LOCALISO}" ] || [ -n "${ISODIR}" ] ; then - copy_local - # you only get one shot - LOCALISO="" - ISODIR="" - fi - - if command -v aria2c > /dev/null; then if ! aria2c -x16 --continue=true --summary-interval=0 --download-result=hide --console-log-level=error "${URL}" -o "${DIR}/${FILE}"; then echo #Necessary as aria2c in suppressed mode does not have new lines @@ -608,7 +568,6 @@ function web_get() { function zsync_get() { local DIR="${2}" local FILE="" - local LOCALFILE="" local OUT="" local URL="${1}" FILE="${URL##*/}" @@ -628,13 +587,6 @@ function zsync_get() { exit 1 fi - if [ -n "${LOCALISO}" ] || [ -n "${ISODIR}" ] ; then - copy_local - # you only get one shot - LOCALISO="" - ISODIR="" - fi - if ! zsync "${URL}.zsync" -i "${DIR}/${OUT}" -o "${DIR}/${OUT}" 2>/dev/null; then echo "ERROR! Failed to download ${URL}.zsync" exit 1 @@ -1923,25 +1875,7 @@ function get_windows() { esac make_vm_config "${FILE_NAME}" "virtio-win.iso" } -function usage() { - echo - echo "Usage" - echo " $0 [--isodir] [--localiso] [--list | --json] (