From a203b46c482110efdfb2a29cee412712d028f890 Mon Sep 17 00:00:00 2001 From: Zdenek Behan Date: Fri, 6 Aug 2010 14:18:32 -0700 Subject: [PATCH] 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 --- cros_mark_all_as_stable | 17 +++++++++++++++++ cros_mark_as_stable_blacklist | 0 2 files changed, 17 insertions(+) create mode 100644 cros_mark_as_stable_blacklist diff --git a/cros_mark_all_as_stable b/cros_mark_all_as_stable index 50648236ec..1cecd4529e 100755 --- a/cros_mark_all_as_stable +++ b/cros_mark_all_as_stable @@ -39,11 +39,28 @@ GRAB_HEAD_COMMIT_CMD="git show HEAD | head -1 | cut -f 2 -d ' '" PACKAGE_LIST="" # List of commit ids corresponding to package 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. # If they do not match, add the package and its commit id into ${PACKAGE_LIST} # and ${COMMIT_ID_LIST} for package in ${PACKAGES}; do + if package_is_blacklisted ${package}; then + info "${package} blacklisted, skipping" + continue + fi ebuild_path=$(${EQUERYCMD} which ${package}) || continue # Sets ${CROS_WORKON_SRCDIR} from the ebuild. eval $(${EBUILDCMD} ${ebuild_path} info) &> /dev/null || continue diff --git a/cros_mark_as_stable_blacklist b/cros_mark_as_stable_blacklist new file mode 100644 index 0000000000..e69de29bb2