Merge lp:~wgrant/launchpad/destroy-publishedpackage into lp:launchpad/db-devel

Proposed by William Grant
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 9628
Proposed branch: lp:~wgrant/launchpad/destroy-publishedpackage
Merge into: lp:launchpad/db-devel
Diff against target: 562 lines (+46/-299)
17 files modified
cronscripts/create-debwatches.py (+3/-3)
database/schema/comments.sql (+0/-8)
database/schema/patch-2207-80-0.sql (+8/-0)
database/schema/security.cfg (+0/-2)
lib/canonical/launchpad/browser/__init__.py (+0/-1)
lib/canonical/launchpad/database/__init__.py (+0/-1)
lib/canonical/launchpad/interfaces/__init__.py (+0/-1)
lib/lp/registry/browser/distribution.py (+1/-7)
lib/lp/registry/interfaces/distroseries.py (+0/-6)
lib/lp/registry/model/distribution.py (+34/-27)
lib/lp/registry/model/distroseries.py (+0/-11)
lib/lp/soyuz/configure.zcml (+0/-28)
lib/lp/soyuz/doc/publishedpackage.txt (+0/-32)
lib/lp/soyuz/interfaces/distroseriessourcepackagerelease.py (+0/-4)
lib/lp/soyuz/interfaces/publishedpackage.py (+0/-63)
lib/lp/soyuz/model/distroseriessourcepackagerelease.py (+0/-9)
lib/lp/soyuz/model/publishedpackage.py (+0/-96)
To merge this branch: bzr merge lp:~wgrant/launchpad/destroy-publishedpackage
Reviewer Review Type Date Requested Status
Stuart Bishop (community) db Approve
Robert Collins (community) Approve
Launchpad code reviewers Pending
Review via email: mp+31813@code.launchpad.net

Commit message

Distribution.guessPackageNames is now much faster, and the mammoth PublishedPackage view is gone.

Description of the change

Bug #608037 and bug #609012 are partially caused by the slowness of Distribution.guessPackageNames. It's slow because it uses the PublishedPackage view, which joins some 13 tables together, many of which are irrelevant.

I've fixed Distribution.guessPackageNames to construct queries over the base tables, avoiding the massive view. This removes most of the joins, resulting in a much more pleasant query plan.

It turns out that the method was one of just two remaining users of PublishedPackage: the other being create-debwatches.py, which was created five years ago and hasn't ever been used, and has no tests. It also seems to be somewhat broken, so I just ported it to an equivalent method and am going to pretend that it still works.

With all the users gone, I've also dropped the PublishedPackage view and code itself.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

So this drops the metadata, but won't actually drop the view - I presume you're going to merge to devel to fix the oops, and separately merge a 'drop the view' db patch to db-devel? Except, oddly, this is proposed to db-devel.

So I suggest you do the above :)

Other than that, great.

review: Needs Fixing
Revision history for this message
William Grant (wgrant) wrote :

I forgot to bzr add the DB patch. Fixed.

Revision history for this message
Robert Collins (lifeless) wrote :

Looks good to me

review: Approve
Revision history for this message
Stuart Bishop (stub) wrote :

DB patch is fine. patch-2207-80-0.sql

review: Approve (db)
Revision history for this message
Stuart Bishop (stub) wrote :

Code changes look good.

The queries in lib/lp/registry/model/distribution.py used to return 'latest' and now return 'first' - previously they were sorting by id descending and now ascending. This may be a bug.

Revision history for this message
William Grant (wgrant) wrote :

It doesn't matter at all, as it turns out. I've replaced it with an any().

Revision history for this message
Julian Edwards (julian-edwards) wrote :

