forked from adamm/git-importer
Add a list of packages no longer existing
I made this a file and not a DB that is automatically maintained as I think for now adding an entry in there should be done manually - OBS being OBS packages might look have gone for a brief moment and reappar the day after.
This commit is contained in:
parent
9962673eff
commit
999dcabcfa
1355
gone-packages.txt
Normal file
1355
gone-packages.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,6 @@
|
|||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
import logging
|
import logging
|
||||||
|
import pathlib
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
from lib.db import DB
|
from lib.db import DB
|
||||||
@ -31,6 +32,7 @@ class Importer:
|
|||||||
self.obs = OBS(api_url)
|
self.obs = OBS(api_url)
|
||||||
assert project == "openSUSE:Factory"
|
assert project == "openSUSE:Factory"
|
||||||
self.refreshed_packages = set()
|
self.refreshed_packages = set()
|
||||||
|
self.gone_packages_set = None
|
||||||
|
|
||||||
def import_request(self, number):
|
def import_request(self, number):
|
||||||
self.obs.request(number).import_into_db(self.db)
|
self.obs.request(number).import_into_db(self.db)
|
||||||
@ -208,6 +210,8 @@ class Importer:
|
|||||||
if key in self.refreshed_packages:
|
if key in self.refreshed_packages:
|
||||||
# refreshing once is good enough
|
# refreshing once is good enough
|
||||||
return
|
return
|
||||||
|
if self.package_gone(key):
|
||||||
|
return
|
||||||
logging.debug(f"Refresh {project}/{package}")
|
logging.debug(f"Refresh {project}/{package}")
|
||||||
self.refreshed_packages.add(key)
|
self.refreshed_packages.add(key)
|
||||||
self.update_db_package(project, package)
|
self.update_db_package(project, package)
|
||||||
@ -254,3 +258,11 @@ class Importer:
|
|||||||
|
|
||||||
self.fill_file_lists()
|
self.fill_file_lists()
|
||||||
self.db.conn.commit()
|
self.db.conn.commit()
|
||||||
|
|
||||||
|
def package_gone(self, key):
|
||||||
|
if not self.gone_packages_set:
|
||||||
|
self.gone_packages_set = set()
|
||||||
|
with open(pathlib.Path(__file__).parent.parent / "gone-packages.txt") as f:
|
||||||
|
for line in f.readlines():
|
||||||
|
self.gone_packages_set.add(line.strip())
|
||||||
|
return key in self.gone_packages_set
|
||||||
|
Loading…
Reference in New Issue
Block a user