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
=== modified file 'lib/canonical/buildd/buildrecipe'
--- lib/canonical/buildd/buildrecipe 2010-06-30 16:05:20 +0000
+++ lib/canonical/buildd/buildrecipe 2010-07-23 16:16:06 +0000
@@ -53,8 +53,10 @@
5353
54 :return: A retcode from apt.54 :return: A retcode from apt.
55 """55 """
56 # XXX: AaronBentley 2010-07-07 bug=602463: pbuilder uses aptitude but
57 # does not depend on it.
56 return self.chroot(['apt-get', 'install', '-y', 'pbuilder',58 return self.chroot(['apt-get', 'install', '-y', 'pbuilder',
57 'bzr-builder', 'sudo'])59 'bzr-builder', 'sudo', 'aptitude'])
5860
59 def buildTree(self):61 def buildTree(self):
60 """Build the recipe into a source tree.62 """Build the recipe into a source tree.
@@ -67,12 +69,21 @@
67 self.tree_path_relative = os.path.join(self.work_dir_relative, 'tree')69 self.tree_path_relative = os.path.join(self.work_dir_relative, 'tree')
68 manifest_path_relative = os.path.join(70 manifest_path_relative = os.path.join(
69 self.tree_path_relative, 'manifest')71 self.tree_path_relative, 'manifest')
72 recipe_path = os.path.join(self.chroot_path, recipe_path_relative[1:])
73 recipe_file = open(recipe_path, 'rb')
74 try:
75 recipe = recipe_file.read()
76 finally:
77 recipe_file.close()
78 print 'Building recipe:'
79 print recipe
70 retcode = self.chroot([80 retcode = self.chroot([
71 'sudo', '-u', self.username, 'DEBEMAIL=%s' % self.author_email,81 'sudo', '-iu', self.username, 'DEBEMAIL=%s' % self.author_email,
72 'DEBFULLNAME=%s' % self.author_name.encode('utf-8'), 'bzr',82 'DEBFULLNAME=%s' % self.author_name.encode('utf-8'), 'bzr',
73 'dailydeb', '--no-build', recipe_path_relative,83 'dailydeb', '--no-build', recipe_path_relative,
74 self.tree_path_relative, '--manifest', manifest_path_relative,84 self.tree_path_relative, '--manifest', manifest_path_relative,
75 '--append-version', '~%s1' % self.distroseries_name])85 '--append-version', '~%s1' % self.distroseries_name],
86 echo=True)
76 if retcode != 0:87 if retcode != 0:
77 return retcode88 return retcode
78 (source,) = [name for name in os.listdir(self.tree_path)89 (source,) = [name for name in os.listdir(self.tree_path)
@@ -106,12 +117,15 @@
106 '/usr/lib/pbuilder/pbuilder-satisfydepends'117 '/usr/lib/pbuilder/pbuilder-satisfydepends'
107 % self.source_dir_relative])118 % self.source_dir_relative])
108119
109 def chroot(self, args):120 def chroot(self, args, echo=False):
110 """Run a command in the chroot.121 """Run a command in the chroot.
111122
112 :param args: the command and arguments to run.123 :param args: the command and arguments to run.
113 :return: the status code.124 :return: the status code.
114 """125 """
126 if echo:
127 print "Running in chroot: %s" % ' '.join(
128 "'%s'" % arg for arg in args)
115 return call([129 return call([
116 '/usr/bin/sudo', '/usr/sbin/chroot', self.chroot_path] + args)130 '/usr/bin/sudo', '/usr/sbin/chroot', self.chroot_path] + args)
117131
118132
=== modified file 'lib/canonical/buildd/test_buildd_recipe'
--- lib/canonical/buildd/test_buildd_recipe 2010-06-30 16:05:20 +0000
+++ lib/canonical/buildd/test_buildd_recipe 2010-07-23 16:16:06 +0000
@@ -7,7 +7,7 @@
77
8country_code = 'us'8country_code = 'us'
9apt_cacher_ng_host = 'stumpy'9apt_cacher_ng_host = 'stumpy'
10distroseries_name = 'lucid'10distroseries_name = 'maverick'
11recipe_text = """# bzr-builder format 0.2 deb-version 0+{revno}11recipe_text = """# bzr-builder format 0.2 deb-version 0+{revno}
12http://bazaar.launchpad.dev/~ppa-user/+junk/wakeonlan"""12http://bazaar.launchpad.dev/~ppa-user/+junk/wakeonlan"""
1313
1414
=== modified file 'utilities/soyuz-sampledata-setup.py'
--- utilities/soyuz-sampledata-setup.py 2010-04-27 19:48:39 +0000
+++ utilities/soyuz-sampledata-setup.py 2010-07-23 16:16:06 +0000
@@ -271,8 +271,9 @@
271 ('Hardy Heron', SeriesStatus.SUPPORTED, '8.04'),271 ('Hardy Heron', SeriesStatus.SUPPORTED, '8.04'),
272 ('Intrepid Ibex', SeriesStatus.SUPPORTED, '8.10'),272 ('Intrepid Ibex', SeriesStatus.SUPPORTED, '8.10'),
273 ('Jaunty Jackalope', SeriesStatus.SUPPORTED, '9.04'),273 ('Jaunty Jackalope', SeriesStatus.SUPPORTED, '9.04'),
274 ('Karmic Koala', SeriesStatus.CURRENT, '9.10'),274 ('Karmic Koala', SeriesStatus.SUPPORTED, '9.10'),
275 ('Lucid Lynx', SeriesStatus.DEVELOPMENT, '10.04'),275 ('Lucid Lynx', SeriesStatus.CURRENT, '10.04'),
276 ('Maverick Meerkat', SeriesStatus.DEVELOPMENT, '10.10'),
276 ]277 ]
277278
278 parent = original_series279 parent = original_series