build_haiku_image: Distinguish between system (activated) and unactivated packages.

Previously, all packages on the image, both activated and unactivated,
were in $systemPackages, so if a package actually in /system/packages
had a dependency in the Installer optional package area, the dependency
checking would see no problem but the generated image would be broken.

Now, packages going into /system/packages are treated separately
from those going elsewhere, and error checks added so the above
condition will not occur.

(I ran into this while working on the build-package upgrade
in the following commits.)
This commit is contained in:
Augustin Cavalier
2020-04-19 17:53:10 -04:00
parent 5e15819d86
commit dd419e59dc
2 changed files with 40 additions and 9 deletions
+19 -2
View File
@@ -6,7 +6,8 @@ set -o errexit
# outputDir
# tmpDir
# addBuildCompatibilityLibDir
# systemPackages - lists of the hpkg packages copied/updated
# systemPackages - lists of the hpkg packages copied/updated into /system/packages
# otherPackages - lists of the hpkg packages copied/updated into other (optional) places
# repositories - all repository files
# downloadDir
# The following are only for image types:
@@ -305,13 +306,29 @@ if [ -n "$resolvePackageDependencies" ]; then
packageUrls=`$getPackageDependencies $repositories -- $systemPackages`
for packageUrl in $packageUrls; do
packageFileName=`basename $packageUrl`
if [ "$otherPackages" != "${otherPackages#*$packageFileName}" ]; then
echo "ERROR: $packageFileName is a dependency of a package installed in /system/packages," \
"but it is in another (i.e. unactivated) package directory!"
exit 1
fi
packageFilePath="$downloadDir/$packageFileName"
downloadFile $packageUrl "$packageFilePath"
$cp "${sPrefix}$packageFilePath" "${tPrefix}system/packages"
systemPackages="$systemPackages $packageFilePath"
done
fi
# validate dependencies of optional packages
packageUrls=`$getPackageDependencies $repositories -- $systemPackages $otherPackages`
packageFileNames=""
for packageUrl in $packageUrls; do
packageFileNames="$packageFileNames `basename $packageUrl`"
done
if [ ! -z "$packageFileNames" ]; then
echo "ERROR: Some of the unactivated (i.e. optional) packages have the following unmet dependencies:"
echo $packageFileNames
exit 1
fi
fi
# install default settings for packages
for packageFile in $systemPackages; do