Add ability to blacklist packages from chromeos-base/chromeos.

Change-Id: I05370137dbe9f9adc7b18f2ff77d1b7680275c37

BUG=7973
TEST=Ran with/without current blacklist file.  Also, added chromeos-base/chromeos-chrome
to test it actually dies correctly.

Review URL: http://codereview.chromium.org/4005002
This commit is contained in:
Chris Sosa 2010-10-20 16:04:23 -07:00
parent 4f7f855728
commit e38f90f309
3 changed files with 27 additions and 3 deletions

View File

@ -97,6 +97,25 @@ if [ -z "${FLAGS_board}" ] ; then
exit 1
fi
check_blacklist() {
info "Verifying that the base image does not contain a blacklisted package."
info "Generating list of packages for chromeos-base/chromeos."
local package_blacklist_file="${SCRIPTS_DIR}/chromeos_blacklist"
if [ ! -e "${package_blacklist_file}" ]; then
warn "Missing blacklist file."
return
fi
local blacklisted_packages=$(${SCRIPTS_DIR}/get_package_list \
--board="${FLAGS_board}" chromeos-base/chromeos \
| grep -x -f "${package_blacklist_file}")
if [ -n "${blacklisted_packages}" ]; then
die "Blacklisted packages found: ${blacklisted_packages}."
fi
info "No blacklisted packages found."
}
check_blacklist
# Verify user didn't specify incompatible flags for dev install shim
if [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ] &&
[ "${FLAGS_dev_install}" -eq "${FLAGS_TRUE}" ] ; then

3
chromeos_blacklist Normal file
View File

@ -0,0 +1,3 @@
dev-lang/python
dev-java/icedtea
dev-java/icedtea6-bin

View File

@ -20,11 +20,13 @@ DEFINE_string board "$DEFAULT_BOARD" \
# Parse flags.
FLAGS "$@" || exit 1
eval set -- "${FLAGS_ARGV}"
[[ -z "${FLAGS_board}" ]] && die "A board must be specified."
if [[ -z "${FLAGS_ARGV}" ]]; then
echo "Please specify package."
echo "Usage: ./get_package_list.sh chromeos-base/chromeos > package.list"
exit 1
warn "Please specify package."
die "Usage: ./get_package_list.sh chromeos-base/chromeos > package.list"
fi
emerge-$FLAGS_board --emptytree --usepkgonly -p -v --columns \