upgrading charms from oneiric to precise

Mark Mims mark.mims at canonical.com
Fri May 4 19:35:02 UTC 2012


Capturing notes on how we did this so when we're changing from p to q on 
October we have some clue as to what we did here.

----------8<----------------

# lp changes

So this started with the lp team running `branch-distro` for charms.

This took all branches in the store `lp:charms/<charm-name>`
(which are aliases to `lp:~charmers/charms/oneiric/<charm-name>/trunk`) and:
   - renamed them to `lp:~charmers/charms/precise/<charm-name>/precise`
   - created `lp:charms/<charm-name>` aliases pointing to these new branches


# the problem

This naming scheme doesn't fit into our naming scheme for juju and the 
charmstore...
namely `lp:~charmers/charms/<series>/<charm-name>/trunk`


# renames

To fix this, we rename from `/precise` to `/trunk` across the board:

     #!/usr/bin/python

     from launchpadlib.launchpad import Launchpad

     lp = Launchpad.login_with('rename-charms', 
service_root='production', version='1.0')

     for branch in lp.people['charmers'].getBranches():
         if branch.unique_name.startswith('~charmers/charms/precise/') 
and branch.name == 'precise':
             print "Renaming " + branch.unique_name
             branch.name = 'trunk'
             try:
                 branch.lp_save()
             except:
                 print "couldn't do "
                 print branch


# more problems

which barfs when there are existing branches with that name.

Example:
   - before `branch-distro`
     - `lp:charms/nova-compute` points to 
`lp:~charmers/charms/oneiric/nova-compute/trunk` (r28)
     - `lp:~charmers/charms/precise/nova-compute/trunk` (r34) exists for 
development on precise
   - after `branch-distro`
     - `lp:charms/nova-compute` points to 
`lp:~charmers/charms/precise/nova-compute/precise` (r28)
     - `lp:~charmers/charms/precise/nova-compute/trunk` (r34) exists and 
should be the official aliased charm but isn't


# repromulgation

Clint wrote `charm unpromulgate` which would allow us to:

     bzr branch lp:charms/nova-compute
     cd nova-compute
     bzr push :parent
     edit .bzr/branch/branch.conf and replace everything with 
bzr+ssh://bazaar.launchpad.net/~charmers/charms/precise/nova-compute/precise
     charm unpromulgate

     cd ..
     mv nova-compute nova-compute-barfed

and then promulgate the correct branch

     bzr branch lp:~charmers/charms/precise/nova-compute/trunk nova-compute
     cd nova-compute
     bzr push :parent
     charm promulgate

----------8<----------------

(logs captured in `lp:~mark-mims/+junk/charm-branch-distro-notes`)

-- 
Mark Mims, Ph.D.
Canonical Ltd.
mark.mims at canonical.com
+1(512)981-6467




More information about the Juju mailing list