Merge lp:~jtv/launchpad/katie-and-gina-are-bad-bad-girls into lp:launchpad

Proposed by Jeroen T. Vermeulen on 2011-09-15
Status: Merged
Approved by: Jeroen T. Vermeulen on 2011-09-15
Approved revision: no longer in the source branch.
Merged at revision: 13965
Proposed branch: lp:~jtv/launchpad/katie-and-gina-are-bad-bad-girls
Merge into: lp:launchpad
Diff against target: 655 lines (+75/-290)
4 files modified
lib/lp/soyuz/scripts/gina/handlers.py (+9/-12)
lib/lp/soyuz/scripts/gina/katie.py (+0/-136)
lib/lp/soyuz/scripts/gina/packages.py (+48/-88)
scripts/gina.py (+18/-54)
To merge this branch: bzr merge lp:~jtv/launchpad/katie-and-gina-are-bad-bad-girls
Reviewer Review Type Date Requested Status
Gavin Panella (community) 2011-09-15 Approve on 2011-09-15
Review via email: mp+75472@code.launchpad.net

Commit Message

[r=allenap][bug=850926] Katie/Gina cleanup.

Description of the Change

= Summary =

Katie and Gina are a bit of a mess. Very old code, basically unmaintained for years, full of sometimes puzzling XXX comments by people who no longer work here.

== Proposed fix ==

Remove some unneeded functions, parameters etc. Oh yes, and this revealed that the katie module was not only unclear and untested, it was unneeded as well.

Gina could do with more cleanups that will reverberate throughout the module. For example, it would help to look up the relevant distroseries once and pass that around, rather than passing distro and series name and expect every callee to look it up for themselves.

== Pre-implementation notes ==

We may be able to ditch the Katie database as well. The Katie celebrity may be slightly harder to get rid of, because Translations uses it as a special person to recognize items produced by a particular internal process.

We'll also want much more fine-grained transaction management in gina. It could run for far too long without committing its changes, and as far as I can see, without good reason. The code will behave fine if restarted after an abortive run that committed only a portion of its changes; it's integral to the design of incremental imports.

== Implementation details ==

I removed the bit in SourcePackageData that handles an Uploaders key in an incoming file and sets self.uploaders. I can do that because nothing references the value, and there is a catch-all (a dubious one though—need to look into that as well) that will naturally do the right thing for this item. It just won't parse the field, which is fine by me.

== Tests ==

{{{
./bin/test -vvc lp.soyuz -t katie -t gina
}}}

== Demo and Q/A ==

We can do this on dogfood; we have some experience running gina now. Run the old gina (“./scripts/gina.py -v sid”). Record resulting SourcePackagePublishingHistory and SourcePackageRelease information for Debian in a scratch table. Upgrade the codebase and run the new gina. Now compare: it should not affect SPPH and SPR statuses and versions.

This is not a very complete test, but since this is not a functional change, the main worry is something blowing up because of, for example, an incorrect argument count.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/soyuz/scripts/gina/packages.py
  scripts/gina.py
  lib/lp/soyuz/scripts/gina/handlers.py

./scripts/gina.py
      25: '_pythonpath' imported but unused

To post a comment you must log in.
Jeroen T. Vermeulen (jtv) wrote :

William just tells me that the Katie celebrity is in fact a completely different Katie. So this cleanup will help clear that up as well.

Gavin Panella (allenap) wrote :

Looks good. There is also a katie_dbname configuration parameter in schema-lazr.conf that ought to be removed.

review: Approve
Jeroen T. Vermeulen (jtv) wrote :

Thanks. Removing that config key will have to be a separate bug, since removing a lazr config key is horribly dangerous until it has disappeared from the codebase on all production systems.

Jeroen T. Vermeulen (jtv) wrote :

