New way to build packages

Looks like xar command line is removed in 10.15.4 so we let pkgutil do the job for us.
pkgutil knows what to do and which compression needs to be used.
This commit is contained in:
vectorsigma72 2020-02-12 15:59:13 +01:00
parent 142c24821d
commit 2ce587e7c1
2 changed files with 5 additions and 5 deletions

View File

@ -1591,10 +1591,9 @@ buildpackage ()
header+="\t\t<${script##*/} file=\"./${script##*/}\"/>\n" header+="\t\t<${script##*/} file=\"./${script##*/}\"/>\n"
done done
header+="\t</scripts>\n" header+="\t</scripts>\n"
# Create the Script archive file (cpio format) # Copy Scripts with out compression as We are going to use pkgutil
(cd "${packagePath}/Scripts" && find . -print | \ # ..that will do it for Us .. and with the correct compression format :-)
cpio -o -z -R root:wheel --format cpio > "${packagePath}/Temp/Scripts") 2>&1 | \ cp -R "${packagePath}/Scripts" "${packagePath}/Temp/"
grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages
fi fi
header+="</pkg-info>" header+="</pkg-info>"
@ -1606,7 +1605,8 @@ buildpackage ()
grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages grep -vE '^[0-9]+\s+blocks?$' # to remove cpio stderr messages
# Create the package # Create the package
(cd "${packagePath}/Temp" && xar -c -f "${packagePath}/../${packageName}.pkg" --compression none .) # (cd "${packagePath}/Temp" && xar -c -f "${packagePath}/../${packageName}.pkg" --compression none .)
(pkgutil --flatten "${packagePath}/Temp" "${packagePath}/../${packageName}.pkg")
# Add the package to the list of build packages # Add the package to the list of build packages
pkgrefs[${#pkgrefs[*]}]="\t<pkg-ref id=\"${packageRefId}\" installKBytes='${installedsize}' version='${CLOVER_VERSION}.0.0.${CLOVER_TIMESTAMP}'>#${packageName}.pkg</pkg-ref>" pkgrefs[${#pkgrefs[*]}]="\t<pkg-ref id=\"${packageRefId}\" installKBytes='${installedsize}' version='${CLOVER_VERSION}.0.0.${CLOVER_TIMESTAMP}'>#${packageName}.pkg</pkg-ref>"

Binary file not shown.