reprepro : add labels

For reasons explained in [1] Debian's lsb_release.py on bullseye is
falling back to probing "apt-cache policy"

  When (as currently), stretch is the testing release,
  /etc/debian_version contains "stretch/sid", as shipped by
  base-files. It is therefore impossible to rely on that file to
  differentiate between a host running testing or unstable without
  asking apt what is actually preferred when installing packages
  (through parsing `apt-cache policy`). That's how `lsb-release --
  codename` returns "sid" _xor_ "stretch".

The problem is, this parses the output of "apt-cache policy" which
fails for two reasons; firsly we have cleared out all the cache files,
so our hosts return anything until "apt-get update" is run, but
secondly because our mirrors do not have a "label" that matches in
this code at [2]

e.g. what we get out of "apt-cache policy" is

  500 https://mirror.dfw.rax.opendev.org/debian bullseye/main amd64 Packages
      release o=Debian,n=bullseye,c=main,b=amd64
      origin mirror.dfw.rax.opendev.org

which is missing a "l=" field to make this parsing recognise it as a
valid source.

The label is set by reprepro [3]

  Label
    This optional field is simply copied into the Release files.

Add a label to make our mirrors look more like regular mirrors.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845651
[2] https://sources.debian.org/src/lsb/11.1.0/lsb_release.py/#L191
[3] https://manpages.debian.org/stretch/reprepro/reprepro.1.en.html

Change-Id: Id705acbb3a01f43ae635a24fa3c24d0a05bdaa16
This commit is contained in:
Ian Wienand
2021-04-23 13:07:58 +10:00
parent 0b4b00ff26
commit cc6b1c8810
2 changed files with 21 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
Origin: Debian
Label: Debian
Codename: stretch
Description: OpenStack Debian Stretch mirror
Architectures: amd64 arm64 source
@@ -9,6 +10,7 @@ Update: debian
Log: /var/log/reprepro/debian-stretch.log
Origin: Debian
Label: Debian
Codename: stretch-updates
Description: OpenStack Debian Stretch Updates mirror
Architectures: amd64 arm64 source
@@ -18,8 +20,8 @@ Contents: .gz
Update: debian
Log: /var/log/reprepro/debian-stretch-updates.log
Origin: Debian Backports
Label: Debian Backports
Codename: stretch-backports
NotAutomatic: yes
ButAutomaticUpgrades: yes
@@ -32,6 +34,7 @@ Update: debian
Log: /var/log/reprepro/debian-stretch-backports.log
Origin: Debian
Label: Debian
Codename: buster
Description: OpenStack Debian Buster mirror
Architectures: amd64 arm64 source
@@ -42,6 +45,7 @@ Update: debian
Log: /var/log/reprepro/debian-buster.log
Origin: Debian
Label: Debian
Codename: buster-updates
Description: OpenStack Debian Buster Updates mirror
Architectures: amd64 arm64 source
@@ -53,6 +57,7 @@ Log: /var/log/reprepro/debian-buster-updates.log
Origin: Debian Backports
Label: Debian Backports
Codename: buster-backports
NotAutomatic: yes
ButAutomaticUpgrades: yes
@@ -66,6 +71,7 @@ Log: /var/log/reprepro/debian-buster-backports.log
Origin: Debian
Label: Debian
Codename: bullseye
Description: OpenStack Debian Bullseye mirror
Architectures: amd64 arm64 source
@@ -76,6 +82,7 @@ Update: debian
Log: /var/log/reprepro/debian-bullseye.log
Origin: Debian
Label: Debian
Codename: bullseye-updates
Description: OpenStack Debian Bullseye Updates mirror
Architectures: amd64 arm64 source
@@ -86,6 +93,7 @@ Update: debian
Log: /var/log/reprepro/debian-bullseye-updates.log
Origin: Debian Backports
Label: Debian Backports
Codename: bullseye-backports
NotAutomatic: yes
ButAutomaticUpgrades: yes

View File

@@ -1,4 +1,5 @@
Origin: Ubuntu
Label: Ubuntu
Codename: bionic
Description: OpenStack Ubuntu Bionic mirror
Architectures: amd64 source
@@ -9,6 +10,7 @@ Update: ubuntu
Log: /var/log/reprepro/ubuntu-bionic.log
Origin: Ubuntu
Label: Ubuntu
Codename: bionic-updates
Description: OpenStack Ubuntu Bionic Updates mirror
Architectures: amd64 source
@@ -19,6 +21,7 @@ Update: ubuntu
Log: /var/log/reprepro/ubuntu-bionic-updates.log
Origin: Ubuntu
Label: Ubuntu
Codename: bionic-backports
Description: OpenStack Ubuntu Bionic Backports mirror
Architectures: amd64 source
@@ -31,6 +34,7 @@ ButAutomaticUpgrades: yes
Log: /var/log/reprepro/ubuntu-bionic-backports.log
Origin: Ubuntu
Label: Ubuntu
Codename: bionic-security
Description: OpenStack Ubuntu Bionic Security mirror
Architectures: amd64 source
@@ -41,6 +45,7 @@ Update: ubuntu-security
Log: /var/log/reprepro/ubuntu-bionic-security.log
Origin: Ubuntu
Label: Ubuntu
Codename: focal
Description: OpenStack Ubuntu Focal mirror
Architectures: amd64 source
@@ -51,6 +56,7 @@ Update: ubuntu
Log: /var/log/reprepro/ubuntu-focal.log
Origin: Ubuntu
Label: Ubuntu
Codename: focal-updates
Description: OpenStack Ubuntu Focal Updates mirror
Architectures: amd64 source
@@ -61,6 +67,7 @@ Update: ubuntu
Log: /var/log/reprepro/ubuntu-focal-updates.log
Origin: Ubuntu
Label: Ubuntu
Codename: focal-backports
Description: OpenStack Ubuntu Focal Backports mirror
Architectures: amd64 source
@@ -73,6 +80,7 @@ ButAutomaticUpgrades: yes
Log: /var/log/reprepro/ubuntu-focal-backports.log
Origin: Ubuntu
Label: Ubuntu
Codename: focal-security
Description: OpenStack Ubuntu Focal Security mirror
Architectures: amd64 source
@@ -83,6 +91,7 @@ Update: ubuntu-security
Log: /var/log/reprepro/ubuntu-focal-security.log
Origin: Ubuntu
Label: Ubuntu
Codename: xenial
Description: OpenStack Ubuntu Xenial mirror
Architectures: amd64 source
@@ -93,6 +102,7 @@ Update: ubuntu
Log: /var/log/reprepro/ubuntu-xenial.log
Origin: Ubuntu
Label: Ubuntu
Codename: xenial-updates
Description: OpenStack Ubuntu Xenial Updates mirror
Architectures: amd64 source
@@ -103,6 +113,7 @@ Update: ubuntu
Log: /var/log/reprepro/ubuntu-xenial-updates.log
Origin: Ubuntu
Label: Ubuntu
Codename: xenial-backports
Description: OpenStack Ubuntu Xenial Backports mirror
Architectures: amd64 source
@@ -115,6 +126,7 @@ ButAutomaticUpgrades: yes
Log: /var/log/reprepro/ubuntu-xenial-backports.log
Origin: Ubuntu
Label: Ubuntu
Codename: xenial-security
Description: OpenStack Ubuntu Xenial Security mirror
Architectures: amd64 source