Further logging, finding pkg only return files

Important change, when we use `find` to locate pkgs. Now only files will be returned.
This commit is contained in:
Søren Theilgaard
2022-02-07 16:32:23 +01:00
parent c238f94a9b
commit ae3f711738
2 changed files with 9 additions and 3 deletions

View File

@@ -400,6 +400,7 @@ installAppWithPath() { # $1: path to app to install in $targetDir
# verify with spctl
printlog "Verifying: $appPath" INFO
printlog "App size: $(du -sh "$appPath")" DEBUG
appVerify=$(spctl -a -vv "$appPath" 2>&1 )
appVerifyStatus=$(echo $?)
teamID=$(echo $appVerify | awk '/origin=/ {print $NF }' | tr -d '()' )
@@ -537,7 +538,8 @@ installFromDMG() {
installFromPKG() {
# verify with spctl
printlog "Verifying: $archiveName"
printlog "File list: $(ls -lh "$archiveName")" DEBUG
printlog "File type: $(file "$archiveName")" DEBUG
spctlOut=$(spctl -a -vv -t install "$archiveName" 2>&1 )
spctlStatus=$(echo $?)
printlog "spctlOut is $spctlOut" DEBUG
@@ -656,7 +658,7 @@ installPkgInDmg() {
# locate pkg in dmg
if [[ -z $pkgName ]]; then
# find first file ending with 'pkg'
findfiles=$(find "$dmgmount" -iname "*.pkg" -maxdepth 1 )
findfiles=$(find "$dmgmount" -iname "*.pkg" -type f -maxdepth 1 )
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 20 "couldn't find pkg in dmg $archiveName" ERROR
@@ -691,7 +693,7 @@ installPkgInZip() {
# locate pkg in zip
if [[ -z $pkgName ]]; then
# find first file ending with 'pkg'
findfiles=$(find "$tmpDir" -iname "*.pkg" -maxdepth 2 )
findfiles=$(find "$tmpDir" -iname "*.pkg" -type f -maxdepth 2 )
filearray=( ${(f)findfiles} )
if [[ ${#filearray} -eq 0 ]]; then
cleanupAndExit 20 "couldn't find pkg in zip $archiveName" ERROR

View File

@@ -207,8 +207,12 @@ else
displaynotification "$message" "Error installing $name" ERROR
fi
fi
printlog "File list: $(ls -lh "$archiveName")" ERROR
printlog "File type: $(file "$archiveName")" ERROR
cleanupAndExit 2 "Error downloading $downloadURL error:\n$logoutput" ERROR
fi
printlog "File list: $(ls -lh "$archiveName")" DEBUG
printlog "File type: $(file "$archiveName")" DEBUG
printlog "curl output was:\n$logoutput" DEBUG
fi