Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15:Update
salt.15448
decide-if-the-source-should-be-actually-skipped...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File decide-if-the-source-should-be-actually-skipped.patch of Package salt.15448
From 615a8f8dfa8ef12eeb4c387e48309cc466b8597d Mon Sep 17 00:00:00 2001 From: Bo Maryniuk <bo@suse.de> Date: Tue, 4 Dec 2018 16:39:08 +0100 Subject: [PATCH] Decide if the source should be actually skipped --- salt/modules/aptpkg.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py index 4ec9158476..3b0d8423db 100644 --- a/salt/modules/aptpkg.py +++ b/salt/modules/aptpkg.py @@ -1620,6 +1620,27 @@ def list_repo_pkgs(*args, **kwargs): # pylint: disable=unused-import return ret +def _skip_source(source): + ''' + Decide to skip source or not. + + :param source: + :return: + ''' + if source.invalid: + if source.uri and source.type and source.type in ("deb", "deb-src", "rpm", "rpm-src"): + pieces = source.mysplit(source.line) + if pieces[1].strip()[0] == "[": + options = pieces.pop(1).strip("[]").split() + if len(options) > 0: + log.debug("Source %s will be included although is marked invalid", source.uri) + return False + return True + else: + return True + return False + + def list_repos(): ''' Lists all repos in the sources.list (and sources.lists.d) files @@ -1635,7 +1656,7 @@ def list_repos(): repos = {} sources = sourceslist.SourcesList() for source in sources.list: - if source.invalid: + if _skip_source(source): continue repo = {} repo['file'] = source.file -- 2.16.4
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