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 <achew@nvidia.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/27320
Reviewed-by: Rhyland Klein <rklein@nvidia.com>
Reviewed-by: David James <davidjames@chromium.org>
This commit is contained in:
Andrew Chew 2012-07-12 14:08:40 -07:00 committed by Gerrit
parent 540284316d
commit 71124e5362

View File

@ -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