pkg-map: respect --missing-ok also on missing pkg-map file

When there is no pkg-map file for the specified element, list the passed
packages if --missing-ok is specified.

This mirrors what is being done already later, when a pkg-map file
exists but it does not have the mapping for the requested package.

Change-Id: I50287f8e6a5e4335deb3de2252075b8bfdd53ce5
This commit is contained in:
Pino Toscano 2015-02-23 19:05:35 +01:00
parent 0c7006de2f
commit 6d5447afe8

View File

@ -64,6 +64,10 @@ def main():
map_file = '/usr/share/pkg-map/%s' % args.element map_file = '/usr/share/pkg-map/%s' % args.element
if not os.path.exists(map_file): if not os.path.exists(map_file):
eprint('Map file for %s element does not exist.' % args.element) eprint('Map file for %s element does not exist.' % args.element)
if args.missing_ok:
for name in extra:
print(name)
sys.exit(0)
sys.exit(2) sys.exit(2)
with open(map_file) as fd: with open(map_file) as fd: