yellow team mailing list archive
-
yellow team
-
Mailing list archive
-
Message #00881
[Merge] lp:~frankban/lpsetup/update-subcommand into lp:lpsetup
Francesco Banconi has proposed merging lp:~frankban/lpsetup/update-subcommand into lp:lpsetup.
Requested reviews:
Launchpad Yellow Squad (yellow)
For more details, see:
https://code.launchpad.net/~frankban/lpsetup/update-subcommand/+merge/107238
== Changes ==
This branch fixes the `lp-setup upgrade` sub command.
Right now this command reflects what is done by `rocketfuel-get`:
- update the devel branch (bzr pull)
- make
- link-external-sourcecode for all the branches found in the shared repository
However, the behavior of `update` is currently under discussion.
New features not present in `rocketfuel-get`:
- it is possible to specify the paths of the shared repository and dependencies.
- ability to upgrade deb packages, if requested.
- ability to `make schema`, if requested.
== Tests ==
nosetests -v
--
https://code.launchpad.net/~frankban/lpsetup/update-subcommand/+merge/107238
Your team Launchpad Yellow Squad is requested to review the proposed merge of lp:~frankban/lpsetup/update-subcommand into lp:lpsetup.
=== modified file 'lpsetup/subcommands/install.py'
--- lpsetup/subcommands/install.py 2012-05-22 12:44:21 +0000
+++ lpsetup/subcommands/install.py 2012-05-24 16:24:33 +0000
@@ -58,7 +58,7 @@
)
-def setup_codebase(user, valid_ssh_keys, checkout_dir, dependencies_dir):
+def setup_codebase(user, checkout_dir, dependencies_dir, valid_ssh_keys=True):
"""Set up Launchpad repository and source dependencies.
Return True if new changes are pulled from bzr repository.
@@ -93,7 +93,7 @@
def setup_external_sourcecode(
- user, valid_ssh_keys, checkout_dir, dependencies_dir):
+ user, checkout_dir, dependencies_dir, valid_ssh_keys=True):
"""Update and link external sourcecode."""
cmd = (
'utilities/update-sourcecode',
@@ -159,7 +159,7 @@
call('bzr', 'init-repo', '--2a', directory)
# Set up the codebase.
checkout_dir = os.path.join(directory, LP_CHECKOUT)
- setup_codebase(user, valid_ssh_keys, checkout_dir, dependencies_dir)
+ setup_codebase(user, checkout_dir, dependencies_dir, valid_ssh_keys)
# haveged is used to fill /dev/random, avoiding
# entropy exhaustion during automated parallel tests.
if feed_random:
@@ -212,7 +212,7 @@
# Set up Launchpad dependencies.
checkout_dir = os.path.join(directory, LP_CHECKOUT)
setup_external_sourcecode(
- user, valid_ssh_keys, checkout_dir, dependencies_dir)
+ user, checkout_dir, dependencies_dir, valid_ssh_keys)
with su(user):
# Create Apache document roots, to avoid warnings.
mkdirs(*LP_APACHE_ROOTS)
=== modified file 'lpsetup/subcommands/update.py'
--- lpsetup/subcommands/update.py 2012-03-22 10:48:50 +0000
+++ lpsetup/subcommands/update.py 2012-05-24 16:24:33 +0000
@@ -28,18 +28,20 @@
from lpsetup.utils import call
-def update_launchpad(user, valid_ssh_keys, dependencies_dir, directory, apt):
+def update_launchpad(user, dependencies_dir, directory, make_schema, apt):
"""Update the Launchpad environment."""
if apt:
- install.setup_apt(no_repositories=True)
+ call('apt-get', 'update')
+ call('apt-get', 'upgrade')
checkout_dir = os.path.join(directory, LP_CHECKOUT)
# Update the Launchpad codebase.
- changed = install.setup_codebase(
- user, valid_ssh_keys, checkout_dir, dependencies_dir)
- install.setup_external_sourcecode(
- user, valid_ssh_keys, checkout_dir, dependencies_dir)
+ changed = install.setup_codebase(user, checkout_dir, dependencies_dir)
+ install.setup_external_sourcecode(user, checkout_dir, dependencies_dir)
if changed:
install.make_launchpad(user, checkout_dir, install=False)
+ if make_schema:
+ with su(user):
+ call('make', '-C', checkout_dir, 'schema')
def link_sourcecode_in_branches(user, dependencies_dir, directory):
@@ -61,14 +63,13 @@
steps = (
(update_launchpad,
- 'user', 'valid_ssh_keys', 'dependencies_dir', 'directory', 'apt'),
+ 'user', 'dependencies_dir', 'directory', 'make_schema', 'apt'),
(link_sourcecode_in_branches,
'user', 'dependencies_dir', 'directory'),
)
help = __doc__
validators = (
handlers.handle_user,
- handlers.handle_ssh_keys,
handlers.handle_directories,
)
@@ -96,5 +97,8 @@
'given user (see -u argument). '
'[DEFAULT={0}]'.format(CHECKOUT_DIR))
parser.add_argument(
- '-D', '--apt', action='store_true',
+ '-S', '--make-schema', action='store_true',
+ help='Run `make schema` if code updates are found.')
+ parser.add_argument(
+ '-A', '--apt', action='store_true',
help='Also update deb packages.')