Merge lp:~kfogel/launchpad/rocketfuel-2a into lp:launchpad

Proposed by Karl Fogel
Status: Merged
Merged at revision: not available
Proposed branch: lp:~kfogel/launchpad/rocketfuel-2a
Merge into: lp:launchpad
Diff against target: 57 lines
To merge this branch: bzr merge lp:~kfogel/launchpad/rocketfuel-2a
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+8785@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Karl Fogel (kfogel) wrote :

This branch tweaks rocketfuel-setup to:

  1. Intialize the repo with --2a.

  2. Bail if Bazaar is less than 1.16.1, since there's no point
     going further if the user can't handle 2a format in a
     reasonably bug-free way.

(We could easily change it to use 1.17 as the threshhold, but I'm not
sure 1.17 will be out in time for rocketfuel-setup being open sourced.)

Revision history for this message
Tim Penhey (thumper) wrote :

I'm not sure my bash-foo is good enough to know if you have your bail conditions good enough.

Bazaar 1.17 should be out within a week, so it is up to you what to test. We could always upgrade it later.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utilities/rocketfuel-setup'
2--- utilities/rocketfuel-setup 2009-07-09 17:37:31 +0000
3+++ utilities/rocketfuel-setup 2009-07-16 02:21:23 +0000
4@@ -4,6 +4,42 @@
5 # workstation, from scratch. The script lives in the LP codebase itself,
6 # as utilities/rocketfuel-setup
7
8+# We require Bazaar 1.16.1 or higher.
9+# So first, grab the output of 'bzr --version' and transform the
10+# version line, like "Bazaar (bzr) 1.16.1", into "1 16 1":
11+VER_NUMS=`bzr --version | head -1 | sed -e 's/[^.0-9]//g' | sed -e 's/[.]/ /g'`
12+# Now stuff each component into its own variable, so we can check sanely.
13+MAJOR=0
14+MINOR=0
15+MICRO=0
16+ITER=0
17+for VER_COMPONENT in ${VER_NUMS}; do
18+ if [ ${ITER} -eq 0 ]; then
19+ MAJOR=${VER_COMPONENT}
20+ elif [ ${ITER} -eq 1 ]; then
21+ MINOR=${VER_COMPONENT}
22+ elif [ ${ITER} -eq 2 ]; then
23+ MICRO=${VER_COMPONENT}
24+ # Ignore anything beyond micro -- nanoversions are irrelevant here.
25+ fi
26+ ITER=`expr ${ITER} + 1`
27+done
28+# Check that the version is high enough.
29+BAZAAR_BAIL=0
30+if [ ${MAJOR} -lt 1 ]; then
31+ BAZAAR_BAIL=1
32+elif [ ${MINOR} -lt 16 ]; then
33+ BAZAAR_BAIL=1
34+elif [ ${MINOR} -eq 16 -a ${MICRO} -lt 1 ]; then
35+ BAZAAR_BAIL=1
36+fi
37+if [ ${BAZAAR_BAIL} -ne 0 ]; then
38+ echo "ERROR: You don't have a high enough version of Bazaar:"
39+ echo " rocketfuel-setup requires bzr 1.16.1 or higher, but you have bzr ${MAJOR}.${MINOR}.${MICRO}."
40+ echo " Please see http://bazaar-vcs.org/Download to get a newer version."
41+ exit 1
42+fi
43+
44 if [ ! -e "$HOME/.rocketfuel-env.sh" ]; then
45 echo "# Common environment variables for the rocketfuel-* scripts.
46 #
47@@ -283,8 +319,8 @@
48 mkdir -p $LP_PROJECT_ROOT
49 cd $LP_PROJECT_ROOT
50 if [ ! -d $LP_SHARED_REPO ]; then
51- # 1.6 format needed for stacking on Launchpad.
52- bzr init-repo --1.6 $LP_SHARED_REPO
53+ # 2a format (a.k.a. "brisbane-core") needed for stacking on Launchpad.
54+ bzr init-repo --2a $LP_SHARED_REPO
55 if [ $? -ne 0 ]; then
56 echo "ERROR: Unable to setup local LP repository"
57 exit 1