diskimage-builder/elements/package-installs/install.d/99-package-uninstalls
James Slagle 7f9ebf2632 Support declarative package installs/uninstalls
Adds a new element, package-installs, that provides an interface for
declarative package installs and uninstalls. Packages to install can be
added to an install.d/package-installs-<element-name> file. The set of
packages listed across such files are installed in a single transaction
at the beginning of install.d.

Prefacing the package name with a "-" indicates that the package should
be uninstalled at the end of the install.d phase. Again, the full set of
uninstalls are done in a single transaction.

An element providing a package-installs file should add package-installs
to its element-deps file.

Change-Id: I5b540388eff1079c8dee933b869463371481152b
2014-05-01 08:47:14 -04:00

19 lines
345 B
Bash
Executable File

#!/bin/bash
set -eux
set -o pipefail
PACKAGES=
for PACKAGEFILE in $(find $(dirname $0) -maxdepth 1 -name "package-installs-*" ); do
while read pkg; do
if [ ! ${pkg:0:1} = "-" ]; then
continue
fi
pkg=${pkg:1}
PACKAGES="$PACKAGES $pkg"
done < $PACKAGEFILE
done
install-packages -e $PACKAGES