Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/usage/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ This flag implies `--persistent`, and cannot be combined with `--clean yes`.
Only needed when `debian/changelog`'s top entry doesn't unambiguously determine the target: pass `--distro <codename>` (e.g. `--distro noble`, `--distro trixie`).
If the changelog has a single unambiguous entry, omit it.

Suite aliases in the changelog (or via `--distro`) resolve to a concrete release: Debian `stable` / `oldstable` / `sid` (→ `unstable`), and Ubuntu `devel`.
Alias targets are updated manually when Debian/Ubuntu roll.

## Proposed dependencies

If needed, build dependencies can be used from `<release>-proposed`.
Expand Down
24 changes: 21 additions & 3 deletions packages/debmagic-common/src/distro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,17 @@ static DISTRO_INFO_MAP: LazyLock<HashMap<&'static str, DistroVersion>> = LazyLoc
DistroVersion::new(Debian, "experimental", ""),
),
("unstable", DistroVersion::new(Debian, "unstable", "")),
("sid", DistroVersion::new(Debian, "sid", "")),
// Suite alias: sid → unstable (concrete release identity).
("sid", DistroVersion::new(Debian, "unstable", "")),
("testing", DistroVersion::new(Debian, "testing", "")),
("duke", DistroVersion::new(Debian, "duke", "15")),
("forky", DistroVersion::new(Debian, "forky", "14")),
("trixie", DistroVersion::new(Debian, "trixie", "13")),
// Suite alias: stable → current stable release (update when Debian rolls).
("stable", DistroVersion::new(Debian, "trixie", "13")),
("bookworm", DistroVersion::new(Debian, "bookworm", "12")),
// Suite alias: oldstable → current oldstable release.
("oldstable", DistroVersion::new(Debian, "bookworm", "12")),
("bullseye", DistroVersion::new(Debian, "bullseye", "11")),
("buster", DistroVersion::new(Debian, "buster", "10")),
("stretch", DistroVersion::new(Debian, "stretch", "9")),
Expand All @@ -73,6 +78,11 @@ static DISTRO_INFO_MAP: LazyLock<HashMap<&'static str, DistroVersion>> = LazyLoc
"stonking",
DistroVersion::new(Ubuntu, "stonking", "26.10").devel(),
),
// Suite alias: devel → current Ubuntu development release.
(
"devel",
DistroVersion::new(Ubuntu, "stonking", "26.10").devel(),
),
("resolute", DistroVersion::new(Ubuntu, "resolute", "26.04")),
("noble", DistroVersion::new(Ubuntu, "noble", "24.04")),
("jammy", DistroVersion::new(Ubuntu, "jammy", "22.04")),
Expand All @@ -83,6 +93,14 @@ static DISTRO_INFO_MAP: LazyLock<HashMap<&'static str, DistroVersion>> = LazyLoc
])
});

pub fn get_distro_version(codename: &str) -> Option<DistroVersion> {
DISTRO_INFO_MAP.get(codename).cloned()
/// Look up a distribution by codename or suite alias.
///
/// Suite aliases are map keys that resolve to a concrete release [`DistroVersion`]:
/// - Debian: `stable` → current stable release, `oldstable` → current oldstable,
/// `sid` → `unstable`
/// - Ubuntu: `devel` → current development release
///
/// Alias targets are maintained manually when Debian/Ubuntu roll.
pub fn get_distro_version(name: &str) -> Option<DistroVersion> {
DISTRO_INFO_MAP.get(name).cloned()
}
Loading