83
83
ICanGetMilestonesDirectly,
86
from lp.registry.interfaces.oopsreferences import IHasOOPSReferences
87
86
from lp.registry.interfaces.pillar import IPillar
88
87
from lp.registry.interfaces.role import (
89
88
IHasAppointedDriver,
135
134
class IDistributionPublic(
136
135
IBugTarget, ICanGetMilestonesDirectly, IHasAppointedDriver,
137
136
IHasBuildRecords, IHasDrivers, IHasMilestones,
138
IHasOOPSReferences, IHasOwner, IHasSecurityContact, IHasSprints,
139
IHasTranslationImports, ITranslationPolicy, IKarmaContext,
140
ILaunchpadUsage, IMakesAnnouncements, IOfficialBugTagTargetPublic,
141
IPillar, IServiceUsage, ISpecificationTarget):
137
IHasOwner, IHasSecurityContact, IHasSprints, IHasTranslationImports,
138
ITranslationPolicy, IKarmaContext, ILaunchpadUsage, IMakesAnnouncements,
139
IOfficialBugTagTargetPublic, IPillar, IServiceUsage,
140
ISpecificationTarget):
142
141
"""Public IDistribution properties."""
144
143
id = Attribute("The distro's unique number.")
212
211
exported_as='domain_name')
213
212
owner = exported(
214
213
PublicPersonChoice(
217
vocabulary='ValidPillarOwner',
218
description=_("The restricted team, moderated team, or person "
219
"who maintains the distribution information in "
214
title=_("Owner"), vocabulary='ValidOwner',
215
description=_("The distro's owner."), required=True))
221
216
registrant = exported(
222
217
PublicPersonChoice(
223
218
title=_("Registrant"), vocabulary='ValidPersonOrTeam',
287
282
uploaders = Attribute(_(
288
283
"ArchivePermission records for uploaders with rights to upload to "
289
284
"this distribution."))
290
package_derivatives_email = TextLine(
291
title=_("Package Derivatives Email Address"),
293
"The email address to send information about updates to packages "
294
"that are derived from another distribution. The sequence "
295
"{package_name} is replaced with the actual package name."),
299
287
currentseries = exported(
503
491
:return: list of `IDistroSeries`
494
def getSourcePackageCaches(archive=None):
495
"""The set of all source package info caches for this distribution.
497
If 'archive' is not given it will return all caches stored for the
498
distribution main archives (PRIMARY and PARTNER).
501
def removeOldCacheItems(archive, log):
502
"""Delete any cache records for removed packages.
504
Also purges all existing cache records for disabled archives.
506
:param archive: target `IArchive`.
507
:param log: the context logger object able to print DEBUG level
511
def updateCompleteSourcePackageCache(archive, log, ztm, commit_chunk=500):
512
"""Update the source package cache.
514
Consider every non-REMOVED sourcepackage and entirely skips updates
515
for disabled archives.
517
:param archive: target `IArchive`;
518
:param log: logger object for printing debug level information;
519
:param ztm: transaction used for partial commits, every chunk of
520
'commit_chunk' updates is committed;
521
:param commit_chunk: number of updates before commit, defaults to 500.
523
:return the number packages updated done
526
def updateSourcePackageCache(sourcepackagename, archive, log):
527
"""Update cached source package details.
529
Update cache details for a given ISourcePackageName, including
530
generated binarypackage names, summary and description fti.
531
'log' is required and only prints debug level information.
506
534
@rename_parameters_as(text="source_match")
507
535
@operation_parameters(
508
536
text=TextLine(title=_("Source package name substring match"),
550
578
(a substring of) their binary package names.
581
def searchBinaryPackagesFTI(package_name):
582
"""Do an FTI search on binary packages.
584
:param package_name: The binary package name to search for.
585
:return: A result set containing DistributionSourcePackageCache
586
objects for the matching binaries found via an FTI search on
587
DistroSeriesPackageCache.
590
def getFileByName(filename, archive=None, source=True, binary=True):
591
"""Find and return a LibraryFileAlias for the filename supplied.
593
The file returned will be one of those published in the distribution.
595
If searching both source and binary, and the file is found in the
596
binary packages it'll return that over a file for a source package.
598
If 'archive' is not passed the distribution.main_archive is assumed.
600
At least one of source and binary must be true.
602
Raises NotFoundError if it fails to find the named file.
553
605
def guessPublishedSourcePackageName(pkgname):
554
606
"""Return the "published" SourcePackageName related to pkgname.