Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:PSuarezHernandez:bundlenew:Ubuntu2204
saltbundlepy-apt
0000-handle-signed-by-in-sources-list.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0000-handle-signed-by-in-sources-list.patch of Package saltbundlepy-apt
From 35fe92ef83b96d3afa31dd65ec90f2bf9f130d4b Mon Sep 17 00:00:00 2001 From: Zara <zara.zaimeche@suse.com> Date: Fri, 14 Apr 2023 13:48:40 +0100 Subject: [PATCH 1/1] Handle 'signed-by' parameter in sources.list Previously, python-apt treated sources.list entries with a 'signed-by' parameter as invalid, despite this being a valid parameter to include. This patch adds support for the 'signed-by' parameter. --- aptsources/sourceslist.py | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py index 6aafe3bb..b017f038 100644 --- a/aptsources/sourceslist.py +++ b/aptsources/sourceslist.py @@ -92,6 +92,7 @@ class SourceEntry(object): self.type = "" # what type (deb, deb-src) self.architectures = [] # architectures self.trusted = None # Trusted + self.signed_by = "" # gpg self.uri = "" # base-uri self.dist = "" # distribution (dapper, edgy, etc) self.comps = [] # list of available componetns (may empty) @@ -198,6 +199,8 @@ class SourceEntry(object): self.architectures = value.split(",") elif key == "trusted": self.trusted = apt_pkg.string_to_bool(value) + elif key == "signed-by": + self.signed_by = value else: self.invalid = True @@ -239,13 +242,23 @@ class SourceEntry(object): line += self.type - if self.architectures and self.trusted is not None: - line += " [arch=%s trusted=%s]" % ( - ",".join(self.architectures), "yes" if self.trusted else "no") - elif self.trusted is not None: - line += " [trusted=%s]" % ("yes" if self.trusted else "no") - elif self.architectures: - line += " [arch=%s]" % ",".join(self.architectures) + repo_opts = {} + + if self.architectures: + repo_opts["arch"] = ",".join(self.architectures) + + if self.trusted is not None: + repo_opts["trusted"] = "yes" if self.trusted else "no" + + if self.signed_by: + repo_opts["signed-by"] = self.signed_by + + if repo_opts: + _opts_str = "" + for key in repo_opts: + _opts_str += "%s=%s " % (key, repo_opts[key]) + line += " [%s]" % _opts_str.strip() + line += " %s %s" % (self.uri, self.dist) if len(self.comps) > 0: line += " " + " ".join(self.comps) -- 2.40.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor