From d86200b8f98737f8f14811ae207ef44613a71af3 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Mon, 19 Jun 2023 21:05:29 +0000 Subject: [PATCH] Add non-free-firmware as a known area. --- contrib/docker/config.ini | 2 +- doc/sources-cache.md | 2 +- etc/config.ini | 2 +- lib/debsources/consts.py | 2 +- lib/debsources/debmirror.py | 8 ++++++-- lib/debsources/models.py | 2 +- lib/debsources/navigation.py | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/contrib/docker/config.ini b/contrib/docker/config.ini index 73166ab4..f78b2006 100644 --- a/contrib/docker/config.ini +++ b/contrib/docker/config.ini @@ -22,7 +22,7 @@ sqlalchemy_echo: false mirror_host: ftp.de.debian.org mirror_suites: jessie, wheezy # Note: "wheezy-backports" name hardcoded above due to #714726 -mirror_sections: main,contrib,non-free +mirror_sections: main,contrib,non-free,non-free-firmware bin_dir: %(root_dir)s/bin expire_days: 14 passes: db fs hooks hooks.db hooks.fs diff --git a/doc/sources-cache.md b/doc/sources-cache.md index 8566f287..c13d46ef 100644 --- a/doc/sources-cache.md +++ b/doc/sources-cache.md @@ -19,7 +19,7 @@ The format is as follows: - **VERSION**: source package version - - **AREA**: package archive area, one of `main`, `contrib`, `non-free` + - **AREA**: package archive area, one of `main`, `contrib`, `non-free`, `non-free-firmware` - **DSC**: absolute path to the corresponding `.dsc` file diff --git a/etc/config.ini b/etc/config.ini index 099d1ab0..e1a49e21 100644 --- a/etc/config.ini +++ b/etc/config.ini @@ -26,7 +26,7 @@ single_transaction: false mirror_host: ftp.de.debian.org mirror_suites: oldoldstable,oldstable,stable,testing,unstable,experimental,oldoldstable-proposed-updates,oldstable-proposed-updates,stable-proposed-updates,testing-proposed-updates,oldoldstable-updates,oldstable-updates,stable-updates,wheezy-backports,jessie-backports,squeeze-lts # Note: "*-backports" name hardcoded above due to #714726 -mirror_sections: main,contrib,non-free +mirror_sections: main,contrib,non-free,non-free-firmware bin_dir: %(root_dir)s/bin expire_days: 7 backends: db fs hooks hooks.db hooks.fs diff --git a/lib/debsources/consts.py b/lib/debsources/consts.py index a12642b3..31fed8d5 100644 --- a/lib/debsources/consts.py +++ b/lib/debsources/consts.py @@ -122,7 +122,7 @@ # debian package areas -AREAS = ["main", "contrib", "non-free"] +AREAS = ["main", "contrib", "non-free", "non-free-firmware"] # sane (?) default if the package prefix file is not available PREFIXES_DEFAULT = [ diff --git a/lib/debsources/debmirror.py b/lib/debsources/debmirror.py index acde96ea..07c0bd9d 100644 --- a/lib/debsources/debmirror.py +++ b/lib/debsources/debmirror.py @@ -88,8 +88,8 @@ def __str__(self): def archive_area(self): """return package are in the debian achive - one of: main, contrib, non-free. Return `None` if the archive area - cannot be figured out + one of: main, contrib, non-free, non-free-firmware. Return `None` if + the archive area cannot be figured out """ area = None @@ -97,6 +97,8 @@ def archive_area(self): sec = self["section"] if sec.startswith("contrib"): area = "contrib" + elif sec.startswith("non-free-firmware"): + area = "non-free-firmware" elif sec.startswith("non-free"): area = "non-free" else: @@ -106,6 +108,8 @@ def archive_area(self): try: directory = self["directory"] steps = directory.split("/") + if "non-free-firmware" in steps: + area = "non-free-firmware" if "non-free" in steps: area = "non-free" elif "contrib" in steps: diff --git a/lib/debsources/models.py b/lib/debsources/models.py index 204fd407..2b92a577 100644 --- a/lib/debsources/models.py +++ b/lib/debsources/models.py @@ -85,7 +85,7 @@ class Package(Base): index=True, nullable=False, ) - area = Column(String(8), index=True) # main, contrib, non-free + area = Column(String(8), index=True) # main, contrib, non-free, non-free-firmware vcs_type = Column(Enum(*VCS_TYPES, name="vcs_types")) vcs_url = Column(String) vcs_browser = Column(String) diff --git a/lib/debsources/navigation.py b/lib/debsources/navigation.py index 6d9a61cc..558152bc 100644 --- a/lib/debsources/navigation.py +++ b/lib/debsources/navigation.py @@ -60,7 +60,7 @@ def _get_debian_path(self, session, package, version, sources_dir) -> Path: # to allow codesearch.d.n and others less up-to-date platforms # to point here. # Problem: we don't know the area of such a package - # so we try in main, contrib and non-free. + # so we try in main, contrib, non-free and non-free-firmware. for area in AREAS: if Path.exists(Path(sources_dir) / area / prefix / package / version): return Path(area) / prefix