cros_mark_all_as_stable: introduce blacklist, set the initial blacklist source as ./

* This allows to block a list of ebuilds from being uprevved by the PFB
* With little modification, there could be a GUI which allows people to manage
a blacklist on the server, with stating the reason
(ex.: autotest-tests - $me, creating the ebuild, unstable for now)

	modified:   cros_mark_all_as_stable

TEST=
1) create a blacklist:
chromeos-base/autotest
chromeos-base/autotest-tests
2) run ./cros_mark_all_as_stable --board=x86-generic
...
INFO   : chromeos-base/autotest blacklisted, skipping
INFO   : chromeos-base/autotest-tests blacklisted, skipping
...

Review URL: http://codereview.chromium.org/3076038
This commit is contained in:
Zdenek Behan 2010-08-06 14:18:32 -07:00
parent 8817081418
commit a203b46c48
2 changed files with 17 additions and 0 deletions

View File

@ -39,11 +39,28 @@ GRAB_HEAD_COMMIT_CMD="git show HEAD | head -1 | cut -f 2 -d ' '"
PACKAGE_LIST="" PACKAGE_LIST=""
# List of commit ids corresponding to package list. # List of commit ids corresponding to package list.
COMMIT_ID_LIST="" COMMIT_ID_LIST=""
# List of IFS-delimited ebuilds to ignore.
PACKAGE_BLACKLIST=""
# File containing the names of blacklisted packages.
BLACKLIST_FILE=$(dirname "${0}")/cros_mark_as_stable_blacklist
[ -f "${BLACKLIST_FILE}" ] && \
PACKAGE_BLACKLIST=$(cat "${BLACKLIST_FILE}")
function package_is_blacklisted() {
# Makes a list that looks like "\|package1\|package2\|...packagen".
local blist_regex=$(for i in ${PACKAGE_BLACKLIST}; do echo -n "\\|${i}"; done)
expr "${1}" : "^\(${blist_regex/\\|/}\)$" &> /dev/null && return 0 || return 1
}
# For each package, compares the head commit id to the commit id in the ebuild. # For each package, compares the head commit id to the commit id in the ebuild.
# If they do not match, add the package and its commit id into ${PACKAGE_LIST} # If they do not match, add the package and its commit id into ${PACKAGE_LIST}
# and ${COMMIT_ID_LIST} # and ${COMMIT_ID_LIST}
for package in ${PACKAGES}; do for package in ${PACKAGES}; do
if package_is_blacklisted ${package}; then
info "${package} blacklisted, skipping"
continue
fi
ebuild_path=$(${EQUERYCMD} which ${package}) || continue ebuild_path=$(${EQUERYCMD} which ${package}) || continue
# Sets ${CROS_WORKON_SRCDIR} from the ebuild. # Sets ${CROS_WORKON_SRCDIR} from the ebuild.
eval $(${EBUILDCMD} ${ebuild_path} info) &> /dev/null || continue eval $(${EBUILDCMD} ${ebuild_path} info) &> /dev/null || continue

View File