Merge ~cjwatson/launchpad:stormify-package-files into launchpad:master
- Git
- lp:~cjwatson/launchpad
- stormify-package-files
- Merge into master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 919ae1629fe04722bf7c50c05830c2ec7df6b9c1 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:stormify-package-files |
Merge into: | launchpad:master |
Diff against target: |
638 lines (+118/-87) 18 files modified
lib/lp/archivepublisher/artifactory.py (+2/-2) lib/lp/archivepublisher/deathrow.py (+2/-2) lib/lp/archivepublisher/model/ftparchive.py (+4/-4) lib/lp/registry/doc/distribution-mirror.rst (+7/-2) lib/lp/registry/model/distributionmirror.py (+1/-1) lib/lp/services/librarian/model.py (+11/-11) lib/lp/soyuz/browser/queue.py (+3/-3) lib/lp/soyuz/doc/build-files.rst (+1/-1) lib/lp/soyuz/doc/gina.rst (+4/-2) lib/lp/soyuz/interfaces/files.py (+3/-3) lib/lp/soyuz/model/archive.py (+16/-16) lib/lp/soyuz/model/binarypackagebuild.py (+4/-4) lib/lp/soyuz/model/files.py (+39/-17) lib/lp/soyuz/model/packagediff.py (+2/-2) lib/lp/soyuz/model/publishing.py (+15/-13) lib/lp/soyuz/model/sourcepackagerelease.py (+2/-2) lib/lp/soyuz/scripts/expire_archive_files.py (+1/-1) lib/lp/soyuz/scripts/gina/handlers.py (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guruprasad | Approve | ||
Review via email: mp+436063@code.launchpad.net |
Commit message
Convert SourcePackageRe
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/lib/lp/archivepublisher/artifactory.py b/lib/lp/archivepublisher/artifactory.py | |||
2 | index 5e81ee6..041e73e 100644 | |||
3 | --- a/lib/lp/archivepublisher/artifactory.py | |||
4 | +++ b/lib/lp/archivepublisher/artifactory.py | |||
5 | @@ -142,11 +142,11 @@ class ArtifactoryPoolEntry: | |||
6 | 142 | """ | 142 | """ |
7 | 143 | if ISourcePackageReleaseFile.providedBy(pub_file): | 143 | if ISourcePackageReleaseFile.providedBy(pub_file): |
8 | 144 | return "source:{:d}".format( | 144 | return "source:{:d}".format( |
10 | 145 | pub_file.sourcepackagereleaseID | 145 | pub_file.sourcepackagerelease_id |
11 | 146 | ) # type: ignore | 146 | ) # type: ignore |
12 | 147 | elif IBinaryPackageFile.providedBy(pub_file): | 147 | elif IBinaryPackageFile.providedBy(pub_file): |
13 | 148 | return "binary:{:d}".format( | 148 | return "binary:{:d}".format( |
15 | 149 | pub_file.binarypackagereleaseID | 149 | pub_file.binarypackagerelease_id |
16 | 150 | ) # type: ignore | 150 | ) # type: ignore |
17 | 151 | else: | 151 | else: |
18 | 152 | raise AssertionError("Unsupported file: %r" % pub_file) | 152 | raise AssertionError("Unsupported file: %r" % pub_file) |
19 | diff --git a/lib/lp/archivepublisher/deathrow.py b/lib/lp/archivepublisher/deathrow.py | |||
20 | index 2d885e9..80f463e 100644 | |||
21 | --- a/lib/lp/archivepublisher/deathrow.py | |||
22 | +++ b/lib/lp/archivepublisher/deathrow.py | |||
23 | @@ -178,7 +178,7 @@ class DeathRow: | |||
24 | 178 | SourcePackagePublishingHistory.archive == self.archive, | 178 | SourcePackagePublishingHistory.archive == self.archive, |
25 | 179 | SourcePackagePublishingHistory.dateremoved == None, | 179 | SourcePackagePublishingHistory.dateremoved == None, |
26 | 180 | SourcePackagePublishingHistory.sourcepackagerelease | 180 | SourcePackagePublishingHistory.sourcepackagerelease |
28 | 181 | == SourcePackageReleaseFile.sourcepackagereleaseID, | 181 | == SourcePackageReleaseFile.sourcepackagerelease_id, |
29 | 182 | SourcePackageReleaseFile.libraryfile | 182 | SourcePackageReleaseFile.libraryfile |
30 | 183 | == LibraryFileAlias.id, | 183 | == LibraryFileAlias.id, |
31 | 184 | ] | 184 | ] |
32 | @@ -189,7 +189,7 @@ class DeathRow: | |||
33 | 189 | BinaryPackagePublishingHistory.archive == self.archive, | 189 | BinaryPackagePublishingHistory.archive == self.archive, |
34 | 190 | BinaryPackagePublishingHistory.dateremoved == None, | 190 | BinaryPackagePublishingHistory.dateremoved == None, |
35 | 191 | BinaryPackagePublishingHistory.binarypackagerelease | 191 | BinaryPackagePublishingHistory.binarypackagerelease |
37 | 192 | == BinaryPackageFile.binarypackagereleaseID, | 192 | == BinaryPackageFile.binarypackagerelease_id, |
38 | 193 | BinaryPackageFile.libraryfile == LibraryFileAlias.id, | 193 | BinaryPackageFile.libraryfile == LibraryFileAlias.id, |
39 | 194 | ] | 194 | ] |
40 | 195 | ) | 195 | ) |
41 | diff --git a/lib/lp/archivepublisher/model/ftparchive.py b/lib/lp/archivepublisher/model/ftparchive.py | |||
42 | index 710fee5..a891a85 100644 | |||
43 | --- a/lib/lp/archivepublisher/model/ftparchive.py | |||
44 | +++ b/lib/lp/archivepublisher/model/ftparchive.py | |||
45 | @@ -671,11 +671,11 @@ class FTPArchiveHandler: | |||
46 | 671 | Component.name, | 671 | Component.name, |
47 | 672 | ) | 672 | ) |
48 | 673 | join_conditions = [ | 673 | join_conditions = [ |
50 | 674 | SourcePackageReleaseFile.sourcepackagereleaseID | 674 | SourcePackageReleaseFile.sourcepackagerelease_id |
51 | 675 | == SourcePackagePublishingHistory.sourcepackagereleaseID, | 675 | == SourcePackagePublishingHistory.sourcepackagereleaseID, |
52 | 676 | SourcePackageName.id | 676 | SourcePackageName.id |
53 | 677 | == SourcePackagePublishingHistory.sourcepackagenameID, | 677 | == SourcePackagePublishingHistory.sourcepackagenameID, |
55 | 678 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfileID, | 678 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfile_id, |
56 | 679 | Component.id == SourcePackagePublishingHistory.component_id, | 679 | Component.id == SourcePackagePublishingHistory.component_id, |
57 | 680 | ] | 680 | ] |
58 | 681 | select_conditions = [ | 681 | select_conditions = [ |
59 | @@ -713,11 +713,11 @@ class FTPArchiveHandler: | |||
60 | 713 | join_conditions = [ | 713 | join_conditions = [ |
61 | 714 | BinaryPackageRelease.id | 714 | BinaryPackageRelease.id |
62 | 715 | == BinaryPackagePublishingHistory.binarypackagereleaseID, | 715 | == BinaryPackagePublishingHistory.binarypackagereleaseID, |
64 | 716 | BinaryPackageFile.binarypackagereleaseID | 716 | BinaryPackageFile.binarypackagerelease_id |
65 | 717 | == BinaryPackagePublishingHistory.binarypackagereleaseID, | 717 | == BinaryPackagePublishingHistory.binarypackagereleaseID, |
66 | 718 | BinaryPackageBuild.id == BinaryPackageRelease.buildID, | 718 | BinaryPackageBuild.id == BinaryPackageRelease.buildID, |
67 | 719 | SourcePackageName.id == BinaryPackageBuild.source_package_name_id, | 719 | SourcePackageName.id == BinaryPackageBuild.source_package_name_id, |
69 | 720 | LibraryFileAlias.id == BinaryPackageFile.libraryfileID, | 720 | LibraryFileAlias.id == BinaryPackageFile.libraryfile_id, |
70 | 721 | DistroArchSeries.id | 721 | DistroArchSeries.id |
71 | 722 | == BinaryPackagePublishingHistory.distroarchseriesID, | 722 | == BinaryPackagePublishingHistory.distroarchseriesID, |
72 | 723 | Component.id == BinaryPackagePublishingHistory.component_id, | 723 | Component.id == BinaryPackagePublishingHistory.component_id, |
73 | diff --git a/lib/lp/registry/doc/distribution-mirror.rst b/lib/lp/registry/doc/distribution-mirror.rst | |||
74 | index 412d2bc..5fd9798 100644 | |||
75 | --- a/lib/lp/registry/doc/distribution-mirror.rst | |||
76 | +++ b/lib/lp/registry/doc/distribution-mirror.rst | |||
77 | @@ -682,8 +682,13 @@ so we need to skip that upload. | |||
78 | 682 | ... time_interval, deb_only=False | 682 | ... time_interval, deb_only=False |
79 | 683 | ... ) | 683 | ... ) |
80 | 684 | 684 | ||
83 | 685 | >>> bpf = BinaryPackageFile.selectOneBy( | 685 | >>> bpf = ( |
84 | 686 | ... binarypackagereleaseID=upload.binarypackagerelease.id | 686 | ... IStore(BinaryPackageFile) |
85 | 687 | ... .find( | ||
86 | 688 | ... BinaryPackageFile, | ||
87 | 689 | ... binarypackagerelease=upload.binarypackagerelease, | ||
88 | 690 | ... ) | ||
89 | 691 | ... .one() | ||
90 | 687 | ... ) | 692 | ... ) |
91 | 688 | >>> print(upload.binarypackagerelease.version) | 693 | >>> print(upload.binarypackagerelease.version) |
92 | 689 | 3.14156 | 694 | 3.14156 |
93 | diff --git a/lib/lp/registry/model/distributionmirror.py b/lib/lp/registry/model/distributionmirror.py | |||
94 | index 317d440..7e350cf 100644 | |||
95 | --- a/lib/lp/registry/model/distributionmirror.py | |||
96 | +++ b/lib/lp/registry/model/distributionmirror.py | |||
97 | @@ -981,7 +981,7 @@ class MirrorDistroArchSeries(StormBase, _MirrorSeriesMixIn): | |||
98 | 981 | clauses.extend( | 981 | clauses.extend( |
99 | 982 | [ | 982 | [ |
100 | 983 | BinaryPackagePublishingHistory.binarypackagereleaseID | 983 | BinaryPackagePublishingHistory.binarypackagereleaseID |
102 | 984 | == BinaryPackageFile.binarypackagereleaseID, | 984 | == BinaryPackageFile.binarypackagerelease_id, |
103 | 985 | BinaryPackageFile.filetype == BinaryPackageFileType.DEB, | 985 | BinaryPackageFile.filetype == BinaryPackageFileType.DEB, |
104 | 986 | ] | 986 | ] |
105 | 987 | ) | 987 | ) |
106 | diff --git a/lib/lp/services/librarian/model.py b/lib/lp/services/librarian/model.py | |||
107 | index 210ffcf..7aaf5de 100644 | |||
108 | --- a/lib/lp/services/librarian/model.py | |||
109 | +++ b/lib/lp/services/librarian/model.py | |||
110 | @@ -16,7 +16,7 @@ from urllib.parse import urlparse | |||
111 | 16 | 16 | ||
112 | 17 | import pytz | 17 | import pytz |
113 | 18 | from lazr.delegates import delegate_to | 18 | from lazr.delegates import delegate_to |
115 | 19 | from storm.locals import Date, Desc, Int, Reference, Store | 19 | from storm.locals import Date, Desc, Int, Reference, ReferenceSet, Store |
116 | 20 | from zope.component import adapter, getUtility | 20 | from zope.component import adapter, getUtility |
117 | 21 | from zope.interface import Interface, implementer | 21 | from zope.interface import Interface, implementer |
118 | 22 | 22 | ||
119 | @@ -88,11 +88,11 @@ class LibraryFileAlias(SQLBase): | |||
120 | 88 | intermediateTable="ProductReleaseFile", | 88 | intermediateTable="ProductReleaseFile", |
121 | 89 | ) | 89 | ) |
122 | 90 | 90 | ||
128 | 91 | sourcepackages = SQLRelatedJoin( | 91 | sourcepackages = ReferenceSet( |
129 | 92 | "SourcePackageRelease", | 92 | "id", |
130 | 93 | joinColumn="libraryfile", | 93 | "SourcePackageReleaseFile.libraryfile_id", |
131 | 94 | otherColumn="sourcepackagerelease", | 94 | "SourcePackageReleaseFile.sourcepackagerelease_id", |
132 | 95 | intermediateTable="SourcePackageReleaseFile", | 95 | "SourcePackageRelease.id", |
133 | 96 | ) | 96 | ) |
134 | 97 | 97 | ||
135 | 98 | @property | 98 | @property |
136 | @@ -206,11 +206,11 @@ class LibraryFileAlias(SQLBase): | |||
137 | 206 | intermediateTable="ProductReleaseFile", | 206 | intermediateTable="ProductReleaseFile", |
138 | 207 | ) | 207 | ) |
139 | 208 | 208 | ||
145 | 209 | sourcepackages = SQLRelatedJoin( | 209 | sourcepackages = ReferenceSet( |
146 | 210 | "SourcePackageRelease", | 210 | "id", |
147 | 211 | joinColumn="libraryfile", | 211 | "SourcePackageReleaseFile.libraryfile_id", |
148 | 212 | otherColumn="sourcepackagerelease", | 212 | "SourcePackageReleaseFile.sourcepackagerelease_id", |
149 | 213 | intermediateTable="SourcePackageReleaseFile", | 213 | "SourcePackageRelease.id", |
150 | 214 | ) | 214 | ) |
151 | 215 | 215 | ||
152 | 216 | @property | 216 | @property |
153 | diff --git a/lib/lp/soyuz/browser/queue.py b/lib/lp/soyuz/browser/queue.py | |||
154 | index 2fbcc60..7f12bd3 100644 | |||
155 | --- a/lib/lp/soyuz/browser/queue.py | |||
156 | +++ b/lib/lp/soyuz/browser/queue.py | |||
157 | @@ -225,13 +225,13 @@ class QueueItemsView(LaunchpadView): | |||
158 | 225 | bpbs = load_related(BinaryPackageBuild, pubs, ["build_id"]) | 225 | bpbs = load_related(BinaryPackageBuild, pubs, ["build_id"]) |
159 | 226 | bprs = load_referencing(BinaryPackageRelease, bpbs, ["buildID"]) | 226 | bprs = load_referencing(BinaryPackageRelease, bpbs, ["buildID"]) |
160 | 227 | source_files = load_referencing( | 227 | source_files = load_referencing( |
162 | 228 | SourcePackageReleaseFile, source_sprs, ["sourcepackagereleaseID"] | 228 | SourcePackageReleaseFile, source_sprs, ["sourcepackagerelease_id"] |
163 | 229 | ) | 229 | ) |
164 | 230 | binary_files = load_referencing( | 230 | binary_files = load_referencing( |
166 | 231 | BinaryPackageFile, bprs, ["binarypackagereleaseID"] | 231 | BinaryPackageFile, bprs, ["binarypackagerelease_id"] |
167 | 232 | ) | 232 | ) |
168 | 233 | file_lfas = load_related( | 233 | file_lfas = load_related( |
170 | 234 | LibraryFileAlias, source_files + binary_files, ["libraryfileID"] | 234 | LibraryFileAlias, source_files + binary_files, ["libraryfile_id"] |
171 | 235 | ) | 235 | ) |
172 | 236 | load_related(LibraryFileContent, file_lfas, ["contentID"]) | 236 | load_related(LibraryFileContent, file_lfas, ["contentID"]) |
173 | 237 | 237 | ||
174 | diff --git a/lib/lp/soyuz/doc/build-files.rst b/lib/lp/soyuz/doc/build-files.rst | |||
175 | index a73a7d8..554f85a 100644 | |||
176 | --- a/lib/lp/soyuz/doc/build-files.rst | |||
177 | +++ b/lib/lp/soyuz/doc/build-files.rst | |||
178 | @@ -79,6 +79,6 @@ We can also retrieve the corresponding BinaryPackageFile: | |||
179 | 79 | 79 | ||
180 | 80 | >>> bpf = build.getBinaryPackageFileByName("test_1.0_all.deb") | 80 | >>> bpf = build.getBinaryPackageFileByName("test_1.0_all.deb") |
181 | 81 | >>> bpf | 81 | >>> bpf |
183 | 82 | <BinaryPackageFile ...> | 82 | <...BinaryPackageFile object ...> |
184 | 83 | >>> bpf.libraryfile == deb | 83 | >>> bpf.libraryfile == deb |
185 | 84 | True | 84 | True |
186 | diff --git a/lib/lp/soyuz/doc/gina.rst b/lib/lp/soyuz/doc/gina.rst | |||
187 | index 9d78622..5d5f0c9 100644 | |||
188 | --- a/lib/lp/soyuz/doc/gina.rst | |||
189 | +++ b/lib/lp/soyuz/doc/gina.rst | |||
190 | @@ -328,8 +328,10 @@ And check that its files actually ended up in the librarian (these sha1sums | |||
191 | 328 | were calculated directly on the files): | 328 | were calculated directly on the files): |
192 | 329 | 329 | ||
193 | 330 | >>> from lp.soyuz.model.files import SourcePackageReleaseFile | 330 | >>> from lp.soyuz.model.files import SourcePackageReleaseFile |
196 | 331 | >>> files = SourcePackageReleaseFile.selectBy( | 331 | >>> files = ( |
197 | 332 | ... sourcepackagereleaseID=cap.id, orderBy="libraryfile" | 332 | ... IStore(SourcePackageReleaseFile) |
198 | 333 | ... .find(SourcePackageReleaseFile, sourcepackagerelease=cap) | ||
199 | 334 | ... .order_by("libraryfile") | ||
200 | 333 | ... ) | 335 | ... ) |
201 | 334 | >>> for f in files: | 336 | >>> for f in files: |
202 | 335 | ... print(f.libraryfile.content.sha1) | 337 | ... print(f.libraryfile.content.sha1) |
203 | diff --git a/lib/lp/soyuz/interfaces/files.py b/lib/lp/soyuz/interfaces/files.py | |||
204 | index 033afd9..85c7d37 100644 | |||
205 | --- a/lib/lp/soyuz/interfaces/files.py | |||
206 | +++ b/lib/lp/soyuz/interfaces/files.py | |||
207 | @@ -24,7 +24,7 @@ class IPackageReleaseFile(Interface): | |||
208 | 24 | 24 | ||
209 | 25 | id = Int(title=_("ID"), required=True, readonly=True) | 25 | id = Int(title=_("ID"), required=True, readonly=True) |
210 | 26 | 26 | ||
212 | 27 | libraryfileID = Int( | 27 | libraryfile_id = Int( |
213 | 28 | title=_("The LibraryFileAlias id for this file"), | 28 | title=_("The LibraryFileAlias id for this file"), |
214 | 29 | required=True, | 29 | required=True, |
215 | 30 | readonly=True, | 30 | readonly=True, |
216 | @@ -52,7 +52,7 @@ class IBinaryPackageFile(IPackageReleaseFile): | |||
217 | 52 | readonly=False, | 52 | readonly=False, |
218 | 53 | ) | 53 | ) |
219 | 54 | 54 | ||
221 | 55 | binarypackagereleaseID = Int( | 55 | binarypackagerelease_id = Int( |
222 | 56 | title=_("ID of the binary package release being published"), | 56 | title=_("ID of the binary package release being published"), |
223 | 57 | required=True, | 57 | required=True, |
224 | 58 | readonly=False, | 58 | readonly=False, |
225 | @@ -69,7 +69,7 @@ class ISourcePackageReleaseFile(IPackageReleaseFile): | |||
226 | 69 | readonly=False, | 69 | readonly=False, |
227 | 70 | ) | 70 | ) |
228 | 71 | 71 | ||
230 | 72 | sourcepackagereleaseID = Int( | 72 | sourcepackagerelease_id = Int( |
231 | 73 | title=_("ID of the source package release being published"), | 73 | title=_("ID of the source package release being published"), |
232 | 74 | required=True, | 74 | required=True, |
233 | 75 | readonly=False, | 75 | readonly=False, |
234 | diff --git a/lib/lp/soyuz/model/archive.py b/lib/lp/soyuz/model/archive.py | |||
235 | index c04e77f..b74321f 100644 | |||
236 | --- a/lib/lp/soyuz/model/archive.py | |||
237 | +++ b/lib/lp/soyuz/model/archive.py | |||
238 | @@ -870,8 +870,8 @@ class Archive(SQLBase): | |||
239 | 870 | SourcePackagePublishingHistory.archive == self.id, | 870 | SourcePackagePublishingHistory.archive == self.id, |
240 | 871 | SourcePackagePublishingHistory.dateremoved == None, | 871 | SourcePackagePublishingHistory.dateremoved == None, |
241 | 872 | SourcePackagePublishingHistory.sourcepackagereleaseID | 872 | SourcePackagePublishingHistory.sourcepackagereleaseID |
244 | 873 | == SourcePackageReleaseFile.sourcepackagereleaseID, | 873 | == SourcePackageReleaseFile.sourcepackagerelease_id, |
245 | 874 | SourcePackageReleaseFile.libraryfileID == LibraryFileAlias.id, | 874 | SourcePackageReleaseFile.libraryfile_id == LibraryFileAlias.id, |
246 | 875 | LibraryFileAlias.contentID == LibraryFileContent.id, | 875 | LibraryFileAlias.contentID == LibraryFileContent.id, |
247 | 876 | ) | 876 | ) |
248 | 877 | 877 | ||
249 | @@ -1159,8 +1159,8 @@ class Archive(SQLBase): | |||
250 | 1159 | BinaryPackagePublishingHistory.archive == self.id, | 1159 | BinaryPackagePublishingHistory.archive == self.id, |
251 | 1160 | BinaryPackagePublishingHistory.dateremoved == None, | 1160 | BinaryPackagePublishingHistory.dateremoved == None, |
252 | 1161 | BinaryPackagePublishingHistory.binarypackagereleaseID | 1161 | BinaryPackagePublishingHistory.binarypackagereleaseID |
255 | 1162 | == BinaryPackageFile.binarypackagereleaseID, | 1162 | == BinaryPackageFile.binarypackagerelease_id, |
256 | 1163 | BinaryPackageFile.libraryfileID == LibraryFileAlias.id, | 1163 | BinaryPackageFile.libraryfile_id == LibraryFileAlias.id, |
257 | 1164 | LibraryFileAlias.contentID == LibraryFileContent.id, | 1164 | LibraryFileAlias.contentID == LibraryFileContent.id, |
258 | 1165 | ) | 1165 | ) |
259 | 1166 | # See `IArchive.sources_size`. | 1166 | # See `IArchive.sources_size`. |
260 | @@ -1952,15 +1952,15 @@ class Archive(SQLBase): | |||
261 | 1952 | clauses = ( | 1952 | clauses = ( |
262 | 1953 | SourcePackagePublishingHistory.archive == self.id, | 1953 | SourcePackagePublishingHistory.archive == self.id, |
263 | 1954 | SourcePackagePublishingHistory.sourcepackagereleaseID | 1954 | SourcePackagePublishingHistory.sourcepackagereleaseID |
266 | 1955 | == SourcePackageReleaseFile.sourcepackagereleaseID, | 1955 | == SourcePackageReleaseFile.sourcepackagerelease_id, |
267 | 1956 | SourcePackageReleaseFile.libraryfileID == LibraryFileAlias.id, | 1956 | SourcePackageReleaseFile.libraryfile_id == LibraryFileAlias.id, |
268 | 1957 | ) | 1957 | ) |
269 | 1958 | elif re_isadeb.match(filename): | 1958 | elif re_isadeb.match(filename): |
270 | 1959 | clauses = ( | 1959 | clauses = ( |
271 | 1960 | BinaryPackagePublishingHistory.archive == self.id, | 1960 | BinaryPackagePublishingHistory.archive == self.id, |
272 | 1961 | BinaryPackagePublishingHistory.binarypackagereleaseID | 1961 | BinaryPackagePublishingHistory.binarypackagereleaseID |
275 | 1962 | == BinaryPackageFile.binarypackagereleaseID, | 1962 | == BinaryPackageFile.binarypackagerelease_id, |
276 | 1963 | BinaryPackageFile.libraryfileID == LibraryFileAlias.id, | 1963 | BinaryPackageFile.libraryfile_id == LibraryFileAlias.id, |
277 | 1964 | ) | 1964 | ) |
278 | 1965 | elif filename.endswith(".changes"): | 1965 | elif filename.endswith(".changes"): |
279 | 1966 | clauses = ( | 1966 | clauses = ( |
280 | @@ -2013,8 +2013,8 @@ class Archive(SQLBase): | |||
281 | 2013 | SourcePackageName.name == name, | 2013 | SourcePackageName.name == name, |
282 | 2014 | Cast(SourcePackageRelease.version, "text") == version, | 2014 | Cast(SourcePackageRelease.version, "text") == version, |
283 | 2015 | SourcePackageRelease.id | 2015 | SourcePackageRelease.id |
286 | 2016 | == SourcePackageReleaseFile.sourcepackagereleaseID, | 2016 | == SourcePackageReleaseFile.sourcepackagerelease_id, |
287 | 2017 | SourcePackageReleaseFile.libraryfileID == LibraryFileAlias.id, | 2017 | SourcePackageReleaseFile.libraryfile_id == LibraryFileAlias.id, |
288 | 2018 | LibraryFileAlias.filename == filename, | 2018 | LibraryFileAlias.filename == filename, |
289 | 2019 | LibraryFileAlias.content != None, | 2019 | LibraryFileAlias.content != None, |
290 | 2020 | ) | 2020 | ) |
291 | @@ -2061,7 +2061,7 @@ class Archive(SQLBase): | |||
292 | 2061 | BinaryPackageBuild.source_package_name | 2061 | BinaryPackageBuild.source_package_name |
293 | 2062 | == SourcePackageName.id, | 2062 | == SourcePackageName.id, |
294 | 2063 | BinaryPackagePublishingHistory.binarypackagerelease | 2063 | BinaryPackagePublishingHistory.binarypackagerelease |
296 | 2064 | == BinaryPackageFile.binarypackagereleaseID, | 2064 | == BinaryPackageFile.binarypackagerelease_id, |
297 | 2065 | ] | 2065 | ] |
298 | 2066 | ) | 2066 | ) |
299 | 2067 | else: | 2067 | else: |
300 | @@ -2072,7 +2072,7 @@ class Archive(SQLBase): | |||
301 | 2072 | SourcePackagePublishingHistory.sourcepackagename | 2072 | SourcePackagePublishingHistory.sourcepackagename |
302 | 2073 | == SourcePackageName.id, | 2073 | == SourcePackageName.id, |
303 | 2074 | SourcePackagePublishingHistory.sourcepackagerelease | 2074 | SourcePackagePublishingHistory.sourcepackagerelease |
305 | 2075 | == SourcePackageReleaseFile.sourcepackagereleaseID, | 2075 | == SourcePackageReleaseFile.sourcepackagerelease_id, |
306 | 2076 | ] | 2076 | ] |
307 | 2077 | ) | 2077 | ) |
308 | 2078 | clauses.extend( | 2078 | clauses.extend( |
309 | @@ -2120,9 +2120,9 @@ class Archive(SQLBase): | |||
310 | 2120 | IStore(BinaryPackageRelease) | 2120 | IStore(BinaryPackageRelease) |
311 | 2121 | .find( | 2121 | .find( |
312 | 2122 | BinaryPackageRelease, | 2122 | BinaryPackageRelease, |
314 | 2123 | BinaryPackageFile.binarypackagereleaseID | 2123 | BinaryPackageFile.binarypackagerelease_id |
315 | 2124 | == BinaryPackageRelease.id, | 2124 | == BinaryPackageRelease.id, |
317 | 2125 | BinaryPackageFile.libraryfileID == LibraryFileAlias.id, | 2125 | BinaryPackageFile.libraryfile_id == LibraryFileAlias.id, |
318 | 2126 | LibraryFileAlias.filename == filename, | 2126 | LibraryFileAlias.filename == filename, |
319 | 2127 | BinaryPackagePublishingHistory.archive == self, | 2127 | BinaryPackagePublishingHistory.archive == self, |
320 | 2128 | BinaryPackagePublishingHistory.binarypackagereleaseID | 2128 | BinaryPackagePublishingHistory.binarypackagereleaseID |
321 | @@ -2855,8 +2855,8 @@ class Archive(SQLBase): | |||
322 | 2855 | (LibraryFileAlias.filename, LibraryFileContent.sha1), | 2855 | (LibraryFileAlias.filename, LibraryFileContent.sha1), |
323 | 2856 | SourcePackagePublishingHistory.archive == self, | 2856 | SourcePackagePublishingHistory.archive == self, |
324 | 2857 | SourcePackagePublishingHistory.sourcepackagerelease | 2857 | SourcePackagePublishingHistory.sourcepackagerelease |
327 | 2858 | == SourcePackageReleaseFile.sourcepackagereleaseID, | 2858 | == SourcePackageReleaseFile.sourcepackagerelease_id, |
328 | 2859 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfileID, | 2859 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfile_id, |
329 | 2860 | LibraryFileAlias.filename.is_in(source_files), | 2860 | LibraryFileAlias.filename.is_in(source_files), |
330 | 2861 | LibraryFileContent.id == LibraryFileAlias.contentID, | 2861 | LibraryFileContent.id == LibraryFileAlias.contentID, |
331 | 2862 | ) | 2862 | ) |
332 | diff --git a/lib/lp/soyuz/model/binarypackagebuild.py b/lib/lp/soyuz/model/binarypackagebuild.py | |||
333 | index a8d4352..5471460 100644 | |||
334 | --- a/lib/lp/soyuz/model/binarypackagebuild.py | |||
335 | +++ b/lib/lp/soyuz/model/binarypackagebuild.py | |||
336 | @@ -436,8 +436,8 @@ class BinaryPackageBuild(PackageBuildMixin, SQLBase): | |||
337 | 436 | ), | 436 | ), |
338 | 437 | BinaryPackageRelease.build == self, | 437 | BinaryPackageRelease.build == self, |
339 | 438 | BinaryPackageRelease.id | 438 | BinaryPackageRelease.id |
342 | 439 | == BinaryPackageFile.binarypackagereleaseID, | 439 | == BinaryPackageFile.binarypackagerelease_id, |
343 | 440 | LibraryFileAlias.id == BinaryPackageFile.libraryfileID, | 440 | LibraryFileAlias.id == BinaryPackageFile.libraryfile_id, |
344 | 441 | LibraryFileContent.id == LibraryFileAlias.contentID, | 441 | LibraryFileContent.id == LibraryFileAlias.contentID, |
345 | 442 | ) | 442 | ) |
346 | 443 | return result.order_by( | 443 | return result.order_by( |
347 | @@ -796,7 +796,7 @@ class BinaryPackageBuild(PackageBuildMixin, SQLBase): | |||
348 | 796 | BinaryPackageRelease.build == self.id, | 796 | BinaryPackageRelease.build == self.id, |
349 | 797 | BinaryPackageFile.binarypackagerelease | 797 | BinaryPackageFile.binarypackagerelease |
350 | 798 | == BinaryPackageRelease.id, | 798 | == BinaryPackageRelease.id, |
352 | 799 | LibraryFileAlias.id == BinaryPackageFile.libraryfileID, | 799 | LibraryFileAlias.id == BinaryPackageFile.libraryfile_id, |
353 | 800 | LibraryFileAlias.filename == filename, | 800 | LibraryFileAlias.filename == filename, |
354 | 801 | ) | 801 | ) |
355 | 802 | .one() | 802 | .one() |
356 | @@ -1576,7 +1576,7 @@ class BinaryPackageBuildMacaroonIssuer(MacaroonIssuerBase): | |||
357 | 1576 | clauses.extend( | 1576 | clauses.extend( |
358 | 1577 | [ | 1577 | [ |
359 | 1578 | BinaryPackageBuild.source_package_release_id | 1578 | BinaryPackageBuild.source_package_release_id |
361 | 1579 | == SourcePackageReleaseFile.sourcepackagereleaseID, | 1579 | == SourcePackageReleaseFile.sourcepackagerelease_id, |
362 | 1580 | SourcePackageReleaseFile.libraryfile == context, | 1580 | SourcePackageReleaseFile.libraryfile == context, |
363 | 1581 | ] | 1581 | ] |
364 | 1582 | ) | 1582 | ) |
365 | diff --git a/lib/lp/soyuz/model/files.py b/lib/lp/soyuz/model/files.py | |||
366 | index a54a779..4145321 100644 | |||
367 | --- a/lib/lp/soyuz/model/files.py | |||
368 | +++ b/lib/lp/soyuz/model/files.py | |||
369 | @@ -7,12 +7,12 @@ __all__ = [ | |||
370 | 7 | "SourcePackageReleaseFile", | 7 | "SourcePackageReleaseFile", |
371 | 8 | ] | 8 | ] |
372 | 9 | 9 | ||
373 | 10 | from storm.locals import Int, Reference | ||
374 | 10 | from zope.interface import implementer | 11 | from zope.interface import implementer |
375 | 11 | 12 | ||
376 | 12 | from lp.registry.interfaces.sourcepackage import SourcePackageFileType | 13 | from lp.registry.interfaces.sourcepackage import SourcePackageFileType |
377 | 13 | from lp.services.database.enumcol import DBEnum | 14 | from lp.services.database.enumcol import DBEnum |
380 | 14 | from lp.services.database.sqlbase import SQLBase | 15 | from lp.services.database.stormbase import StormBase |
379 | 15 | from lp.services.database.sqlobject import ForeignKey | ||
381 | 16 | from lp.soyuz.enums import BinaryPackageFileType | 16 | from lp.soyuz.enums import BinaryPackageFileType |
382 | 17 | from lp.soyuz.interfaces.files import ( | 17 | from lp.soyuz.interfaces.files import ( |
383 | 18 | IBinaryPackageFile, | 18 | IBinaryPackageFile, |
384 | @@ -21,20 +21,29 @@ from lp.soyuz.interfaces.files import ( | |||
385 | 21 | 21 | ||
386 | 22 | 22 | ||
387 | 23 | @implementer(IBinaryPackageFile) | 23 | @implementer(IBinaryPackageFile) |
389 | 24 | class BinaryPackageFile(SQLBase): | 24 | class BinaryPackageFile(StormBase): |
390 | 25 | """See IBinaryPackageFile""" | 25 | """See IBinaryPackageFile""" |
391 | 26 | 26 | ||
393 | 27 | _table = "BinaryPackageFile" | 27 | __storm_table__ = "BinaryPackageFile" |
394 | 28 | 28 | ||
399 | 29 | binarypackagerelease = ForeignKey( | 29 | id = Int(primary=True) |
400 | 30 | dbName="binarypackagerelease", | 30 | binarypackagerelease_id = Int( |
401 | 31 | foreignKey="BinaryPackageRelease", | 31 | name="binarypackagerelease", allow_none=False |
398 | 32 | notNull=True, | ||
402 | 33 | ) | 32 | ) |
405 | 34 | libraryfile = ForeignKey( | 33 | binarypackagerelease = Reference( |
406 | 35 | dbName="libraryfile", foreignKey="LibraryFileAlias", notNull=True | 34 | binarypackagerelease_id, "BinaryPackageRelease.id" |
407 | 36 | ) | 35 | ) |
409 | 37 | filetype = DBEnum(name="filetype", enum=BinaryPackageFileType) | 36 | libraryfile_id = Int(name="libraryfile", allow_none=False) |
410 | 37 | libraryfile = Reference(libraryfile_id, "LibraryFileAlias.id") | ||
411 | 38 | filetype = DBEnum( | ||
412 | 39 | name="filetype", enum=BinaryPackageFileType, allow_none=False | ||
413 | 40 | ) | ||
414 | 41 | |||
415 | 42 | def __init__(self, binarypackagerelease, libraryfile, filetype): | ||
416 | 43 | super().__init__() | ||
417 | 44 | self.binarypackagerelease = binarypackagerelease | ||
418 | 45 | self.libraryfile = libraryfile | ||
419 | 46 | self.filetype = filetype | ||
420 | 38 | 47 | ||
421 | 39 | 48 | ||
422 | 40 | class SourceFileMixin: | 49 | class SourceFileMixin: |
423 | @@ -51,13 +60,26 @@ class SourceFileMixin: | |||
424 | 51 | 60 | ||
425 | 52 | 61 | ||
426 | 53 | @implementer(ISourcePackageReleaseFile) | 62 | @implementer(ISourcePackageReleaseFile) |
428 | 54 | class SourcePackageReleaseFile(SourceFileMixin, SQLBase): | 63 | class SourcePackageReleaseFile(SourceFileMixin, StormBase): |
429 | 55 | """See ISourcePackageFile""" | 64 | """See ISourcePackageFile""" |
430 | 56 | 65 | ||
433 | 57 | sourcepackagerelease = ForeignKey( | 66 | __storm_table__ = "SourcePackageReleaseFile" |
434 | 58 | foreignKey="SourcePackageRelease", dbName="sourcepackagerelease" | 67 | |
435 | 68 | id = Int(primary=True) | ||
436 | 69 | sourcepackagerelease_id = Int( | ||
437 | 70 | name="sourcepackagerelease", allow_none=False | ||
438 | 59 | ) | 71 | ) |
441 | 60 | libraryfile = ForeignKey( | 72 | sourcepackagerelease = Reference( |
442 | 61 | foreignKey="LibraryFileAlias", dbName="libraryfile" | 73 | sourcepackagerelease_id, "SourcePackageRelease.id" |
443 | 62 | ) | 74 | ) |
445 | 63 | filetype = DBEnum(enum=SourcePackageFileType) | 75 | libraryfile_id = Int(name="libraryfile", allow_none=False) |
446 | 76 | libraryfile = Reference(libraryfile_id, "LibraryFileAlias.id") | ||
447 | 77 | filetype = DBEnum( | ||
448 | 78 | name="filetype", enum=SourcePackageFileType, allow_none=False | ||
449 | 79 | ) | ||
450 | 80 | |||
451 | 81 | def __init__(self, sourcepackagerelease, libraryfile, filetype): | ||
452 | 82 | super().__init__() | ||
453 | 83 | self.sourcepackagerelease = sourcepackagerelease | ||
454 | 84 | self.libraryfile = libraryfile | ||
455 | 85 | self.filetype = filetype | ||
456 | diff --git a/lib/lp/soyuz/model/packagediff.py b/lib/lp/soyuz/model/packagediff.py | |||
457 | index 92677ef..1eb35fe 100644 | |||
458 | --- a/lib/lp/soyuz/model/packagediff.py | |||
459 | +++ b/lib/lp/soyuz/model/packagediff.py | |||
460 | @@ -195,10 +195,10 @@ class PackageDiff(StormBase): | |||
461 | 195 | IStore(LibraryFileAlias) | 195 | IStore(LibraryFileAlias) |
462 | 196 | .find( | 196 | .find( |
463 | 197 | LibraryFileAlias.id, | 197 | LibraryFileAlias.id, |
465 | 198 | SourcePackageReleaseFile.sourcepackagereleaseID.is_in( | 198 | SourcePackageReleaseFile.sourcepackagerelease_id.is_in( |
466 | 199 | (self.from_source_id, self.to_source_id) | 199 | (self.from_source_id, self.to_source_id) |
467 | 200 | ), | 200 | ), |
469 | 201 | SourcePackageReleaseFile.libraryfileID == LibraryFileAlias.id, | 201 | SourcePackageReleaseFile.libraryfile_id == LibraryFileAlias.id, |
470 | 202 | LibraryFileAlias.content == None, | 202 | LibraryFileAlias.content == None, |
471 | 203 | ) | 203 | ) |
472 | 204 | .count() | 204 | .count() |
473 | diff --git a/lib/lp/soyuz/model/publishing.py b/lib/lp/soyuz/model/publishing.py | |||
474 | index 1df1fa6..b2f7a9d 100644 | |||
475 | --- a/lib/lp/soyuz/model/publishing.py | |||
476 | +++ b/lib/lp/soyuz/model/publishing.py | |||
477 | @@ -385,7 +385,7 @@ class SourcePackagePublishingHistory(SQLBase, ArchivePublisherBase): | |||
478 | 385 | bpfs = list( | 385 | bpfs = list( |
479 | 386 | Store.of(self).find( | 386 | Store.of(self).find( |
480 | 387 | BinaryPackageFile, | 387 | BinaryPackageFile, |
482 | 388 | BinaryPackageFile.binarypackagereleaseID.is_in(bpr_ids), | 388 | BinaryPackageFile.binarypackagerelease_id.is_in(bpr_ids), |
483 | 389 | ) | 389 | ) |
484 | 390 | ) | 390 | ) |
485 | 391 | bpfs_by_bpr = defaultdict(list) | 391 | bpfs_by_bpr = defaultdict(list) |
486 | @@ -395,7 +395,7 @@ class SourcePackagePublishingHistory(SQLBase, ArchivePublisherBase): | |||
487 | 395 | get_property_cache(bpr).files = bpfs_by_bpr[bpr] | 395 | get_property_cache(bpr).files = bpfs_by_bpr[bpr] |
488 | 396 | 396 | ||
489 | 397 | # Preload LibraryFileAliases. | 397 | # Preload LibraryFileAliases. |
491 | 398 | lfa_ids = {bpf.libraryfileID for bpf in bpfs} | 398 | lfa_ids = {bpf.libraryfile_id for bpf in bpfs} |
492 | 399 | list( | 399 | list( |
493 | 400 | Store.of(self).find( | 400 | Store.of(self).find( |
494 | 401 | LibraryFileAlias, LibraryFileAlias.id.is_in(lfa_ids) | 401 | LibraryFileAlias, LibraryFileAlias.id.is_in(lfa_ids) |
495 | @@ -476,7 +476,7 @@ class SourcePackagePublishingHistory(SQLBase, ArchivePublisherBase): | |||
496 | 476 | def files(self): | 476 | def files(self): |
497 | 477 | """See `IPublishing`.""" | 477 | """See `IPublishing`.""" |
498 | 478 | files = self.sourcepackagerelease.files | 478 | files = self.sourcepackagerelease.files |
500 | 479 | lfas = bulk.load_related(LibraryFileAlias, files, ["libraryfileID"]) | 479 | lfas = bulk.load_related(LibraryFileAlias, files, ["libraryfile_id"]) |
501 | 480 | bulk.load_related(LibraryFileContent, lfas, ["contentID"]) | 480 | bulk.load_related(LibraryFileContent, lfas, ["contentID"]) |
502 | 481 | return files | 481 | return files |
503 | 482 | 482 | ||
504 | @@ -659,7 +659,7 @@ class SourcePackagePublishingHistory(SQLBase, ArchivePublisherBase): | |||
505 | 659 | sources = Store.of(self).find( | 659 | sources = Store.of(self).find( |
506 | 660 | (LibraryFileAlias, LibraryFileContent), | 660 | (LibraryFileAlias, LibraryFileContent), |
507 | 661 | LibraryFileContent.id == LibraryFileAlias.contentID, | 661 | LibraryFileContent.id == LibraryFileAlias.contentID, |
509 | 662 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfileID, | 662 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfile_id, |
510 | 663 | SourcePackageReleaseFile.sourcepackagerelease | 663 | SourcePackageReleaseFile.sourcepackagerelease |
511 | 664 | == self.sourcepackagereleaseID, | 664 | == self.sourcepackagereleaseID, |
512 | 665 | ) | 665 | ) |
513 | @@ -834,7 +834,7 @@ class BinaryPackagePublishingHistory(SQLBase, ArchivePublisherBase): | |||
514 | 834 | def files(self): | 834 | def files(self): |
515 | 835 | """See `IPublishing`.""" | 835 | """See `IPublishing`.""" |
516 | 836 | files = self.binarypackagerelease.files | 836 | files = self.binarypackagerelease.files |
518 | 837 | lfas = bulk.load_related(LibraryFileAlias, files, ["libraryfileID"]) | 837 | lfas = bulk.load_related(LibraryFileAlias, files, ["libraryfile_id"]) |
519 | 838 | bulk.load_related(LibraryFileContent, lfas, ["contentID"]) | 838 | bulk.load_related(LibraryFileContent, lfas, ["contentID"]) |
520 | 839 | return files | 839 | return files |
521 | 840 | 840 | ||
522 | @@ -1254,7 +1254,7 @@ class BinaryPackagePublishingHistory(SQLBase, ArchivePublisherBase): | |||
523 | 1254 | binaries = Store.of(self).find( | 1254 | binaries = Store.of(self).find( |
524 | 1255 | (LibraryFileAlias, LibraryFileContent), | 1255 | (LibraryFileAlias, LibraryFileContent), |
525 | 1256 | LibraryFileContent.id == LibraryFileAlias.contentID, | 1256 | LibraryFileContent.id == LibraryFileAlias.contentID, |
527 | 1257 | LibraryFileAlias.id == BinaryPackageFile.libraryfileID, | 1257 | LibraryFileAlias.id == BinaryPackageFile.libraryfile_id, |
528 | 1258 | BinaryPackageFile.binarypackagerelease | 1258 | BinaryPackageFile.binarypackagerelease |
529 | 1259 | == self.binarypackagereleaseID, | 1259 | == self.binarypackagereleaseID, |
530 | 1260 | ) | 1260 | ) |
531 | @@ -1848,7 +1848,7 @@ class PublishingSet: | |||
532 | 1848 | LibraryFileContent, | 1848 | LibraryFileContent, |
533 | 1849 | ), | 1849 | ), |
534 | 1850 | LibraryFileContent.id == LibraryFileAlias.contentID, | 1850 | LibraryFileContent.id == LibraryFileAlias.contentID, |
536 | 1851 | LibraryFileAlias.id == BinaryPackageFile.libraryfileID, | 1851 | LibraryFileAlias.id == BinaryPackageFile.libraryfile_id, |
537 | 1852 | BinaryPackageFile.binarypackagerelease == BinaryPackageRelease.id, | 1852 | BinaryPackageFile.binarypackagerelease == BinaryPackageRelease.id, |
538 | 1853 | BinaryPackageRelease.buildID == BinaryPackageBuild.id, | 1853 | BinaryPackageRelease.buildID == BinaryPackageBuild.id, |
539 | 1854 | SourcePackagePublishingHistory.sourcepackagereleaseID | 1854 | SourcePackagePublishingHistory.sourcepackagereleaseID |
540 | @@ -1876,7 +1876,7 @@ class PublishingSet: | |||
541 | 1876 | LibraryFileContent, | 1876 | LibraryFileContent, |
542 | 1877 | ), | 1877 | ), |
543 | 1878 | LibraryFileContent.id == LibraryFileAlias.contentID, | 1878 | LibraryFileContent.id == LibraryFileAlias.contentID, |
545 | 1879 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfileID, | 1879 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfile_id, |
546 | 1880 | SourcePackageReleaseFile.sourcepackagerelease | 1880 | SourcePackageReleaseFile.sourcepackagerelease |
547 | 1881 | == SourcePackagePublishingHistory.sourcepackagereleaseID, | 1881 | == SourcePackagePublishingHistory.sourcepackagereleaseID, |
548 | 1882 | SourcePackagePublishingHistory.id.is_in(source_publication_ids), | 1882 | SourcePackagePublishingHistory.id.is_in(source_publication_ids), |
549 | @@ -2005,11 +2005,11 @@ class PublishingSet: | |||
550 | 2005 | IStore(SourcePackageReleaseFile) | 2005 | IStore(SourcePackageReleaseFile) |
551 | 2006 | .find( | 2006 | .find( |
552 | 2007 | SourcePackageReleaseFile, | 2007 | SourcePackageReleaseFile, |
554 | 2008 | SourcePackageReleaseFile.sourcepackagereleaseID.is_in( | 2008 | SourcePackageReleaseFile.sourcepackagerelease_id.is_in( |
555 | 2009 | spr_ids | 2009 | spr_ids |
556 | 2010 | ), | 2010 | ), |
557 | 2011 | ) | 2011 | ) |
559 | 2012 | .order_by(SourcePackageReleaseFile.libraryfileID) | 2012 | .order_by(SourcePackageReleaseFile.libraryfile_id) |
560 | 2013 | ) | 2013 | ) |
561 | 2014 | file_map = defaultdict(list) | 2014 | file_map = defaultdict(list) |
562 | 2015 | for sprf in sprfs: | 2015 | for sprf in sprfs: |
563 | @@ -2017,7 +2017,7 @@ class PublishingSet: | |||
564 | 2017 | for spr, files in file_map.items(): | 2017 | for spr, files in file_map.items(): |
565 | 2018 | get_property_cache(spr).files = files | 2018 | get_property_cache(spr).files = files |
566 | 2019 | lfas = bulk.load_related( | 2019 | lfas = bulk.load_related( |
568 | 2020 | LibraryFileAlias, sprfs, ["libraryfileID"] | 2020 | LibraryFileAlias, sprfs, ["libraryfile_id"] |
569 | 2021 | ) | 2021 | ) |
570 | 2022 | bulk.load_related(LibraryFileContent, lfas, ["contentID"]) | 2022 | bulk.load_related(LibraryFileContent, lfas, ["contentID"]) |
571 | 2023 | 2023 | ||
572 | @@ -2063,14 +2063,16 @@ class PublishingSet: | |||
573 | 2063 | SourcePackageRelease, bpbs, ["source_package_release_id"] | 2063 | SourcePackageRelease, bpbs, ["source_package_release_id"] |
574 | 2064 | ) | 2064 | ) |
575 | 2065 | bpfs = bulk.load_referencing( | 2065 | bpfs = bulk.load_referencing( |
577 | 2066 | BinaryPackageFile, bprs, ["binarypackagereleaseID"] | 2066 | BinaryPackageFile, bprs, ["binarypackagerelease_id"] |
578 | 2067 | ) | 2067 | ) |
579 | 2068 | file_map = defaultdict(list) | 2068 | file_map = defaultdict(list) |
580 | 2069 | for bpf in bpfs: | 2069 | for bpf in bpfs: |
581 | 2070 | file_map[bpf.binarypackagerelease].append(bpf) | 2070 | file_map[bpf.binarypackagerelease].append(bpf) |
582 | 2071 | for bpr, files in file_map.items(): | 2071 | for bpr, files in file_map.items(): |
583 | 2072 | get_property_cache(bpr).files = files | 2072 | get_property_cache(bpr).files = files |
585 | 2073 | lfas = bulk.load_related(LibraryFileAlias, bpfs, ["libraryfileID"]) | 2073 | lfas = bulk.load_related( |
586 | 2074 | LibraryFileAlias, bpfs, ["libraryfile_id"] | ||
587 | 2075 | ) | ||
588 | 2074 | bulk.load_related(LibraryFileContent, lfas, ["contentID"]) | 2076 | bulk.load_related(LibraryFileContent, lfas, ["contentID"]) |
589 | 2075 | bulk.load_related(SourcePackageName, sprs, ["sourcepackagenameID"]) | 2077 | bulk.load_related(SourcePackageName, sprs, ["sourcepackagenameID"]) |
590 | 2076 | bulk.load_related(BinaryPackageName, bprs, ["binarypackagenameID"]) | 2078 | bulk.load_related(BinaryPackageName, bprs, ["binarypackagenameID"]) |
591 | diff --git a/lib/lp/soyuz/model/sourcepackagerelease.py b/lib/lp/soyuz/model/sourcepackagerelease.py | |||
592 | index 0dcd8da..9cb4baf 100644 | |||
593 | --- a/lib/lp/soyuz/model/sourcepackagerelease.py | |||
594 | +++ b/lib/lp/soyuz/model/sourcepackagerelease.py | |||
595 | @@ -305,7 +305,7 @@ class SourcePackageRelease(SQLBase): | |||
596 | 305 | return list( | 305 | return list( |
597 | 306 | Store.of(self) | 306 | Store.of(self) |
598 | 307 | .find(SourcePackageReleaseFile, sourcepackagerelease=self) | 307 | .find(SourcePackageReleaseFile, sourcepackagerelease=self) |
600 | 308 | .order_by(SourcePackageReleaseFile.libraryfileID) | 308 | .order_by(SourcePackageReleaseFile.libraryfile_id) |
601 | 309 | ) | 309 | ) |
602 | 310 | 310 | ||
603 | 311 | def getFileByName(self, filename): | 311 | def getFileByName(self, filename): |
604 | @@ -315,7 +315,7 @@ class SourcePackageRelease(SQLBase): | |||
605 | 315 | .find( | 315 | .find( |
606 | 316 | SourcePackageReleaseFile, | 316 | SourcePackageReleaseFile, |
607 | 317 | SourcePackageReleaseFile.sourcepackagerelease == self.id, | 317 | SourcePackageReleaseFile.sourcepackagerelease == self.id, |
609 | 318 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfileID, | 318 | LibraryFileAlias.id == SourcePackageReleaseFile.libraryfile_id, |
610 | 319 | LibraryFileAlias.filename == filename, | 319 | LibraryFileAlias.filename == filename, |
611 | 320 | ) | 320 | ) |
612 | 321 | .one() | 321 | .one() |
613 | diff --git a/lib/lp/soyuz/scripts/expire_archive_files.py b/lib/lp/soyuz/scripts/expire_archive_files.py | |||
614 | index ed91efc..ef82fef 100755 | |||
615 | --- a/lib/lp/soyuz/scripts/expire_archive_files.py | |||
616 | +++ b/lib/lp/soyuz/scripts/expire_archive_files.py | |||
617 | @@ -126,7 +126,7 @@ class ArchiveExpirer(LaunchpadCronScript): | |||
618 | 126 | ), | 126 | ), |
619 | 127 | ) | 127 | ) |
620 | 128 | denied = Select( | 128 | denied = Select( |
622 | 129 | xPF.libraryfileID, | 129 | xPF.libraryfile_id, |
623 | 130 | where=And( | 130 | where=And( |
624 | 131 | xPR_join, | 131 | xPR_join, |
625 | 132 | xPPH.archive == Archive.id, | 132 | xPPH.archive == Archive.id, |
626 | diff --git a/lib/lp/soyuz/scripts/gina/handlers.py b/lib/lp/soyuz/scripts/gina/handlers.py | |||
627 | index 1e0ff96..a595340 100644 | |||
628 | --- a/lib/lp/soyuz/scripts/gina/handlers.py | |||
629 | +++ b/lib/lp/soyuz/scripts/gina/handlers.py | |||
630 | @@ -916,7 +916,7 @@ class BinaryPackageHandler: | |||
631 | 916 | 916 | ||
632 | 917 | alias = getLibraryAlias(path, fname) | 917 | alias = getLibraryAlias(path, fname) |
633 | 918 | BinaryPackageFile( | 918 | BinaryPackageFile( |
635 | 919 | binarypackagerelease=binpkg.id, | 919 | binarypackagerelease=binpkg, |
636 | 920 | libraryfile=alias, | 920 | libraryfile=alias, |
637 | 921 | filetype=determine_binary_file_type(fname), | 921 | filetype=determine_binary_file_type(fname), |
638 | 922 | ) | 922 | ) |
LGTM 👍