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

Unified Diff: cros_workon

Issue 2978002: cros_workon: corner case fixes (Closed) Base URL: ssh://gitrw.chromium.org/crosutils
Patch Set: Created 10 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cros_workon
diff --git a/cros_workon b/cros_workon
index ff4414fc9c3ee930da22dc692f1020d789be4129..fb73f09abd8d936f4ce94c3484dd57a7b8e03229 100755
--- a/cros_workon
+++ b/cros_workon
@@ -101,6 +101,8 @@ ebuild_to_live () {
if ! grep -qx "${atom}" "${KEYWORDS_FILE}" ; then
sudo bash -c "echo \"${atom}\" >> \"${KEYWORDS_FILE}\""
sudo bash -c "echo \"~${atom}-9999\" >> \"${UNMASK_FILE}\""
+ else
+ warn "Already working on ${atom}"
fi
done
}
@@ -110,15 +112,18 @@ ebuild_to_stable () {
local atoms=$1
for atom in ${atoms}; do
- # remove the keyword
- sudo bash -c "grep -v '^${atom}\$' \"${KEYWORDS_FILE}\" > \
- \"${KEYWORDS_FILE}+\""
- sudo mv "${KEYWORDS_FILE}+" "${KEYWORDS_FILE}"
- # remove the unmask
- sudo bash -c "grep -v '^~${atom}-9999\$' \"${UNMASK_FILE}\" > \
- \"${UNMASK_FILE}+\""
- sudo mv "${UNMASK_FILE}+" "${UNMASK_FILE}"
-
+ if grep -qx "${atom}" "${KEYWORDS_FILE}" ; then
+ # remove the keyword
+ sudo bash -c "grep -v '^${atom}\$' \"${KEYWORDS_FILE}\" > \
+ \"${KEYWORDS_FILE}+\""
+ sudo mv "${KEYWORDS_FILE}+" "${KEYWORDS_FILE}"
+ # remove the unmask
+ sudo bash -c "grep -v '^~${atom}-9999\$' \"${UNMASK_FILE}\" > \
+ \"${UNMASK_FILE}+\""
+ sudo mv "${UNMASK_FILE}+" "${UNMASK_FILE}"
+ else
+ warn "Not working on ${atom}"
+ fi
done
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698