Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3023)

Unified Diff: cros_mark_all_as_stable

Issue 3076038: cros_mark_all_as_stable: introduce blacklist, set the initial blacklist source as ./ (Closed) Base URL: ssh://gitrw.chromium.org/crosutils
Patch Set: 80 chars Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cros_mark_as_stable_blacklist » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cros_mark_all_as_stable
diff --git a/cros_mark_all_as_stable b/cros_mark_all_as_stable
index 50648236ece08a180311984014d73f934b91cb3e..1cecd4529e1f6d49c052ea9d56ebc10011396d0f 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
« no previous file with comments | « no previous file | cros_mark_as_stable_blacklist » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698