Skip to content

Commit

Permalink
Add non-free-firmware as a known area.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyril Brulebois authored and Matthieu Caneill committed Jun 19, 2023
1 parent bb4a011 commit d86200b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contrib/docker/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/sources-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion etc/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/debsources/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
8 changes: 6 additions & 2 deletions lib/debsources/debmirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@ 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
try:
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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion lib/debsources/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/debsources/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d86200b

Please sign in to comment.