Import file list of revisions

This commit is contained in:
Stephan Kulow
2022-10-18 19:29:25 +02:00
parent 1a750f2171
commit 89c0335812
4 changed files with 84 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
import functools
import logging
import xml.etree.ElementTree as ET
from lib.binary import is_binary_or_large
from lib.db import DB
@@ -154,9 +155,22 @@ class Importer:
self.update_db_package(db, lproject, lpackage)
for rev in DBRevision.all_revisions(db, project, self.package):
print(rev, rev.linked_rev(db))
if rev.broken or rev.expanded_srcmd5:
continue
linked_rev = rev.linked_rev(db)
if linked_rev:
linked_rev = linked_rev.unexpanded_srcmd5
list = self.obs.list(
project, self.package, rev.unexpanded_srcmd5, linked_rev
)
if list:
print(ET.tostring(list).decode("utf-8"))
rev.import_dir_list(db, list)
else:
rev.set_broken(db)
cur.close()
db.conn.commit()
def import_all_revisions(self, gc):
# Fetch all the requests and sort them. Ideally we should