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

Unified Diff: cros_workon

Issue 3151039: cros_workon: store cros_workon state outside of /build (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Fixed. 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 | 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 374f15d0e80e8d03b8484abe3ab89f1530c9c076..1a9626b1f661b35ff723042509ff57d8ddc1c09f 100755
--- a/cros_workon
+++ b/cros_workon
@@ -61,20 +61,28 @@ else
EBUILDCMD=ebuild
fi
+WORKON_DIR=${CHROOT_TRUNK_DIR}/.config/cros_workon
KEYWORDS_DIR=${BOARD_DIR}/etc/portage/package.keywords
UNMASK_DIR=${BOARD_DIR}/etc/portage/package.unmask
+WORKON_FILE=${WORKON_DIR}/${FLAGS_board:-host}
KEYWORDS_FILE=${KEYWORDS_DIR}/cros-workon
UNMASK_FILE=${UNMASK_DIR}/cros-workon
-sudo mkdir -p "${KEYWORDS_DIR}" "${UNMASK_DIR}" || \
- die "mkdir -p ${KEYWORDS_DIR} ${UNMASK_DIR}"
+# TODO(msb): remove the backward compatibility after 09/01/2010
+sudo mkdir -p "${WORKON_DIR}" "${KEYWORDS_DIR}" "${UNMASK_DIR}" || \
+ die "mkdir -p ${WORKON_DIR} ${KEYWORDS_DIR} ${UNMASK_DIR}"
if [ ! -L "${KEYWORDS_FILE}" ]; then
sudo rm -f "${KEYWORDS_FILE}"
- sudo ln -s "${UNMASK_FILE}" "${KEYWORDS_FILE}" || \
- die "ln -s ${UNMASK_FILE} ${KEYWORDS_FILE}"
+ sudo ln -s "${WORKON_FILE}" "${KEYWORDS_FILE}" || \
+ die "ln -s ${WORKON_FILE} ${KEYWORDS_FILE}"
fi
-sudo touch "${UNMASK_FILE}" || \
- die "touch ${UNMASK_FILE}"
+if [ ! -L "${UNMASK_FILE}" ]; then
+ [ -f "${UNMASK_FILE}" ] && sudo mv "${UNMASK_FILE}" "${WORKON_FILE}"
+ sudo ln -s "${WORKON_FILE}" "${UNMASK_FILE}" || \
+ die "ln -s ${WORKON_FILE} ${UNMASK_FILE}"
+fi
+sudo touch "${WORKON_FILE}" || \
+ die "touch ${WORKON_FILE}"
# Canonicalize package name to category/package.
canonicalize_name () {
@@ -113,7 +121,7 @@ canonicalize_names () {
# Display ebuilds currently part of the live branch and open for development.
show_live_ebuilds () {
- sed -n 's/^[~=]\(.*\)-9999$/\1/p' "${UNMASK_FILE}"
+ sed -n 's/^[~=]\(.*\)-9999$/\1/p' "${WORKON_FILE}"
}
find_repo_dir () {
@@ -171,8 +179,8 @@ ebuild_to_live () {
local atoms=$1
for atom in ${atoms}; do
- if ! grep -qx "[~=]${atom}-9999" "${UNMASK_FILE}" ; then
- sudo bash -c "echo \"=${atom}-9999\" >> \"${UNMASK_FILE}\""
+ if ! grep -qx "[~=]${atom}-9999" "${WORKON_FILE}" ; then
+ sudo bash -c "echo \"=${atom}-9999\" >> \"${WORKON_FILE}\""
else
warn "Already working on ${atom}"
fi
@@ -184,10 +192,10 @@ ebuild_to_stable () {
local atoms=$1
for atom in ${atoms}; do
- if grep -qx "[~=]${atom}-9999" "${UNMASK_FILE}" ; then
- sudo bash -c "grep -v '^[~=]${atom}-9999\$' \"${UNMASK_FILE}\" > \
- \"${UNMASK_FILE}+\""
- sudo mv "${UNMASK_FILE}+" "${UNMASK_FILE}"
+ if grep -qx "[~=]${atom}-9999" "${WORKON_FILE}" ; then
+ sudo bash -c "grep -v '^[~=]${atom}-9999\$' \"${WORKON_FILE}\" > \
+ \"${WORKON_FILE}+\""
+ sudo mv "${WORKON_FILE}+" "${WORKON_FILE}"
else
warn "Not working on ${atom}"
fi
« 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