I am so happy to see another view biting the dust.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cronscripts/create-debwatches.py'
2--- cronscripts/create-debwatches.py 2010-04-27 19:48:39 +0000
3+++ cronscripts/create-debwatches.py 2010-08-05 22:12:56 +0000
4@@ -77,9 +77,9 @@
5
6 # first find all the published ubuntu packages
7 ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
8- for p in ubuntu.currentrelease.publishedBinaryPackages(
9- component='main'):
10- target_package_set.add(p.binarypackagename.name)
11+ for p in ubuntu.currentrelease.getAllPublishedBinaries():
12+ target_package_set.add(
13+ p.binarypackagerelease.binarypackagename.name)
14 # then add packages passed on the command line
15 for package in self.options.packages:
16 target_package_set.add(package)
17
18=== modified file 'database/schema/comments.sql'
19--- database/schema/comments.sql 2010-08-05 02:29:25 +0000
20+++ database/schema/comments.sql 2010-08-05 22:12:56 +0000
21@@ -1113,14 +1113,6 @@
22 COMMENT ON COLUMN BinaryPackagePublishingHistory.removed_by IS 'Person responsible for the removal.';
23 COMMENT ON COLUMN BinaryPackagePublishingHistory.removal_comment IS 'Reason why the publication was removed.';
24
25--- PublishedPackage View
26-
27-COMMENT ON VIEW PublishedPackage IS
28- 'A very large view that brings together all the information about
29- packages that are currently being published within a distribution. This
30- view was designed for the page which shows packages published in the
31- distribution, but may be more widely used.';
32-
33 -- ProcessorFamily
34
35 COMMENT ON TABLE ProcessorFamily IS 'An architecture, that might consist of several actual processors. Different distributions call these architectures different things, so we have an "architecturetag" in DistroArchSeries that might be different to the architecture''s name.';
36
37=== added file 'database/schema/patch-2207-80-0.sql'
38--- database/schema/patch-2207-80-0.sql 1970-01-01 00:00:00 +0000
39+++ database/schema/patch-2207-80-0.sql 2010-08-05 22:12:56 +0000
40@@ -0,0 +1,8 @@
41+-- Copyright 2010 Canonical Ltd. This software is licensed under the
42+-- GNU Affero General Public License version 3 (see the file LICENSE).
43+
44+SET client_min_messages=ERROR;
45+
46+DROP VIEW PublishedPackage;
47+
48+INSERT INTO LaunchpadDatabaseRevision VALUES (2207, 80, 0);
49
50=== modified file 'database/schema/security.cfg'
51--- database/schema/security.cfg 2010-08-03 11:15:14 +0000
52+++ database/schema/security.cfg 2010-08-05 22:12:56 +0000
53@@ -859,7 +859,6 @@
54 public.sourcepackagerecipebuildjob = SELECT, INSERT, UPDATE, DELETE
55 public.sourcepackagerecipedata = SELECT
56 public.sourcepackagerecipedatainstruction = SELECT
57-public.publishedpackage = SELECT
58 public.person = SELECT
59 public.emailaddress = SELECT
60 public.teammembership = SELECT
61@@ -975,7 +974,6 @@
62 public.productsvnmodule = SELECT, INSERT, UPDATE
63 public.project = SELECT, INSERT, UPDATE
64 public.projectrelationship = SELECT, INSERT, UPDATE
65-public.publishedpackage = SELECT
66 public.pushmirroraccess = SELECT, INSERT, UPDATE
67 public.section = SELECT, INSERT, UPDATE
68 public.sectionselection = SELECT, INSERT, UPDATE
69
70=== modified file 'lib/canonical/launchpad/browser/__init__.py'
71--- lib/canonical/launchpad/browser/__init__.py 2010-04-01 18:47:24 +0000
72+++ lib/canonical/launchpad/browser/__init__.py 2010-08-05 22:12:56 +0000
73@@ -46,7 +46,6 @@
74 from canonical.launchpad.browser.packagerelationship import *
75 from lp.registry.browser.peoplemerge import *
76 from lp.registry.browser.poll import *
77-from lp.soyuz.browser.publishedpackage import *
78 from lp.soyuz.browser.publishing import *
79 from lp.answers.browser.question import *
80 from lp.answers.browser.questiontarget import *
81
82=== modified file 'lib/canonical/launchpad/database/__init__.py'
83--- lib/canonical/launchpad/database/__init__.py 2010-04-12 08:29:02 +0000
84+++ lib/canonical/launchpad/database/__init__.py 2010-08-05 22:12:56 +0000
85@@ -11,7 +11,6 @@
86 from lp.soyuz.model.sourcepackagerelease import *
87 from lp.soyuz.model.binarypackagerelease import *
88 from lp.soyuz.model.binarypackagename import *
89-from lp.soyuz.model.publishedpackage import *
90 from lp.soyuz.model.distributionsourcepackagerelease import *
91 from lp.soyuz.model.distroseriesbinarypackage import *
92 from lp.soyuz.model.distroseriespackagecache import *
93
94=== modified file 'lib/canonical/launchpad/interfaces/__init__.py'
95--- lib/canonical/launchpad/interfaces/__init__.py 2010-07-07 19:41:07 +0000
96+++ lib/canonical/launchpad/interfaces/__init__.py 2010-08-05 22:12:56 +0000
97@@ -102,7 +102,6 @@
98 from lp.registry.interfaces.productrelease import *
99 from lp.registry.interfaces.productseries import *
100 from lp.registry.interfaces.projectgroup import *
101-from lp.soyuz.interfaces.publishedpackage import *
102 from lp.soyuz.interfaces.publishing import *
103 from lp.soyuz.interfaces.queue import *
104 from canonical.launchpad.interfaces.schema import *
105
106=== modified file 'lib/lp/registry/browser/distribution.py'
107--- lib/lp/registry/browser/distribution.py 2010-08-02 02:13:52 +0000
108+++ lib/lp/registry/browser/distribution.py 2010-08-05 22:12:56 +0000
109@@ -71,15 +71,13 @@
110 IDistributionMirrorSet, MirrorContent, MirrorSpeed)
111 from lp.registry.interfaces.series import SeriesStatus
112 from lp.registry.interfaces.product import IProduct
113-from lp.soyuz.interfaces.publishedpackage import (
114- IPublishedPackageSet)
115 from lp.registry.browser.structuralsubscription import (
116 StructuralSubscriptionTargetTraversalMixin)
117 from canonical.launchpad.webapp import (
118 action, ApplicationMenu, canonical_url, ContextMenu, custom_widget,
119 enabled_with_permission, GetitemNavigation,
120 LaunchpadFormView, LaunchpadView, Link, Navigation, redirection,
121- StandardLaunchpadFacets, stepthrough, stepto)
122+ StandardLaunchpadFacets, stepthrough)
123 from canonical.launchpad.webapp.interfaces import ILaunchBag
124 from canonical.launchpad.helpers import english_list
125 from canonical.launchpad.webapp import NavigationMenu
126@@ -134,10 +132,6 @@
127 def redirect_source(self):
128 return canonical_url(self.context)
129
130- @stepto('+packages')
131- def packages(self):
132- return getUtility(IPublishedPackageSet)
133-
134 @stepthrough('+mirror')
135 def traverse_mirrors(self, name):
136 return self.context.getMirrorByName(name)
137
138=== modified file 'lib/lp/registry/interfaces/distroseries.py'
139--- lib/lp/registry/interfaces/distroseries.py 2010-08-03 22:03:56 +0000
140+++ lib/lp/registry/interfaces/distroseries.py 2010-08-05 22:12:56 +0000
141@@ -554,12 +554,6 @@
142 Return a SelectResult of SourcePackagePublishingHistory.
143 """
144
145- def publishedBinaryPackages(component=None):
146- """Given an optional component name, return a list of the binary
147- packages that are currently published in this distroseries in the
148- given component, or in any component if no component name was given.
149- """
150-
151 def getDistroSeriesLanguage(language):
152 """Return the DistroSeriesLanguage for this distroseries and the
153 given language, or None if there's no DistroSeriesLanguage for this
154
155=== modified file 'lib/lp/registry/model/distribution.py'
156--- lib/lp/registry/model/distribution.py 2010-08-04 09:39:04 +0000
157+++ lib/lp/registry/model/distribution.py 2010-08-05 22:12:56 +0000
158@@ -29,6 +29,7 @@
159 from canonical.launchpad.components.decoratedresultset import (
160 DecoratedResultSet)
161 from canonical.launchpad.components.storm_operators import FTQ, Match, RANK
162+from canonical.launchpad.interfaces.lpstorm import IStore
163 from canonical.lazr.utils import safe_hasattr
164 from lp.registry.model.announcement import MakesAnnouncements
165 from lp.soyuz.model.archive import Archive
166@@ -59,7 +60,6 @@
167 from lp.registry.model.milestone import (
168 HasMilestonesMixin, Milestone)
169 from lp.registry.model.pillar import HasAliasMixin
170-from lp.soyuz.model.publishedpackage import PublishedPackage
171 from lp.soyuz.model.publishing import (
172 BinaryPackageFilePublishing, BinaryPackagePublishingHistory,
173 SourcePackageFilePublishing, SourcePackagePublishingHistory)
174@@ -1172,6 +1172,18 @@
175 # instance, when people file bugs, it might actually be bad for
176 # us to allow them to be associated with obsolete packages.
177
178+ bpph_location_clauses = [
179+ DistroSeries.distribution == self,
180+ DistroArchSeries.distroseriesID == DistroSeries.id,
181+ BinaryPackagePublishingHistory.distroarchseriesID ==
182+ DistroArchSeries.id,
183+ BinaryPackagePublishingHistory.archiveID.is_in(
184+ self.all_distro_archive_ids),
185+ BinaryPackagePublishingHistory.dateremoved == None,
186+ BinaryPackageRelease.id ==
187+ BinaryPackagePublishingHistory.binarypackagereleaseID,
188+ ]
189+
190 sourcepackagename = SourcePackageName.selectOneBy(name=pkgname)
191 if sourcepackagename:
192 # Note that in the source package case, we don't restrict
193@@ -1197,20 +1209,20 @@
194 if publishing is not None:
195 # Attempt to find a published binary package of the
196 # same name.
197- publishedpackage = PublishedPackage.selectFirst('''
198- PublishedPackage.sourcepackagename = %s AND
199- PublishedPackage.binarypackagename = %s AND
200- PublishedPackage.distribution = %s AND
201- PublishedPackage.archive IN %s
202- ''' % sqlvalues(sourcepackagename.name,
203- sourcepackagename.name,
204- self,
205- self.all_distro_archive_ids),
206- orderBy=['-id'])
207- if publishedpackage is not None:
208- binarypackagename = BinaryPackageName.byName(
209- publishedpackage.binarypackagename)
210- return (sourcepackagename, binarypackagename)
211+ bpph = IStore(BinaryPackagePublishingHistory).find(
212+ BinaryPackagePublishingHistory,
213+ BinaryPackageRelease.binarypackagename ==
214+ BinaryPackageName.id,
215+ BinaryPackageName.name == sourcepackagename.name,
216+ BinaryPackageBuild.id == BinaryPackageRelease.buildID,
217+ SourcePackageRelease.id ==
218+ BinaryPackageBuild.source_package_release_id,
219+ SourcePackageRelease.sourcepackagename ==
220+ sourcepackagename,
221+ *bpph_location_clauses).any()
222+ if bpph is not None:
223+ bpr = bpph.binarypackagerelease
224+ return (sourcepackagename, bpr.binarypackagename)
225 # No binary with a similar name, so just return None
226 # rather than returning some arbitrary binary package.
227 return (sourcepackagename, None)
228@@ -1224,18 +1236,13 @@
229 # latest publication in the distribution (this may be an old
230 # package name the end-user is groping for) -- and then get
231 # the sourcepackagename from that.
232- publishing = PublishedPackage.selectFirst('''
233- PublishedPackage.binarypackagename = %s AND
234- PublishedPackage.distribution = %s AND
235- PublishedPackage.archive IN %s
236- ''' % sqlvalues(binarypackagename.name,
237- self,
238- self.all_distro_archive_ids),
239- orderBy=['-id'])
240- if publishing is not None:
241- sourcepackagename = SourcePackageName.byName(
242- publishing.sourcepackagename)
243- return (sourcepackagename, binarypackagename)
244+ bpph = IStore(BinaryPackagePublishingHistory).find(
245+ BinaryPackagePublishingHistory,
246+ BinaryPackageRelease.binarypackagename == binarypackagename,
247+ *bpph_location_clauses).any()
248+ if bpph is not None:
249+ spr = bpph.binarypackagerelease.build.source_package_release
250+ return (spr.sourcepackagename, binarypackagename)
251
252 # We got nothing so signal an error.
253 if sourcepackagename is None:
254
255=== modified file 'lib/lp/registry/model/distroseries.py'
256--- lib/lp/registry/model/distroseries.py 2010-08-02 02:13:52 +0000
257+++ lib/lp/registry/model/distroseries.py 2010-08-05 22:12:56 +0000
258@@ -104,8 +104,6 @@
259 from lp.translations.interfaces.languagepack import LanguagePackType
260 from canonical.launchpad.interfaces.librarian import ILibraryFileAliasSet
261 from lp.soyuz.interfaces.queue import PackageUploadStatus
262-from lp.soyuz.interfaces.publishedpackage import (
263- IPublishedPackageSet)
264 from lp.soyuz.interfaces.publishing import (
265 active_publishing_status, ICanPublishPackages, PackagePublishingStatus)
266 from lp.soyuz.interfaces.queue import IHasQueueItems, IPackageUploadSet
267@@ -1093,15 +1091,6 @@
268
269 return result
270
271- def publishedBinaryPackages(self, component=None):
272- """See `IDistroSeries`."""
273- # XXX sabdfl 2005-07-04: This can become a utility when that works
274- # this is used by the debbugs import process, mkdebwatches
275- pubpkgset = getUtility(IPublishedPackageSet)
276- result = pubpkgset.query(distroseries=self, component=component)
277- return [BinaryPackageRelease.get(pubrecord.binarypackagerelease)
278- for pubrecord in result]
279-
280 def getBuildRecords(self, build_state=None, name=None, pocket=None,
281 arch_tag=None, user=None, binary_only=True):
282 """See IHasBuildRecords"""
283
284=== modified file 'lib/lp/soyuz/configure.zcml'
285--- lib/lp/soyuz/configure.zcml 2010-07-12 01:34:09 +0000
286+++ lib/lp/soyuz/configure.zcml 2010-08-05 22:12:56 +0000
287@@ -545,34 +545,6 @@
288 factory="canonical.launchpad.webapp.breadcrumb.NameBreadcrumb"
289 permission="zope.Public" />
290
291- <!-- PublishedPackage -->
292-
293- <class
294- class="canonical.launchpad.database.PublishedPackage">
295- <allow
296- interface="lp.soyuz.interfaces.publishedpackage.IPublishedPackage"/>
297- <require
298- permission="zope.Public"
299- set_schema="lp.soyuz.interfaces.publishedpackage.IPublishedPackage"/>
300- </class>
301-
302- <!-- PublishedPackageSet -->
303-
304- <class
305- class="canonical.launchpad.database.PublishedPackageSet">
306- <allow
307- interface="lp.soyuz.interfaces.publishedpackage.IPublishedPackageSet"/>
308- <require
309- permission="zope.Public"
310- set_schema="lp.soyuz.interfaces.publishedpackage.IPublishedPackageSet"/>
311- </class>
312- <securedutility
313- provides="lp.soyuz.interfaces.publishedpackage.IPublishedPackageSet"
314- class="canonical.launchpad.database.PublishedPackageSet">
315- <allow
316- interface="lp.soyuz.interfaces.publishedpackage.IPublishedPackageSet"/>
317- </securedutility>
318-
319 <!-- ArchiveSubscriber -->
320
321 <class
322
323=== removed file 'lib/lp/soyuz/doc/publishedpackage.txt'
324--- lib/lp/soyuz/doc/publishedpackage.txt 2009-04-28 12:59:43 +0000
325+++ lib/lp/soyuz/doc/publishedpackage.txt 1970-01-01 00:00:00 +0000
326@@ -1,32 +0,0 @@
327-= Published Package =
328-
329-This database view gives us information on which packages are published in
330-which distributions.
331-
332- >>> from zope.component import getUtility
333- >>> from canonical.launchpad.interfaces import IPublishedPackageSet
334- >>> pp_set = getUtility(IPublishedPackageSet)
335-
336- >>> from canonical.launchpad.webapp.testing import verifyObject
337- >>> verifyObject(IPublishedPackageSet, pp_set)
338- True
339-
340-IDistroSeriesSourcePackageRelease.meta_binaries returns a list of unique
341-binaries resulting from the sourcepackagerelease for a distroseries.
342-The source package mozilla-firefox has two unique binaries:
343-"mozilla-firefox-data" and "mozilla-firefox". Although the latter
344-is published twice in two architectures it is only returned once.
345-
346- >>> from canonical.launchpad.interfaces import IDistributionSet
347- >>> ubuntu = getUtility(IDistributionSet)['ubuntu']
348- >>> warty = ubuntu['warty']
349- >>> ff_sp = warty.getSourcePackage('mozilla-firefox')
350- >>> ff_drspr = ff_sp['0.9']
351- >>> for package in ff_drspr.meta_binaries:
352- ... print package.name
353- mozilla-firefox
354- mozilla-firefox-data
355-
356- >>> from canonical.launchpad.interfaces import IDistroSeriesBinaryPackage
357- >>> verifyObject(IDistroSeriesBinaryPackage, ff_drspr.meta_binaries[0])
358- True
359
360=== modified file 'lib/lp/soyuz/interfaces/distroseriessourcepackagerelease.py'
361--- lib/lp/soyuz/interfaces/distroseriessourcepackagerelease.py 2009-06-25 04:06:00 +0000
362+++ lib/lp/soyuz/interfaces/distroseriessourcepackagerelease.py 2010-08-05 22:12:56 +0000
363@@ -56,10 +56,6 @@
364 "Return binaries resulted from this sourcepackagerelease and "
365 "published in this distroseries.")
366
367- meta_binaries = Attribute(
368- "A list of distinct meta binaries built from this "
369- "sourcepackagerelease and published in this distroseries.")
370-
371 current_published = Attribute("is last SourcePackagePublishing record "
372 "that is in PUBLISHED status.")
373
374
375=== removed file 'lib/lp/soyuz/interfaces/publishedpackage.py'
376--- lib/lp/soyuz/interfaces/publishedpackage.py 2009-06-25 04:06:00 +0000
377+++ lib/lp/soyuz/interfaces/publishedpackage.py 1970-01-01 00:00:00 +0000
378@@ -1,63 +0,0 @@
379-# Copyright 2009 Canonical Ltd. This software is licensed under the
380-# GNU Affero General Public License version 3 (see the file LICENSE).
381-
382-# pylint: disable-msg=E0211,E0213
383-
384-"""Published package interfaces."""
385-
386-__metaclass__ = type
387-
388-__all__ = [
389- 'IPublishedPackage',
390- 'IPublishedPackageSet',
391- ]
392-
393-from zope.interface import Interface, Attribute
394-from canonical.launchpad import _
395-
396-
397-class IPublishedPackage(Interface):
398- """NOT A TABLE: this is a large database view which gives us a lot of
399- de-normalised, but very useful information about packages which have
400- been published in a distribution."""
401-
402- id = Attribute("The id of the packagepublishing record")
403- archive = Attribute("The archive where the package is published.")
404- distribution = Attribute("The distribution id")
405- distroarchseries = Attribute("The distroarchseries.")
406- distroseries = Attribute("The distribution series id")
407- distroseriesname = Attribute("The distribution series name")
408- processorfamily = Attribute("The processor family id")
409- processorfamilyname = Attribute("The processor family name")
410- packagepublishingstatus = Attribute("The status of this published package")
411- component = Attribute("The component in which the package has been published")
412- section = Attribute("The section in which it is published.")
413- binarypackagerelease = Attribute("The id of the binary package in question")
414- binarypackagename = Attribute("The binary package name")
415- binarypackagesummary = Attribute("The binary package summary")
416- binarypackagedescription = Attribute("The binary package description")
417- binarypackageversion = Attribute("The binary package version")
418- build = Attribute("The build id")
419- datebuilt = Attribute("The date this package was built or uploaded")
420- sourcepackagerelease = Attribute("Source package release id")
421- sourcepackagereleaseversion = Attribute("Source package release version")
422- sourcepackagename = Attribute("Source package name")
423-
424-
425-class IPublishedPackageSet(Interface):
426- """The set of packages that are published across all distributions"""
427-
428- def __iter__():
429- """Iterate over all published packages."""
430-
431- def query(name=None, text=None, distribution=None, distroseries=None,
432- distroarchseries=None, component=None):
433- """Search through published packages returning those that meet the
434- given criteria"""
435-
436- def findDepCandidate(name, distroarchseries):
437- """Return the package candidate within the distroarchseries context.
438-
439- Return the PublishedPackage record by bynarypackagename or None if
440- not found.
441- """
442
443=== modified file 'lib/lp/soyuz/model/distroseriessourcepackagerelease.py'
444--- lib/lp/soyuz/model/distroseriessourcepackagerelease.py 2010-05-14 07:20:41 +0000
445+++ lib/lp/soyuz/model/distroseriessourcepackagerelease.py 2010-08-05 22:12:56 +0000
446@@ -147,15 +147,6 @@
447 distinct=True)
448
449 @property
450- def meta_binaries(self):
451- """See `IDistroSeriesSourcePackageRelease`."""
452- binary_pkg_names = sorted(
453- set([pkg.binarypackagename for pkg in self.binaries]),
454- key=attrgetter('name'))
455- return [self.distroseries.getBinaryPackage(name)
456- for name in binary_pkg_names]
457-
458- @property
459 def changesfile(self):
460 """See `IDistroSeriesSourcePackageRelease`."""
461 return self.sourcepackagerelease.upload_changesfile
462
463=== removed file 'lib/lp/soyuz/model/publishedpackage.py'
464--- lib/lp/soyuz/model/publishedpackage.py 2010-04-12 11:37:48 +0000
465+++ lib/lp/soyuz/model/publishedpackage.py 1970-01-01 00:00:00 +0000
466@@ -1,96 +0,0 @@
467-# Copyright 2009 Canonical Ltd. This software is licensed under the
468-# GNU Affero General Public License version 3 (see the file LICENSE).
469-
470-# pylint: disable-msg=E0611,W0212
471-
472-__metaclass__ = type
473-__all__ = ['PublishedPackage', 'PublishedPackageSet']
474-
475-from zope.interface import implements
476-
477-from sqlobject import StringCol, ForeignKey
478-
479-from canonical.database.sqlbase import SQLBase, quote, quote_like
480-from canonical.database.datetimecol import UtcDateTimeCol
481-from canonical.database.enumcol import EnumCol
482-
483-from lp.soyuz.interfaces.publishedpackage import (
484- IPublishedPackage, IPublishedPackageSet)
485-from lp.soyuz.interfaces.publishing import PackagePublishingStatus
486-
487-
488-class PublishedPackage(SQLBase):
489- """See IPublishedPackage for details."""
490-
491- implements(IPublishedPackage)
492-
493- _table = 'PublishedPackage'
494-
495- archive = ForeignKey(
496- dbName='archive', foreignKey='Archive', immutable=True)
497- distribution = ForeignKey(dbName='distribution',
498- foreignKey='Distribution',
499- immutable=True)
500- distroarchseries = ForeignKey(dbName='distroarchseries',
501- foreignKey='DistroArchSeries',
502- immutable=True)
503- distroseries = ForeignKey(dbName='distroseries',
504- foreignKey='DistroSeries',
505- immutable=True)
506- distroseriesname = StringCol(dbName='distroseriesname', immutable=True)
507- processorfamily = ForeignKey(dbName="processorfamily",
508- foreignKey="ProcessorFamily",
509- immutable=True)
510- processorfamilyname = StringCol(immutable=True)
511- packagepublishingstatus = EnumCol(immutable=True,
512- schema=PackagePublishingStatus)
513- component = StringCol(immutable=True)
514- section = StringCol(immutable=True)
515- binarypackagerelease = ForeignKey(dbName="binarypackagerelease",
516- foreignKey="BinaryPackageRelease",
517- immutable=True)
518- binarypackagename = StringCol(immutable=True)
519- binarypackagesummary = StringCol(immutable=True)
520- binarypackagedescription = StringCol(immutable=True)
521- binarypackageversion = StringCol(immutable=True)
522- build = ForeignKey(foreignKey='BinaryPackageBuild', dbName='build')
523- datebuilt = UtcDateTimeCol(immutable=True)
524- sourcepackagerelease = ForeignKey(dbName="sourcepackagerelease",
525- foreignKey="SourcePackageRelease",
526- immutable=True)
527- sourcepackagereleaseversion = StringCol(immutable=True)
528- sourcepackagename = StringCol(immutable=True)
529-
530-
531-class PublishedPackageSet:
532-
533- implements(IPublishedPackageSet)
534-
535- def __iter__(self):
536- return iter(PublishedPackage.select())
537-
538- def query(self, name=None, text=None, distribution=None,
539- distroseries=None, distroarchseries=None, component=None):
540- queries = []
541- if name:
542- name = name.lower().strip().split()[0]
543- queries.append("binarypackagename ILIKE '%%' || %s || '%%'"
544- % quote_like(name))
545- if distribution:
546- queries.append("distribution = %d" % distribution.id)
547- if distroseries:
548- queries.append("distroseries = %d" % distroseries.id)
549- if distroarchseries:
550- queries.append("distroarchseries = %d" % distroarchseries.id)
551- if component:
552- queries.append("component = %s" % quote(component))
553- if text:
554- text = text.lower().strip()
555- queries.append("binarypackagefti @@ ftq(%s)" % quote(text))
556- return PublishedPackage.select(
557- " AND ".join(queries), orderBy=['-datebuilt',])
558-
559- def findDepCandidate(self, name, distroarchseries):
560- """See IPublishedSet."""
561- return PublishedPackage.selectOneBy(binarypackagename=name,
562- distroarchseries=distroarchseries)

Subscribers

People subscribed via source and target branches

to status/vote changes: