Skip to content

Make possible using distro release number (lsb_release -rs) in unatended-upgrage config file as ${distro-release} #388

@jacek-kubek

Description

@jacek-kubek

I want to configure unattended-updates to automatically update the UrBackup server (the urbackup-server package from the Uroni repository https://download.opensuse.org/repositories/home:/uroni/Debian_13/).

I checked the apt-cache policy to see what I need to add to the unattended-upgrades configuration file:

500 https://download.opensuse.org/repositories/home:/uroni/Debian_13 Packages
release o=obs://build.opensuse.org/home:uroni/Debian_13,n=Debian_13,l=home:uroni,c=
origin download.opensuse.org

From what I understand, I need to add:

Unattended-Upgrade::Origins-Pattern {
"o=obs://build.opensuse.org/home:uroni/Debian_${distro-release},n=Debian_${distro-release},l=home:uroni";
};

If I do this, I get an error:

ValueError: Invalid placeholder in string

I checked the source code and found that distro-release is not mapped:

def replace(line):
# type: (str) -> str
""" substitue known mappings and returns a new string

Currently supported ${distro-release}
"""
mapping = {"distro_codename": get_distro_codename(),
"distro_id": get_distro_id()}
return string.Template(line).substitute(mapping)

BTW: What does the comment Currently supported ${distro-release} mean?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions