pungi-gather: add options for excluding debug and source packages
Signed-off-by: Frédéric Pierret (fepitre) <frederic.pierret@qubes-os.org>
This commit is contained in:
parent
01ab1d2e24
commit
c624aab945
@ -69,6 +69,12 @@ class GatherOptions(pungi.common.OptionsBase):
|
|||||||
# lookaside repos; packages will be flagged accordingly
|
# lookaside repos; packages will be flagged accordingly
|
||||||
self.lookaside_repos = []
|
self.lookaside_repos = []
|
||||||
|
|
||||||
|
# exclude source packages
|
||||||
|
self.exclude_source = False
|
||||||
|
|
||||||
|
# exclude debug packages
|
||||||
|
self.exclude_debug = False
|
||||||
|
|
||||||
self.merge_options(**kwargs)
|
self.merge_options(**kwargs)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
@ -83,7 +89,9 @@ class GatherOptions(pungi.common.OptionsBase):
|
|||||||
'multilib_blacklist=%d items' % len(self.multilib_blacklist),
|
'multilib_blacklist=%d items' % len(self.multilib_blacklist),
|
||||||
'multilib_whitelist=%d items' % len(self.multilib_whitelist),
|
'multilib_whitelist=%d items' % len(self.multilib_whitelist),
|
||||||
'lookaside_repos=%s' % self.lookaside_repos,
|
'lookaside_repos=%s' % self.lookaside_repos,
|
||||||
'prepopulate=%d items' % len(self.prepopulate)
|
'prepopulate=%d items' % len(self.prepopulate),
|
||||||
|
'exclude_source=%s' % self.exclude_source,
|
||||||
|
'exclude_debug=%s' % self.exclude_debug
|
||||||
]
|
]
|
||||||
return '[\n%s\n]' % '\n'.join(' ' + l for l in lines)
|
return '[\n%s\n]' % '\n'.join(' ' + l for l in lines)
|
||||||
|
|
||||||
@ -531,7 +539,7 @@ class Gather(GatherBase):
|
|||||||
def add_debug_package_deps(self):
|
def add_debug_package_deps(self):
|
||||||
added = set()
|
added = set()
|
||||||
|
|
||||||
if not self.opts.resolve_deps:
|
if not self.opts.resolve_deps or self.opts.exclude_debug:
|
||||||
return added
|
return added
|
||||||
|
|
||||||
for pkg in self.result_debug_packages.copy():
|
for pkg in self.result_debug_packages.copy():
|
||||||
@ -597,6 +605,8 @@ class Gather(GatherBase):
|
|||||||
return added
|
return added
|
||||||
if not self.opts.selfhosting:
|
if not self.opts.selfhosting:
|
||||||
return added
|
return added
|
||||||
|
if self.opts.exclude_source:
|
||||||
|
return added
|
||||||
|
|
||||||
for pkg in self.result_source_packages:
|
for pkg in self.result_source_packages:
|
||||||
assert pkg is not None
|
assert pkg is not None
|
||||||
@ -632,6 +642,9 @@ class Gather(GatherBase):
|
|||||||
"""
|
"""
|
||||||
added = set()
|
added = set()
|
||||||
|
|
||||||
|
if self.opts.exclude_source:
|
||||||
|
return added
|
||||||
|
|
||||||
for pkg in self.result_binary_packages:
|
for pkg in self.result_binary_packages:
|
||||||
assert pkg is not None
|
assert pkg is not None
|
||||||
|
|
||||||
@ -669,6 +682,9 @@ class Gather(GatherBase):
|
|||||||
"""
|
"""
|
||||||
added = set()
|
added = set()
|
||||||
|
|
||||||
|
if self.opts.exclude_debug:
|
||||||
|
return added
|
||||||
|
|
||||||
for pkg in self.result_binary_packages:
|
for pkg in self.result_binary_packages:
|
||||||
assert pkg is not None
|
assert pkg is not None
|
||||||
|
|
||||||
|
@ -78,6 +78,18 @@ def get_parser():
|
|||||||
help="path to temp dir (default: /tmp)",
|
help="path to temp dir (default: /tmp)",
|
||||||
default="/tmp",
|
default="/tmp",
|
||||||
)
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"--exclude-source",
|
||||||
|
action="store_true",
|
||||||
|
default=False,
|
||||||
|
help="exclude source packages from gathering",
|
||||||
|
)
|
||||||
|
group.add_argument(
|
||||||
|
"--exclude-debug",
|
||||||
|
action="store_true",
|
||||||
|
default=False,
|
||||||
|
help="exclude debug packages from gathering",
|
||||||
|
)
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
@ -107,6 +119,12 @@ def main(ns, persistdir, cachedir):
|
|||||||
if ns.nodeps:
|
if ns.nodeps:
|
||||||
gather_opts.resolve_deps = False
|
gather_opts.resolve_deps = False
|
||||||
|
|
||||||
|
if ns.exclude_source:
|
||||||
|
gather_opts.exclude_source = True
|
||||||
|
|
||||||
|
if ns.exclude_debug:
|
||||||
|
gather_opts.exclude_debug = True
|
||||||
|
|
||||||
ksparser = pungi.ks.get_ksparser(ns.config)
|
ksparser = pungi.ks.get_ksparser(ns.config)
|
||||||
|
|
||||||
# read repos from ks
|
# read repos from ks
|
||||||
|
Loading…
Reference in New Issue
Block a user