update-{all,packages} build profile action: empty packages dir

... before copying the new contents to the image. This caters to the
typical use case of updating an existing Haiku, making manual
intervention to get the new packages activated unnecessary. The downside
is that manually added packages will be removed as well.
This commit is contained in:
Ingo Weinhold 2013-10-05 22:28:59 +02:00
parent 7076d5bb2b
commit 50ffb21291
2 changed files with 13 additions and 0 deletions

View File

@ -840,6 +840,9 @@ rule AddPackagesAndRepositoryVariablesToContainerScript script : container
AddVariableToScript $(script) : resolvePackageDependencies
: $(resolvePackageDependencies) ;
AddVariableToScript $(script) : updateAllPackages
: $(HAIKU_UPDATE_ALL_PACKAGES) ;
# Add variable "systemPackages" with the packages copied/updated.
local allPackages = [ on $(container) return $(HAIKU_PACKAGES_IN_IMAGE) ] ;
if $(updateOnly) && ! [ IncludeAllTargetsInContainer $(container) ] {

View File

@ -16,6 +16,7 @@ set -o errexit
# imageSize
# imageLabel
# resolvePackageDependencies
# updateAllPackages
# updateOnly
# dontClearImage
# isVMwareImage
@ -269,6 +270,15 @@ if [ $isImage ]; then
$cd .
fi
# Clean out the old packages directory, if updating all packages.
if [ -n "$updateAllPackages" ]; then
echo "Removing old packages ..."
$rm -rf "${tPrefix}system/packages"
$mkdir -p "${tPrefix}system/packages"
fi
echo "Populating image ..."
while [ $# -gt 0 ]; do
. $1