Merge ~cjwatson/launchpad:rocketfuel-setup-no-bzr into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 5337d133916a23d4e9897d2d07aa810cfd5ee246
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:rocketfuel-setup-no-bzr
Merge into: launchpad:master
Diff against target: 29 lines (+2/-14)
1 file modified
utilities/rocketfuel-setup (+2/-14)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+428845@code.launchpad.net

Commit message

Simplify rocketfuel-setup to avoid relying on bzr

Description of the change

The only remaining use of `bzr` here was to find out whether the user has any SSH keys registered with Launchpad, which we can instead do with a simple `curl`.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/utilities/rocketfuel-setup b/utilities/rocketfuel-setup
2index e4e1237..06e5d2c 100755
3--- a/utilities/rocketfuel-setup
4+++ b/utilities/rocketfuel-setup
5@@ -233,22 +233,10 @@ fi
6 mkdir -p "$LP_PROJECT_ROOT"
7 cd "$LP_PROJECT_ROOT" || exit 1
8
9-echo "Logging bzr into Launchpad (it's okay if this errors)..."
10-if ! bzr launchpad-login "$lpusername"; then
11- echo ""
12- echo "You can ignore any error above about not registering an SSH key"
13- echo "with Launchpad. Registering an SSH key is only important if you"
14- echo "are writing data to Launchpad, or trying to access private data."
15- echo ""
16-fi
17-
18-# Make sure "git clone lp:..." works. Yes, it's pretty odd to use bzr to
19-# help configure git, but it knows how to check whether the user has SSH
20-# keys. If we eventually want to drop our dependency on bzr then we can
21-# write this out longhand in Python.
22+# Make sure "git clone lp:..." works.
23 echo "Configuring git..."
24 if [ "$(git ls-remote --get-url lp:launchpad)" = lp:launchpad ]; then
25- if bzr launchpad-login --verbose 2>/dev/null | grep -q 'has SSH keys'; then
26+ if [ "$(curl --fail --silent "https://launchpad.net/~$lpusername/+sshkeys")" ]; then
27 git config --global url.git+ssh://git.launchpad.net/.insteadof lp:
28 else
29 git config --global url.https://git.launchpad.net/.insteadof lp:

Subscribers

People subscribed via source and target branches

to status/vote changes: