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

Unified Diff: cros_workon

Issue 3446002: cros_workon: WORKON_FILE should be owned by the user (Closed) Base URL: http://git.chromium.org/git/crosutils.git
Patch Set: Created 10 years, 3 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 9720079a8cd466a6304fd5e68ea4a65d042398ff..0e21215a6443c0914bf7097918988d61df3bac2c 100755
--- a/cros_workon
+++ b/cros_workon
@@ -74,9 +74,15 @@ WORKON_FILE=${WORKON_DIR}/${FLAGS_board:-host}
KEYWORDS_FILE=${KEYWORDS_DIR}/cros-workon
UNMASK_FILE=${UNMASK_DIR}/cros-workon
-# 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}"
+# TODO(msb): remove the backward compatibility after 10/01/2010
+if [ -d "${WORKON_DIR}" ]; then
+ sudo chown -R "${USER}" "${WORKON_DIR}"
+fi
+
+mkdir -p "${WORKON_DIR}" || die "mkdir -p ${WORKON_DIR}"
+touch "${WORKON_FILE}" || die "touch ${WORKON_FILE}"
+sudo mkdir -p "${KEYWORDS_DIR}" "${UNMASK_DIR}" || \
+ die "mkdir -p ${KEYWORDS_DIR} ${UNMASK_DIR}"
if [ ! -L "${KEYWORDS_FILE}" ]; then
sudo rm -f "${KEYWORDS_FILE}"
sudo ln -s "${WORKON_FILE}" "${KEYWORDS_FILE}" || \
@@ -87,8 +93,6 @@ if [ ! -L "${UNMASK_FILE}" ]; then
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 () {
« 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