From 27c2361dccaa50d2c16cf1fe60dc4e45f15d3a57 Mon Sep 17 00:00:00 2001 From: Kenyon Ralph Date: Mon, 10 Jun 2024 12:56:37 -0700 Subject: [PATCH] backports: pin using codename on Debian Debian 11 bullseye and Debian 12 bookworm backports release files look like this: https://deb.debian.org/debian/dists/bullseye-backports/InRelease: Suite: bullseye-backports Codename: bullseye-backports https://deb.debian.org/debian/dists/bookworm-backports/InRelease: Suite: stable-backports Codename: bookworm-backports Using "release" (aka Suite in the InRelease file) causes our pin to not match for bookworm because they changed it to stable-backports instead of $codename-backports. We can use codename to support both for this pin. Fixes #1187. --- manifests/backports.pp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manifests/backports.pp b/manifests/backports.pp index 7606a4b463..ef650f1bc8 100644 --- a/manifests/backports.pp +++ b/manifests/backports.pp @@ -94,11 +94,14 @@ if $pin =~ Hash { $_pin = $pin } elsif $pin =~ Numeric or $pin =~ String { - # apt::source defaults to pinning to origin, but we should pin to release - # for backports + $pin_type = $facts['os']['name'] ? { + 'Debian' => 'codename', + 'Ubuntu' => 'release', + } + $_pin = { 'priority' => $pin, - 'release' => $_release, + $pin_type => $_release, } } else { fail('pin must be either a string, number or hash')