~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to utilities/rocketfuel-get

  • Committer: Jeroen Vermeulen
  • Date: 2011-08-17 06:00:25 UTC
  • mto: This revision was merged to the branch mainline in revision 13717.
  • Revision ID: jeroen.vermeulen@canonical.com-20110817060025-g0esngv5vrakys4w
Make rocketfuel-get suitable for dogfood-style setups with lp-sourcedeps among the branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
 
67
67
# Update the current trees in the repo.
68
68
echo "Updating sourcecode dependencies in current local branches:"
69
 
find "$LP_PROJECT_PATH" -mindepth 2 -maxdepth 2 \
70
 
    -type d -name sourcecode -printf '%h\0' | \
 
69
 
 
70
# Find directories among local branches containing "sourcecode" directories.
 
71
# Prints each as a null-terminated record (since Unix filenames may contain
 
72
# newlines).
 
73
find_branches_to_relink() {
 
74
    find "$LP_PROJECT_PATH" \
 
75
        -mindepth 2 -maxdepth 2 -type d -name sourcecode -printf '%h\0'
 
76
}
 
77
 
 
78
# Some old setups (notably dogfood) may have lp-sourcedeps mixed in with the
 
79
# local branches.  Echo stdin to stdout, with these filenames filtered out.
 
80
# Filenames must be null-terminated on input, and remain null-terminated on
 
81
# output.
 
82
filter_branches_to_relink() {
 
83
    grep -vz '/lp-sourcedeps$'
 
84
}
 
85
 
 
86
# Re-link the sourcecode directories for local branches.  Takes the branch
 
87
# paths from stdin, as null-terminated records.
 
88
relink_branches() {
71
89
    run-child xargs --no-run-if-empty \
72
90
        --max-procs="${CPU_COUNT}" --max-args=1 --null \
73
91
        "$LP_TRUNK_PATH/utilities/link-external-sourcecode" \
74
92
            --parent "$LP_PROJECT_ROOT/$LP_SOURCEDEPS_DIR" --target
 
93
}
 
94
 
 
95
# Actually do it:
 
96
find_branches_to_relink | filter_branches_to_relink | relink_branches
 
97
 
75
98
 
76
99
# Build launchpad if there were changes.
77
100
if [ $FINAL_REV != $INITIAL_REV ];