~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/model/publishing.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-10-18 02:23:28 UTC
  • mfrom: (14160.1.1 revert-14159)
  • Revision ID: launchpad@pqm.canonical.com-20111018022328-df06z8v14wczkhsk
[r=wgrant][rollback=14159] Revert r14159. It breaks domination
        between arch-indep and arch-specific binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    Desc,
34
34
    LeftJoin,
35
35
    Or,
36
 
    Select,
37
36
    Sum,
38
37
    )
39
38
from storm.store import Store
1119
1118
                section=self.section,
1120
1119
                priority=self.priority)
1121
1120
 
1122
 
    def getOtherPublicationsForSameSource(self, include_archindep=False):
1123
 
        """Return all the other published or pending binaries for this
1124
 
        source.
1125
 
 
1126
 
        For example if source package foo builds:
1127
 
        foo - i386
1128
 
        foo - amd64
1129
 
        foo-common - arch-all (published in i386 and amd64)
1130
 
        then if this publication is the arch-all amd64, return foo(i386),
1131
 
        foo(amd64). If include_archindep is True then also return
1132
 
        foo-common (i386)
1133
 
 
1134
 
        :param include_archindep: If True, return architecture independent
1135
 
            publications too. Defaults to False.
1136
 
 
1137
 
        :return: an iterable of `BinaryPackagePublishingHistory`
1138
 
        """
1139
 
        # Avoid circular wotsits.
1140
 
        from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
1141
 
        from lp.soyuz.model.distroarchseries import DistroArchSeries
1142
 
        from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
1143
 
        source_select = Select(
1144
 
            SourcePackageRelease.id,
1145
 
            And(
1146
 
                BinaryPackageBuild.source_package_release_id ==
1147
 
                    SourcePackageRelease.id,
1148
 
                BinaryPackageRelease.build == BinaryPackageBuild.id,
1149
 
                self.binarypackagereleaseID == BinaryPackageRelease.id,
1150
 
            ))
1151
 
        pubs = [
1152
 
            BinaryPackageBuild.source_package_release_id ==
1153
 
                SourcePackageRelease.id,
1154
 
            SourcePackageRelease.id.is_in(source_select),
1155
 
            BinaryPackageRelease.build == BinaryPackageBuild.id,
1156
 
            BinaryPackagePublishingHistory.binarypackagereleaseID ==
1157
 
                BinaryPackageRelease.id,
1158
 
            BinaryPackagePublishingHistory.archiveID == self.archive.id,
1159
 
            BinaryPackagePublishingHistory.distroarchseriesID ==
1160
 
                DistroArchSeries.id,
1161
 
            DistroArchSeries.distroseriesID == self.distroseries.id,
1162
 
            BinaryPackagePublishingHistory.pocket == self.pocket,
1163
 
            BinaryPackagePublishingHistory.status.is_in(
1164
 
                active_publishing_status),
1165
 
            BinaryPackagePublishingHistory.id != self.id
1166
 
            ]
1167
 
 
1168
 
        if not include_archindep:
1169
 
            pubs.append(BinaryPackageRelease.architecturespecific == True)
1170
 
 
1171
 
        return IMasterStore(BinaryPackagePublishingHistory).find(
1172
 
            BinaryPackagePublishingHistory,
1173
 
            *pubs
1174
 
            )
1175
 
 
1176
1121
    def supersede(self, dominant=None, logger=None):
1177
1122
        """See `IBinaryPackagePublishingHistory`."""
1178
1123
        # At this point only PUBLISHED (ancient versions) or PENDING (