Update functions.sh

This commit is contained in:
Søren Theilgaard
2022-02-09 14:23:32 +01:00
parent 1da37a13ca
commit bf740d1ffe

View File

@@ -668,23 +668,22 @@ installPkgInDmg() {
cleanupAndExit 20 "couldn't find pkg in dmg $archiveName" ERROR cleanupAndExit 20 "couldn't find pkg in dmg $archiveName" ERROR
fi fi
archiveName="${filearray[1]}" archiveName="${filearray[1]}"
printlog "found pkg: $archiveName"
else else
if [[ -s "$tmpDir/$pkgName" ]] ; then if [[ -s "$tmpDir/$pkgName" ]] ; then
archiveName="$tmpDir/$pkgName" archiveName="$tmpDir/$pkgName"
else else
# try searching for pkg # try searching for pkg
findfiles=$(find "$tmpDir" -iname "$pkgName") findfiles=$(find "$dmgmount" -iname "$pkgName") # was: $tmpDir
filearray=( ${(f)findfiles} ) filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 20 "couldn't find pkg “$pkgName” in zip $archiveName" ERROR cleanupAndExit 20 "couldn't find pkg “$pkgName” in dmg $archiveName" ERROR
fi fi
# it is now safe to overwrite archiveName for installFromPKG # it is now safe to overwrite archiveName for installFromPKG
archiveName="${filearray[1]}" archiveName="${filearray[1]}"
printlog "found pkg: $archiveName"
fi fi
fi fi
printlog "found pkg: $archiveName"
# installFromPkgs # installFromPkgs
installFromPKG installFromPKG
} }