mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-21 13:47:39 +01:00
projects.py: Add argument --ignore to pkg_relations()
Packages that should be ignored altogether with their dependencies can now be specified with --ignore to various commands using pkg_relations(). Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
0ad800315d
commit
6eee41ac08
1 changed files with 8 additions and 1 deletions
|
|
@ -332,6 +332,8 @@ class Projects(object):
|
||||||
default=False, help='Find dependencies recursively')
|
default=False, help='Find dependencies recursively')
|
||||||
parser.add_argument('--dont-expand-version-macros', action='store_true',
|
parser.add_argument('--dont-expand-version-macros', action='store_true',
|
||||||
default=False, help='Don\'t expand VERSION and REVISION macros')
|
default=False, help='Don\'t expand VERSION and REVISION macros')
|
||||||
|
parser.add_argument('--ignore', nargs='?', default='', help='Packages that '
|
||||||
|
'should be ignored together with their dependencies')
|
||||||
args = parser.parse_args(args_)
|
args = parser.parse_args(args_)
|
||||||
version_pattern=re.compile("[0-9-.]*")
|
version_pattern=re.compile("[0-9-.]*")
|
||||||
if args.subsections is None:
|
if args.subsections is None:
|
||||||
|
|
@ -340,6 +342,8 @@ class Projects(object):
|
||||||
else:
|
else:
|
||||||
subsecs = args.subsections.split(',')
|
subsecs = args.subsections.split(',')
|
||||||
self.debug('flavour = ', args.flavour, ', subsecs = ', ' '.join(subsecs))
|
self.debug('flavour = ', args.flavour, ', subsecs = ', ' '.join(subsecs))
|
||||||
|
ignore = args.ignore.split(',')
|
||||||
|
self.debug("ignore = ", ignore)
|
||||||
|
|
||||||
r = []
|
r = []
|
||||||
flavours = args.flavour.split(',')
|
flavours = args.flavour.split(',')
|
||||||
|
|
@ -350,7 +354,7 @@ class Projects(object):
|
||||||
modules = args.module.copy()
|
modules = args.module.copy()
|
||||||
while len(modules):
|
while len(modules):
|
||||||
m = modules.pop(0)
|
m = modules.pop(0)
|
||||||
if m in visited:
|
if m in visited or m in ignore:
|
||||||
continue
|
continue
|
||||||
visited.add(m)
|
visited.add(m)
|
||||||
value = self.get_value(m, section, flavour)
|
value = self.get_value(m, section, flavour)
|
||||||
|
|
@ -363,6 +367,8 @@ class Projects(object):
|
||||||
dep = dep[:1]
|
dep = dep[:1]
|
||||||
dep = list(map(str.strip, dep))
|
dep = list(map(str.strip, dep))
|
||||||
dep_name = re.sub('-dev$|-devel$|-run$', '', dep[0])
|
dep_name = re.sub('-dev$|-devel$|-run$', '', dep[0])
|
||||||
|
if dep_name in ignore or dep[0] in ignore:
|
||||||
|
continue
|
||||||
if args.no_subpackages:
|
if args.no_subpackages:
|
||||||
dep[0] = dep_name
|
dep[0] = dep_name
|
||||||
for i, item in enumerate(dep):
|
for i, item in enumerate(dep):
|
||||||
|
|
@ -389,6 +395,7 @@ class Projects(object):
|
||||||
raise Exception("Unknown version specifier in " + spec)
|
raise Exception("Unknown version specifier in " + spec)
|
||||||
cleaned_dep = ' '.join(dep)
|
cleaned_dep = ' '.join(dep)
|
||||||
if not cleaned_dep in r:
|
if not cleaned_dep in r:
|
||||||
|
self.debug("appending", cleaned_dep)
|
||||||
r.append(cleaned_dep)
|
r.append(cleaned_dep)
|
||||||
return args.delimiter.join(r)
|
return args.delimiter.join(r)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue