Merge lp:~abentley/launchpad/force-aptitude into lp:launchpad

Proposed by Aaron Bentley
Status: Merged
Merged at revision: 11215
Proposed branch: lp:~abentley/launchpad/force-aptitude
Merge into: lp:launchpad
Diff against target: 85 lines (+22/-7)
3 files modified
lib/canonical/buildd/buildrecipe (+18/-4)
lib/canonical/buildd/test_buildd_recipe (+1/-1)
utilities/soyuz-sampledata-setup.py (+3/-2)
To merge this branch: bzr merge lp:~abentley/launchpad/force-aptitude
Reviewer Review Type Date Requested Status
LaMont Jones (community) packaging Approve
Paul Hummer (community) code Approve
Review via email: mp+30795@code.launchpad.net

Description of the change

= Summary =
Fix bug #599102 Source build based on recipe targeting Maverick fails

== Proposed fix ==
Add aptitude to the list of packages to install, because pbuilder's scripts
need it but the package doesn't depend on it.

== Pre-implementation notes ==
Mid-implementation discussion with Lamont.

== Implementation details ==
Also made some changes to make this kind of fix easier to test, updating the
test script to use Maverick, and adding Maverick to the soyuz-sampledata-setup
script.

Also improved logging by displaying the recipe being built and the command
being run.

Also updated the sudo command to specify -i so that it behaves more like the
user.

== Tests ==
None (but it has been interactively tested on dogfood.)

== Demo and Q/A ==
Request a recipe build targetting Maverick. It should not die due to lack of
aptitude.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  utilities/soyuz-sampledata-setup.py
  lib/canonical/buildd/buildrecipe
  lib/canonical/buildd/test_buildd_recipe

== Pylint notices ==

C
    1: Invalid name "soyuz-sampledata-setup" (should match (([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$)

E
    33: No name 'component' in module 'zope'

F
    33: Unable to import 'zope.component'

E
    35: No name 'lifecycleevent' in module 'zope'

F
    35: Unable to import 'zope.lifecycleevent'

E
    36: No name 'security' in module 'zope'

F
    36: Unable to import 'zope.security.proxy'

C
    65: Invalid name "user_name" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
    66: Invalid name "default_email" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
    145:retire_active_publishing_histories: Invalid name "retire_active_publishing_histories" (should match [a-z_][a-z0-9_]{2,30}$)
    285:clean_up: Missing docstring

W
    307:set_source_package_format: Redefining built-in 'format'
    312:populate: Unused argument 'options'
    363:create_ppa_user: Unused variable 'stdout'
    349:create_ppa_user: Unused argument 'approver'

C
    389:main: Missing docstring

W
    390:main: Unused variable 'args'

    Report
    ======
    191 statements analysed.

    Duplication
    -----------

    +-------------------------+------+---------+-----------+
    | |now |previous |difference |
    +=========================+======+=========+===========+
    |nb duplicated lines |0 |NC |NC |
    +-------------------------+------+---------+-----------+
    |percent duplicated lines |0.000 |NC |NC |
    +-------------------------+------+---------+-----------+

    Raw metrics
    -----------

    +----------+-------+------+---------+-----------+
    |type |number |% |previous |difference |
    +==========+=======+======+=========+===========+
    |code |243 |66.21 |NC |NC |
    +----------+-------+------+---------+-----------+
    |docstring |60 |16.35 |NC |NC |
    +----------+-------+------+---------+-----------+
    |comment |22 |5.99 |NC |NC |
    +----------+-------+------+---------+-----------+
    |empty |42 |11.44 |NC |NC |
    +----------+-------+------+---------+-----------+

    External dependencies
    ---------------------
    ~~:
    :

    _pythonpath (soyuz-sampledata-setup)
    canonical
    -database
    | -sqlbase
    | -sqlvalues (soyuz-sampledata-setup)
    -launchpad
    | -interfaces
    | | -launchpad
    | | -ILaunchpadCelebrities (soyuz-sampledata-setup)
    | -scripts
    | | -execute_zcml_for_scripts (soyuz-sampledata-setup)
    | | -logger
    | | -logger (soyuz-sampledata-setup)
    | | -logger_options (soyuz-sampledata-setup)
    | -webapp
    | -interfaces
    | -IStoreSelector (soyuz-sampledata-setup)
    | -MAIN_STORE (soyuz-sampledata-setup)
    | -MASTER_FLAVOR (soyuz-sampledata-setup)
    | -SLAVE_FLAVOR (soyuz-sampledata-setup)
    -lp
    -initZopeless (soyuz-sampledata-setup)
    lp
    -registry
    | -interfaces
    | | -codeofconduct
    | | | -ISignedCodeOfConductSet (soyuz-sampledata-setup)
    | | -person
    | | | -IPersonSet (soyuz-sampledata-setup)
    | | -series
    | | -SeriesStatus (soyuz-sampledata-setup)
    | -model
    | -codeofconduct
    | -SignedCodeOfConduct (soyuz-sampledata-setup)
    -soyuz
    | -interfaces
    | | -component
    | | | -IComponentSet (soyuz-sampledata-setup)
    | | -processor
    | | | -IProcessorFamilySet (soyuz-sampledata-setup)
    | | -publishing
    | | | -active_publishing_status (soyuz-sampledata-setup)
    | | -section
    | | | -ISectionSet (soyuz-sampledata-setup)
    | | -sourcepackageformat
    | | -ISourcePackageFormatSelectionSet (soyuz-sampledata-setup)
    | | -SourcePackageFormat (soyuz-sampledata-setup)
    | -model
    | -component
    | | -ComponentSelection (soyuz-sampledata-setup)
    | -distroarchseries
    | | -DistroArchSeries (soyuz-sampledata-setup)
    | -section
    | -SectionSelection (soyuz-sampledata-setup)
    -testing
    -factory
    -LaunchpadObjectFactory (soyuz-sampledata-setup)
    optparse
    -OptionParser (soyuz-sampledata-setup)
    storm
    -store
    -Store (soyuz-sampledata-setup)
    textwrap
    -dedent (soyuz-sampledata-setup)
    transaction (soyuz-sampledata-setup)
    zope
    -event
    -notify (soyuz-sampledata-setup)

    Statistics by type
    ------------------

    +---------+-------+-----------+-----------+------------+---------+
    |type |number |old number |difference |%documented |%badname |
    +=========+=======+===========+===========+============+=========+
    |module |1 |NC |NC |100.00 |100.00 |
    +---------+-------+-----------+-----------+------------+---------+
    |class |1 |NC |NC |100.00 |0.00 |
    +---------+-------+-----------+-----------+------------+---------+
    |method |0 |NC |NC |0.00 |0.00 |
    +---------+-------+-----------+-----------+------------+---------+
    |function |22 |NC |NC |90.91 |4.55 |
    +---------+-------+-----------+-----------+------------+---------+

    Messages by category
    --------------------

    +-----------+-------+---------+-----------+
    |type |number |previous |difference |
    +===========+=======+=========+===========+
    |convention |6 |NC |NC |
    +-----------+-------+---------+-----------+
    |refactor |0 |NC |NC |
    +-----------+-------+---------+-----------+
    |warning |6 |NC |NC |
    +-----------+-------+---------+-----------+
    |error |3 |NC |NC |
    +-----------+-------+---------+-----------+

    Messages
    --------

    +-----------+------------+
    |message id |occurrences |
    +===========+============+
    |C0103 |4 |
    +-----------+------------+
    |F0401 |3 |
    +-----------+------------+
    |E0611 |3 |
    +-----------+------------+
    |W0613 |2 |
    +-----------+------------+
    |W0612 |2 |
    +-----------+------------+
    |C0111 |2 |
    +-----------+------------+
    |W0622 |1 |
    +-----------+------------+
    |W0611 |1 |
    +-----------+------------+

    Global evaluation
    -----------------
    Your code has been rated at 8.59/10

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

rockstar> abentley, line 26-27 of the diff, why are you printing "Printing recipe:" and the recipe on separate lines?
<abentley> rockstar, I'm printing 'Building recipe:' so to help break up the recipe from the body of the log. I'm printing the recipe verbatim so that it's easy to copy and paste.
<rockstar> abentley, okay.

review: Approve (code)
Revision history for this message
LaMont Jones (lamont) :
review: Approve (packaging)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/buildd/buildrecipe'
2--- lib/canonical/buildd/buildrecipe 2010-06-30 16:05:20 +0000
3+++ lib/canonical/buildd/buildrecipe 2010-07-23 16:16:06 +0000
4@@ -53,8 +53,10 @@
5
6 :return: A retcode from apt.
7 """
8+ # XXX: AaronBentley 2010-07-07 bug=602463: pbuilder uses aptitude but
9+ # does not depend on it.
10 return self.chroot(['apt-get', 'install', '-y', 'pbuilder',
11- 'bzr-builder', 'sudo'])
12+ 'bzr-builder', 'sudo', 'aptitude'])
13
14 def buildTree(self):
15 """Build the recipe into a source tree.
16@@ -67,12 +69,21 @@
17 self.tree_path_relative = os.path.join(self.work_dir_relative, 'tree')
18 manifest_path_relative = os.path.join(
19 self.tree_path_relative, 'manifest')
20+ recipe_path = os.path.join(self.chroot_path, recipe_path_relative[1:])
21+ recipe_file = open(recipe_path, 'rb')
22+ try:
23+ recipe = recipe_file.read()
24+ finally:
25+ recipe_file.close()
26+ print 'Building recipe:'
27+ print recipe
28 retcode = self.chroot([
29- 'sudo', '-u', self.username, 'DEBEMAIL=%s' % self.author_email,
30+ 'sudo', '-iu', self.username, 'DEBEMAIL=%s' % self.author_email,
31 'DEBFULLNAME=%s' % self.author_name.encode('utf-8'), 'bzr',
32 'dailydeb', '--no-build', recipe_path_relative,
33 self.tree_path_relative, '--manifest', manifest_path_relative,
34- '--append-version', '~%s1' % self.distroseries_name])
35+ '--append-version', '~%s1' % self.distroseries_name],
36+ echo=True)
37 if retcode != 0:
38 return retcode
39 (source,) = [name for name in os.listdir(self.tree_path)
40@@ -106,12 +117,15 @@
41 '/usr/lib/pbuilder/pbuilder-satisfydepends'
42 % self.source_dir_relative])
43
44- def chroot(self, args):
45+ def chroot(self, args, echo=False):
46 """Run a command in the chroot.
47
48 :param args: the command and arguments to run.
49 :return: the status code.
50 """
51+ if echo:
52+ print "Running in chroot: %s" % ' '.join(
53+ "'%s'" % arg for arg in args)
54 return call([
55 '/usr/bin/sudo', '/usr/sbin/chroot', self.chroot_path] + args)
56
57
58=== modified file 'lib/canonical/buildd/test_buildd_recipe'
59--- lib/canonical/buildd/test_buildd_recipe 2010-06-30 16:05:20 +0000
60+++ lib/canonical/buildd/test_buildd_recipe 2010-07-23 16:16:06 +0000
61@@ -7,7 +7,7 @@
62
63 country_code = 'us'
64 apt_cacher_ng_host = 'stumpy'
65-distroseries_name = 'lucid'
66+distroseries_name = 'maverick'
67 recipe_text = """# bzr-builder format 0.2 deb-version 0+{revno}
68 http://bazaar.launchpad.dev/~ppa-user/+junk/wakeonlan"""
69
70
71=== modified file 'utilities/soyuz-sampledata-setup.py'
72--- utilities/soyuz-sampledata-setup.py 2010-04-27 19:48:39 +0000
73+++ utilities/soyuz-sampledata-setup.py 2010-07-23 16:16:06 +0000
74@@ -271,8 +271,9 @@
75 ('Hardy Heron', SeriesStatus.SUPPORTED, '8.04'),
76 ('Intrepid Ibex', SeriesStatus.SUPPORTED, '8.10'),
77 ('Jaunty Jackalope', SeriesStatus.SUPPORTED, '9.04'),
78- ('Karmic Koala', SeriesStatus.CURRENT, '9.10'),
79- ('Lucid Lynx', SeriesStatus.DEVELOPMENT, '10.04'),
80+ ('Karmic Koala', SeriesStatus.SUPPORTED, '9.10'),
81+ ('Lucid Lynx', SeriesStatus.CURRENT, '10.04'),
82+ ('Maverick Meerkat', SeriesStatus.DEVELOPMENT, '10.10'),
83 ]
84
85 parent = original_series