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' | \
70
# Find directories among local branches containing "sourcecode" directories.
71
# Prints each as a null-terminated record (since Unix filenames may contain
73
find_branches_to_relink() {
74
find "$LP_PROJECT_PATH" \
75
-mindepth 2 -maxdepth 2 -type d -name sourcecode -printf '%h\0'
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
82
filter_branches_to_relink() {
83
grep -vz '/lp-sourcedeps$'
86
# Re-link the sourcecode directories for local branches. Takes the branch
87
# paths from stdin, as null-terminated records.
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
96
find_branches_to_relink | filter_branches_to_relink | relink_branches
76
99
# Build launchpad if there were changes.
77
100
if [ $FINAL_REV != $INITIAL_REV ];