From 0b1bf16e7e111b6d0a6c78b5873b2cf0d1ffb229 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 4 Feb 2024 16:58:34 +0100 Subject: [PATCH] Update install.sh --- src/install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/install.sh b/src/install.sh index b4c0aa8..495b423 100644 --- a/src/install.sh +++ b/src/install.sh @@ -384,7 +384,6 @@ getESD() { rm -rf "$dir" mkdir -p "$dir" - rm -f "$file" space=$(df --output=avail -B 1 "$dir" | tail -n 1) space_gb=$(( (space + 1073741823)/1073741824 )) @@ -419,16 +418,16 @@ getESD() { local edQuery='//File[Architecture="'${architecture}'"][Edition="'${editionName}'"]' echo -e '' > "${dir}/products_filter.xml" - xpath -q -n -e "${edQuery}" "${dir}/products.xml" >> "${dir}/products_filter.xml" 2>/dev/null + xmllint --nonet --xpath "${edQuery}" "${dir}/products.xml" >> "${dir}/products_filter.xml" 2>/dev/null echo -e ''>> "${dir}/products_filter.xml" - xpath -q -n -e '//File[LanguageCode="'${esdLang}'"]' "${dir}/products_filter.xml" >"${dir}/esd_edition.xml" + xmllint --nonet --xpath '//File[LanguageCode="'${esdLang}'"]' "${dir}/products_filter.xml" >"${dir}/esd_edition.xml" size=$(stat -c%s "${dir}/esd_edition.xml") if ((size<20)); then - error "Invalid esd_edition.xml file!" && return 1 + error "Failed to find Windows product!" && return 1 fi - ESD_URL=$(xpath -n -q -e '//FilePath' "${dir}/esd_edition.xml" | sed -E -e 's/<[\/]?FilePath>//g') + ESD_URL=$(xmllint --nonet --xpath '//FilePath' "${dir}/esd_edition.xml" | sed -E -e 's/<[\/]?FilePath>//g') if [ -z "$ESD_URL" ]; then error "Failed to find ESD url!" && return 1 @@ -490,6 +489,7 @@ downloadImage() { ISO="$TMP/$VERSION.esd" file="$ISO" + rm -f "$file" /run/progress.sh "$file" "Downloading $desc ([P])..." &