Reported that as bug 850921.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/soyuz/scripts/gina/handlers.py'
2--- lib/lp/soyuz/scripts/gina/handlers.py 2011-09-14 06:39:41 +0000
3+++ lib/lp/soyuz/scripts/gina/handlers.py 2011-09-15 04:49:09 +0000
4@@ -165,8 +165,8 @@
5 This class is used to handle the import process.
6 """
7
8- def __init__(self, ztm, distro_name, distroseries_name, ktdb,
9- archive_root, keyrings, pocket, component_override):
10+ def __init__(self, ztm, distro_name, distroseries_name, archive_root,
11+ pocket, component_override):
12 self.pocket = pocket
13 self.component_override = component_override
14 self.ztm = ztm
15@@ -178,10 +178,10 @@
16 self.imported_sources = []
17 self.imported_bins = {}
18
19- self.sphandler = SourcePackageHandler(ktdb, archive_root, keyrings,
20- pocket, component_override)
21- self.bphandler = BinaryPackageHandler(self.sphandler, archive_root,
22- pocket)
23+ self.sphandler = SourcePackageHandler(
24+ archive_root, pocket, component_override)
25+ self.bphandler = BinaryPackageHandler(
26+ self.sphandler, archive_root, pocket)
27
28 self.sppublisher = SourcePackagePublisher(
29 self.distroseries, pocket, self.component_override)
30@@ -454,12 +454,9 @@
31 on the launchpad db a little easier.
32 """
33
34- def __init__(self, KTDB, archive_root, keyrings, pocket,
35- component_override):
36+ def __init__(self, archive_root, pocket, component_override):
37 self.distro_handler = DistroHandler()
38- self.ktdb = KTDB
39 self.archive_root = archive_root
40- self.keyrings = keyrings
41 self.pocket = pocket
42 self.component_override = component_override
43
44@@ -495,8 +492,8 @@
45 return None
46
47 # Process the package
48- sp_data.process_package(self.ktdb, self.archive_root, self.keyrings)
49- sp_data.ensure_complete(self.ktdb)
50+ sp_data.process_package(self.archive_root)
51+ sp_data.ensure_complete()
52
53 spr = self.createSourcePackageRelease(sp_data, distroseries)
54
55
56=== removed file 'lib/lp/soyuz/scripts/gina/katie.py'
57--- lib/lp/soyuz/scripts/gina/katie.py 2011-09-13 14:48:05 +0000
58+++ lib/lp/soyuz/scripts/gina/katie.py 1970-01-01 00:00:00 +0000
59@@ -1,136 +0,0 @@
60-# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
61-# GNU Affero General Public License version 3 (see the file LICENSE).
62-
63-__metaclass__ = type
64-
65-"""Katie database handler.
66-
67-Class to handle and query the katie db properly.
68-"""
69-__all__ = ['Katie']
70-
71-from canonical.config import config
72-from canonical.database.sqlbase import connect
73-from canonical.launchpad.scripts import log
74-
75-
76-class Katie:
77- def __init__(self, dbname, suite):
78- self.suite = suite
79- self.dbname = dbname
80- log.info("Connecting to %s as %s" % (dbname, config.gina.dbuser))
81- self.db = connect(user=config.gina.dbuser, dbname=dbname)
82-
83- #
84- # Database convenience methods
85- #
86-
87- def ensure_string_format(self, name):
88- assert isinstance(name, basestring), repr(name)
89- try:
90- # check that this is unicode data
91- name.decode("utf-8").encode("utf-8")
92- return name
93- except UnicodeError:
94- # check that this is latin-1 data
95- s = name.decode("latin-1").encode("utf-8")
96- s.decode("utf-8")
97- return s
98-
99- def commit(self):
100- log.debug("Committing")
101- return self.db.commit()
102-
103- def close(self):
104- log.info("Closing connection")
105- return self.db.close()
106-
107- def _get_dicts(self, cursor):
108- names = [x[0] for x in cursor.description]
109- ret = []
110- for item in cursor.fetchall():
111- res = {}
112- for i in range(len(names)):
113- res[names[i]] = item[i]
114- ret.append(res)
115- return ret
116-
117- def _query_to_dict(self, query, args=None):
118- cursor = self._exec(query, args)
119- return self._get_dicts(cursor)
120-
121- def _query(self, query, args=None):
122- cursor = self.db.cursor()
123- cursor.execute(query, args or [])
124- results = cursor.fetchall()
125- return results
126-
127- def _query_single(self, query, args=None):
128- q = self._query(query, args)
129- if len(q) == 1:
130- return q[0]
131- elif not q:
132- return None
133- else:
134- raise AssertionError(
135- "Expected 0 or 1 result from this query, but got %d: "
136- "'%s' (with arguments: %s)." % (len(q), query, args))
137-
138- def _exec(self, query, args=None):
139- cursor = self.db.cursor()
140- cursor.execute(query, args or [])
141- return cursor
142-
143- #
144- # Katie domain-specific bits
145- #
146-
147- def getSourcePackageRelease(self, name, version):
148- log.debug("Hunting for release %s / %s" % (name, version))
149- ret = self._query_to_dict("""
150- SELECT *
151- FROM source, fingerprint
152- WHERE
153- source = %s AND
154- source.sig_fpr = fingerprint.id AND
155- version = %s""",
156- (name, version))
157- if not ret:
158- log.debug(
159- "that spr didn't turn up. Attempting to find via ubuntu")
160- else:
161- return ret
162-
163- # XXX kiko 2005-10-21: what to do when the ubuntu lookup fails?
164- return self._query_to_dict("""SELECT * FROM source, fingerprint
165- WHERE source = %s
166- AND source.sig_fpr = fingerprint.id
167- AND version like '%subuntu%s'""" %
168- ("%s", version, "%"), name)
169-
170- def getBinaryPackageRelease(self, name, version, arch):
171- return self._query_to_dict("""SELECT * FROM binaries, architecture,
172- fingerprint
173- WHERE package = %s
174- AND version = %s
175- AND binaries.sig_fpr = fingerprint.id
176- AND binaries.architecture =
177- architecture.id
178- AND arch_string = %s""",
179- (name, version, arch))
180-
181- def getSections(self):
182- return self._query("""SELECT section FROM section""")
183-
184- def getSourceSection(self, sourcepackage):
185- return self._query_single("""
186- SELECT section.section
187- FROM section,
188- override,
189- suite
190-
191- WHERE override.section = section.id
192- AND suite.id = override.suite
193- AND override.package = %s
194- AND suite.suite_name = %s
195- """, (sourcepackage, self.suite))[0]
196
197=== modified file 'lib/lp/soyuz/scripts/gina/packages.py'
198--- lib/lp/soyuz/scripts/gina/packages.py 2011-08-22 11:50:51 +0000
199+++ lib/lp/soyuz/scripts/gina/packages.py 2011-09-15 04:49:09 +0000
200@@ -13,7 +13,6 @@
201
202
203 __all__ = [
204- 'AbstractPackageData',
205 'BinaryPackageData',
206 'get_dsc_path',
207 'PoolFileNotFound',
208@@ -165,40 +164,6 @@
209 return v
210
211
212-def get_person_by_key(keyrings, key):
213- # XXX kiko 2005-10-23: Untested, should probably be a method.
214- if key and key not in ("NOSIG", "None", "none"):
215- command = ("gpg --no-options --no-default-keyring "
216- "--with-colons --fingerprint %s %s" % (key, keyrings))
217- h = os.popen(command, "r")
218- for line in h.readlines():
219- if line.startswith("pub"):
220- break
221- else:
222- log.warn("Broke parsing gpg output for %s" % key)
223- return None
224-
225- line = line.split(":")
226- algo = int(line[3])
227- id = line[4][-8:]
228- algorithm = algo
229- keysize = line[2]
230- user, rest = line[9].split("<", 1)
231- email = rest.split(">")[0].lower()
232- if line[1] == "-":
233- is_revoked = 0
234- else:
235- is_revoked = 1
236-
237- h = os.popen("gpg --export --no-default-keyring %s "
238- "--armor %s" % (keyrings, key), "r")
239- armor = h.read().strip()
240-
241- return (user, email, id, armor, is_revoked, algorithm, keysize)
242- else:
243- return None
244-
245-
246 #
247 # Exception classes
248 #
249@@ -264,7 +229,7 @@
250 if missing:
251 raise MissingRequiredArguments(missing)
252
253- def process_package(self, kdb, archive_root, keyrings):
254+ def process_package(self, archive_root):
255 """Process the package using the files located in the archive.
256
257 Raises PoolFileNotFound if a file is not found in the pool.
258@@ -282,23 +247,16 @@
259 # leave it around for forensics.
260 shutil.rmtree(tempdir)
261
262- # XXX kiko 2005-10-18: Katie is disabled for the moment;
263- # hardcode the date_uploaded and c'est la vie.
264- # if not self.do_katie(kdb, keyrings):
265- # return False
266 self.date_uploaded = UTC_NOW
267- self.is_processed = True
268 return True
269
270 def do_package(self, archive_root):
271- raise NotImplementedError
272-
273- def do_katie(self, kdb, keyrings):
274+ """To be provided by derived class."""
275 raise NotImplementedError
276
277
278 class SourcePackageData(AbstractPackageData):
279- """This Class holds important data to a given sourcepackagerelease."""
280+ """Important data relating to a given `SourcePackageRelease`."""
281
282 # Defaults, overwritten by __init__
283 directory = None
284@@ -308,23 +266,24 @@
285 build_depends_indep = ""
286 build_conflicts = ""
287 build_conflicts_indep = ""
288- # XXX kiko 2005-10-30: This isn't stored at all.
289 standards_version = ""
290 section = None
291 format = None
292
293- # XXX kiko 2005-11-05: Not used anywhere.
294- priority = None
295-
296- is_processed = False
297- is_created = False
298-
299 # These arguments /must/ have been set in the Sources file and
300 # supplied to __init__ as keyword arguments. If any are not, a
301 # MissingRequiredArguments exception is raised.
302 _required = [
303- 'package', 'binaries', 'version', 'maintainer', 'section',
304- 'architecture', 'directory', 'files', 'component']
305+ 'package',
306+ 'binaries',
307+ 'version',
308+ 'maintainer',
309+ 'section',
310+ 'architecture',
311+ 'directory',
312+ 'files',
313+ 'component',
314+ ]
315
316 def __init__(self, **args):
317 for k, v in args.items():
318@@ -345,33 +304,26 @@
319 elif k == 'Maintainer':
320 displayname, emailaddress = parse_person(v)
321 try:
322- self.maintainer = (encoding.guess(displayname),
323- emailaddress)
324+ self.maintainer = (
325+ encoding.guess(displayname),
326+ emailaddress,
327+ )
328 except UnicodeDecodeError:
329- raise DisplayNameDecodingError("Could not decode "
330- "name %s" % displayname)
331+ raise DisplayNameDecodingError(
332+ "Could not decode name %s" % displayname)
333 elif k == 'Files':
334 self.files = []
335 files = v.split("\n")
336 for f in files:
337 self.files.append(stripseq(f.split(" ")))
338- elif k == 'Uploaders':
339- # XXX kiko 2005-10-19: We don't do anything with this data,
340- # but I suspect we should.
341- people = stripseq(v.split(","))
342- self.uploaders = [person.split(" ", 1) for person in people]
343 else:
344 setattr(self, k.lower().replace("-", "_"), v)
345
346 if self.section is None:
347- # XXX kiko 2005-11-05: Untested and disabled.
348- # if kdb:
349- # log.warn("Source package %s lacks section, "
350- # "looking it up..." % self.package)
351- # self.section = kdb.getSourceSection(self.package)
352 self.section = 'misc'
353- log.warn("Source package %s lacks section, assumed %r" %
354- (self.package, self.section))
355+ log.warn(
356+ "Source package %s lacks section, assumed %r",
357+ self.package, self.section)
358
359 if '/' in self.section:
360 # this apparently happens with packages in universe.
361@@ -414,17 +366,18 @@
362 log.warn("Changelog empty for source %s (%s)" %
363 (self.package, self.version))
364
365- def ensure_complete(self, kdb):
366+ def ensure_complete(self):
367 if self.format is None:
368 # XXX kiko 2005-11-05: this is very funny. We care so much about
369 # it here, but we don't do anything about this in handlers.py!
370- log.warn("Invalid format in %s, assumed %r" %
371- (self.package, "1.0"))
372 self.format = "1.0"
373+ log.warn(
374+ "Invalid format in %s, assumed %r", self.package, self.format)
375
376 if self.urgency not in ChangesFile.urgency_map:
377- log.warn("Invalid urgency in %s, %r, assumed %r" %
378- (self.package, self.urgency, "low"))
379+ log.warn(
380+ "Invalid urgency in %s, %r, assumed %r",
381+ self.package, self.urgency, "low")
382 self.urgency = "low"
383
384
385@@ -435,9 +388,20 @@
386 # They are passed in as keyword arguments. If any are not set, a
387 # MissingRequiredArguments exception is raised.
388 _required = [
389- 'package', 'installed_size', 'maintainer', 'section',
390- 'architecture', 'version', 'filename', 'component',
391- 'size', 'md5sum', 'description', 'summary', 'priority']
392+ 'package',
393+ 'installed_size',
394+ 'maintainer',
395+ 'section',
396+ 'architecture',
397+ 'version',
398+ 'filename',
399+ 'component',
400+ 'size',
401+ 'md5sum',
402+ 'description',
403+ 'summary',
404+ 'priority',
405+ ]
406
407 # Set in __init__
408 source = None
409@@ -463,10 +427,6 @@
410 # Overwritten in do_package, optionally
411 shlibs = None
412
413- #
414- is_processed = False
415- is_created = False
416- #
417 source_version_re = re.compile(r'([^ ]+) +\(([^\)]+)\)')
418
419 def __init__(self, **args):
420@@ -491,8 +451,6 @@
421 "not a valid integer: %r" % v)
422 else:
423 setattr(self, k.lower().replace("-", "_"), v)
424- # XXX kiko 2005-11-03: "enhances" is not used and not stored
425- # anywhere, same for "pre_depends"
426
427 if self.source:
428 # We need to handle cases like "Source: myspell
429@@ -527,13 +485,15 @@
430
431 if self.section is None:
432 self.section = 'misc'
433- log.warn("Binary package %s lacks a section, assumed %r" %
434- (self.package, self.section))
435+ log.warn(
436+ "Binary package %s lacks a section, assumed %r",
437+ self.package, self.section)
438
439 if self.priority is None:
440 self.priority = 'extra'
441- log.warn("Binary package %s lacks valid priority, assumed %r" %
442- (self.package, self.priority))
443+ log.warn(
444+ "Binary package %s lacks valid priority, assumed %r",
445+ self.package, self.priority)
446
447 AbstractPackageData.__init__(self)
448
449
450=== modified file 'scripts/gina.py'
451--- scripts/gina.py 2011-09-13 13:56:49 +0000
452+++ scripts/gina.py 2011-09-15 04:49:09 +0000
453@@ -19,7 +19,6 @@
454
455 __metaclass__ = type
456
457-import os
458 import sys
459 import time
460
461@@ -44,7 +43,6 @@
462 MultiplePackageReleaseError,
463 NoSourcePackageError,
464 )
465-from lp.soyuz.scripts.gina.katie import Katie
466 from lp.soyuz.scripts.gina.packages import (
467 BinaryPackageData,
468 DisplayNameDecodingError,
469@@ -58,26 +56,12 @@
470 COUNTDOWN = 0
471
472
473-def _get_keyring(keyrings_root):
474- # XXX kiko 2005-10-23: untested
475- keyrings = ""
476- for keyring in os.listdir(keyrings_root):
477- path = os.path.join(keyrings_root, keyring)
478- keyrings += " --keyring=%s" % path
479- if not keyrings:
480- raise AttributeError("Keyrings not found in ./keyrings/")
481- return keyrings
482-
483-
484 def run_gina(options, ztm, target_section):
485 # Avoid circular imports.
486 from lp.registry.interfaces.pocket import PackagePublishingPocket
487
488 package_root = target_section.root
489- keyrings_root = target_section.keyrings
490 distro = target_section.distro
491- # XXX kiko 2005-10-23: I honestly think having a separate distroseries
492- # bit silly. Can't we construct this based on `distroseries-pocket`?
493 pocket_distroseries = target_section.pocketrelease
494 distroseries = target_section.distroseries
495 components = [c.strip() for c in target_section.components.split(",")]
496@@ -87,21 +71,17 @@
497 source_only = target_section.source_only
498 spnames_only = target_section.sourcepackagenames_only
499
500- KTDB = target_section.katie_dbname
501-
502 LIBRHOST = config.librarian.upload_host
503 LIBRPORT = config.librarian.upload_port
504
505 log.info("")
506 log.info("=== Processing %s/%s/%s ===", distro, distroseries, pocket)
507 log.debug("Packages read from: %s", package_root)
508- log.debug("Keyrings read from: %s", keyrings_root)
509 log.info("Components to import: %s", ", ".join(components))
510 if component_override is not None:
511 log.info("Override components to: %s", component_override)
512 log.info("Architectures to import: %s", ", ".join(archs))
513 log.debug("Launchpad database: %s", config.database.rw_main_master)
514- log.info("Katie database: %s", KTDB)
515 log.info("SourcePackage Only: %s", source_only)
516 log.info("SourcePackageName Only: %s", spnames_only)
517 log.debug("Librarian: %s:%s", LIBRHOST, LIBRPORT)
518@@ -120,12 +100,6 @@
519 log.error("Could not find component %s", component_override)
520 sys.exit(1)
521
522- kdb = None
523- keyrings = None
524- if KTDB:
525- kdb = Katie(KTDB, distroseries)
526- keyrings = _get_keyring(keyrings_root)
527-
528 try:
529 arch_component_items = ArchiveComponentItems(
530 package_root, pocket_distroseries, components, archs,
531@@ -137,11 +111,9 @@
532
533 packages_map = PackagesMap(arch_component_items)
534 importer_handler = ImporterHandler(
535- ztm, distro, distroseries, kdb, package_root, keyrings, pocket,
536- component_override)
537+ ztm, distro, distroseries, package_root, pocket, component_override)
538
539- import_sourcepackages(
540- packages_map, kdb, package_root, keyrings, importer_handler)
541+ import_sourcepackages(packages_map, package_root, importer_handler)
542 importer_handler.commit()
543
544 # XXX JeroenVermeulen 2011-09-07 bug=843728: Dominate binaries as well.
545@@ -160,27 +132,23 @@
546 log.exception("Database setup required for run on %s", archtag)
547 sys.exit(1)
548
549- import_binarypackages(
550- packages_map, kdb, package_root, keyrings, importer_handler)
551+ import_binarypackages(packages_map, package_root, importer_handler)
552 importer_handler.commit()
553
554
555-def attempt_source_package_import(source, kdb, package_root, keyrings,
556- importer_handler):
557+def attempt_source_package_import(source, package_root, importer_handler):
558 """Attempt to import a source package, and handle typical errors."""
559 package_name = source.get("Package", "unknown")
560 try:
561 try:
562- do_one_sourcepackage(
563- source, kdb, package_root, keyrings, importer_handler)
564+ do_one_sourcepackage(source, package_root, importer_handler)
565 except psycopg2.Error:
566 log.exception(
567 "Database error: unable to create SourcePackage for %s. "
568 "Retrying once..", package_name)
569 importer_handler.abort()
570 time.sleep(15)
571- do_one_sourcepackage(
572- source, kdb, package_root, keyrings, importer_handler)
573+ do_one_sourcepackage(source, package_root, importer_handler)
574 except (
575 InvalidVersionError, MissingRequiredArguments,
576 DisplayNameDecodingError):
577@@ -199,8 +167,7 @@
578 "Database duplication processing %s", package_name)
579
580
581-def import_sourcepackages(packages_map, kdb, package_root,
582- keyrings, importer_handler):
583+def import_sourcepackages(packages_map, package_root, importer_handler):
584 # Goes over src_map importing the sourcepackages packages.
585 count = 0
586 npacks = len(packages_map.src_map)
587@@ -210,27 +177,25 @@
588 for source in packages_map.src_map[package]:
589 count += 1
590 attempt_source_package_import(
591- source, kdb, package_root, keyrings, importer_handler)
592+ source, package_root, importer_handler)
593 if COUNTDOWN and (count % COUNTDOWN == 0):
594 log.warn('%i/%i sourcepackages processed', count, npacks)
595
596
597-def do_one_sourcepackage(source, kdb, package_root, keyrings,
598- importer_handler):
599+def do_one_sourcepackage(source, package_root, importer_handler):
600 source_data = SourcePackageData(**source)
601 if importer_handler.preimport_sourcecheck(source_data):
602 # Don't bother reading package information if the source package
603 # already exists in the database
604 log.info('%s already exists in the archive', source_data.package)
605 return
606- source_data.process_package(kdb, package_root, keyrings)
607- source_data.ensure_complete(kdb)
608+ source_data.process_package(package_root)
609+ source_data.ensure_complete()
610 importer_handler.import_sourcepackage(source_data)
611 importer_handler.commit()
612
613
614-def import_binarypackages(packages_map, kdb, package_root, keyrings,
615- importer_handler):
616+def import_binarypackages(packages_map, package_root, importer_handler):
617 nosource = []
618
619 # Run over all the architectures we have
620@@ -245,16 +210,16 @@
621 count += 1
622 try:
623 try:
624- do_one_binarypackage(binary, archtag, kdb, package_root,
625- keyrings, importer_handler)
626+ do_one_binarypackage(
627+ binary, archtag, package_root, importer_handler)
628 except psycopg2.Error:
629 log.exception(
630 "Database errors when importing a BinaryPackage "
631 "for %s. Retrying once..", package_name)
632 importer_handler.abort()
633 time.sleep(15)
634- do_one_binarypackage(binary, archtag, kdb, package_root,
635- keyrings, importer_handler)
636+ do_one_binarypackage(
637+ binary, archtag, package_root, importer_handler)
638 except (InvalidVersionError, MissingRequiredArguments):
639 log.exception(
640 "Unable to create BinaryPackageData for %s", package_name)
641@@ -291,13 +256,12 @@
642 log.warn(pkg)
643
644
645-def do_one_binarypackage(binary, archtag, kdb, package_root, keyrings,
646- importer_handler):
647+def do_one_binarypackage(binary, archtag, package_root, importer_handler):
648 binary_data = BinaryPackageData(**binary)
649 if importer_handler.preimport_binarycheck(archtag, binary_data):
650 log.info('%s already exists in the archive', binary_data.package)
651 return
652- binary_data.process_package(kdb, package_root, keyrings)
653+ binary_data.process_package(package_root)
654 importer_handler.import_binarypackage(archtag, binary_data)
655 importer_handler.commit()
656