~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to utilities/rocketfuel-get

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-06-01 18:55:54 UTC
  • mfrom: (13145.1.1 link-sourcecode-faster)
  • Revision ID: launchpad@pqm.canonical.com-20110601185554-76vhdgju3m22xmjm
[r=abentley][no-qa] In rocketfuel-get run link-external-sourcecode in
        parallel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
# Stop if there's an error, and treat unset variables as errors.
11
11
set -eu
12
12
 
 
13
# A rough measure of how much stuff we can do in parallel.
 
14
CPU_COUNT="$(egrep -c '^processor\b' /proc/cpuinfo)"
 
15
 
13
16
# Helper function to run a child process, indenting stdout to aid
14
17
# readability.
15
18
run-child() {
56
59
fi
57
60
 
58
61
echo "Updating sourcecode dependencies in rocketfuel:"
59
 
echo ""
60
 
echo "    Sourcedeps: $LP_SOURCEDEPS_PATH"
61
 
 
62
 
run-child $LP_TRUNK_PATH/utilities/update-sourcecode $LP_SOURCEDEPS_PATH $sourcedeps_conf
63
 
 
 
62
run-child \
 
63
    "$LP_TRUNK_PATH/utilities/update-sourcecode" \
 
64
    "$LP_SOURCEDEPS_PATH" "$sourcedeps_conf"
64
65
 
65
66
# Update the current trees in the repo.
66
67
echo "Updating sourcecode dependencies in current local branches:"
67
 
for branch in "$LP_PROJECT_PATH"/*
68
 
do
69
 
    if [ -d "$branch/sourcecode" ]
70
 
    then
71
 
        echo "    ${branch}"
72
 
        run-child "$LP_TRUNK_PATH/utilities/link-external-sourcecode" \
73
 
            --parent="$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR" --target="$branch"
74
 
    fi
75
 
done
 
68
find "$LP_PROJECT_PATH" -mindepth 2 -maxdepth 2 \
 
69
    -type d -name sourcecode -printf '%h\0' | \
 
70
    run-child xargs --no-run-if-empty \
 
71
        --max-procs="${CPU_COUNT}" --max-args=1 --null \
 
72
        "$LP_TRUNK_PATH/utilities/link-external-sourcecode" \
 
73
            --parent "$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR" --target
76
74
 
77
75
# Build launchpad if there were changes.
78
76
if [ $FINAL_REV != $INITIAL_REV ];