From 71124e5362c43cbba0c4848457b42f0208bd696f Mon Sep 17 00:00:00 2001 From: Andrew Chew Date: Thu, 12 Jul 2012 14:08:40 -0700 Subject: [PATCH] Add support for non-workon projects When trying to cros_workon a non-workon project, supply a remote. When a remote is supplied, we assume a non-workon project, and add the remote tag to the local_manifest.xml. BUG=chromium-os:32247 TEST=Tested that cros_workon start/stop still works for workon package (I specifically tested with sys-process/ktop), and also tested that this works with a package that does not match up with a known (i.e. in the full manifest) package, but is present in the private-overlays. repo sync pulls the proper source in both cases. CQ-DEPEND=I1bc4247532647e9bc5962acef988ab57445f4b0e Change-Id: I03bcf3d42e111e5a0e876763c99b021a14ce7e2e Signed-off-by: Andrew Chew Reviewed-on: https://gerrit.chromium.org/gerrit/27320 Reviewed-by: Rhyland Klein Reviewed-by: David James --- cros_workon | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cros_workon b/cros_workon index 7e346c5e9a..46eb48b224 100755 --- a/cros_workon +++ b/cros_workon @@ -21,6 +21,8 @@ DEFINE_string board "${DEFAULT_BOARD}" \ "The board to set package keywords for." DEFINE_boolean host "${FLAGS_FALSE}" \ "Uses the host instead of board" +DEFINE_string remote "" \ + "For non-workon projects, the git remote to use." DEFINE_string command "git status" \ "The command to be run by forall." DEFINE_boolean all "${FLAGS_FALSE}" \ @@ -275,8 +277,12 @@ regen_manifest_and_sync() { for S in "${CROS_WORKON_SRCDIR[@]}"; do local srcdir=$(readlink -m "${S}") local project_path=${srcdir#${trunkdir}/} - - loman add --workon "${CROS_WORKON_PROJECT[i]}" "${project_path}" + local name_path="${CROS_WORKON_PROJECT[i]} ${project_path}" + if [ -z "${FLAGS_remote}" ]; then + loman add --workon ${name_path} + else + loman add ${name_path} --remote="${FLAGS_remote}" + fi : $(( ++i )) done done