~launchpad-pqm/launchpad/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /bin/bash

# Update your copy of trunk and the necessary source dependencies, and make
# sure all source dependencies are properly linked in to all the branches you
# are working on.

source "$HOME/.rocketfuel-env.sh"
if [ "$?" != 0 ]; then
    echo "Please run rocketfuel-setup first."
    exit 1
fi

DEVPAD="devpad.canonical.com"
ROCKETFUELDEPS="/code/rocketfuel-built/launchpad/sourcecode/*"
RSYNCOPTIONS="-avp --partial --progress --delete"
# Note, we also add a filter when rsync is evoked.

# Make sure we have an ssh key primed
ssh-add -l
if [ $? -gt 0 ]; then ssh-add; fi

# Pull from devpad trunk
cd $LP_TRUNK_PATH
INITIAL_REV=$(bzr revno)
bzr pull
FINAL_REV=$(bzr revno)

# Update the source dependencies
if [ ! -d $LP_SOURCEDEPS_PATH ]; then mkdir -p $LP_SOURCEDEPS_PATH; fi

# Several (*) have tried, and failed, to get the --filter to fit neatly
# into RSYNCOPTIONS, so we put it here. Bash arrays do not count.
#   * elmo, sabdfl
rsync --filter=". utilities/sourcedeps.filter" $RSYNCOPTIONS $DEVPAD:$ROCKETFUELDEPS $LP_SOURCEDEPS_PATH/

cd $LP_PROJECT_PATH
for branch in *; do
  if [ -d $branch/sourcecode ]
  then
    echo "Updating sourcecode dependencies for ${branch}"
    $LP_TRUNK_NAME/utilities/link-external-sourcecode --target=$branch --parent=../$LP_SOURCEDEPS_DIR
  fi
done

# Exit if there are no new revisions
if [ $FINAL_REV = $INITIAL_REV ]; then exit 0; fi

cd $LP_TRUNK_NAME
make