1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 17:16:23 +01:00

- "osc build --keep-pkgs dir": create dir if it does not exist

This commit is contained in:
Marcus Huewe 2010-08-26 18:50:20 +02:00
parent 788342ea1b
commit d5c91babc1

View File

@ -4164,14 +4164,17 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if conf.config['no_verify']:
opts.no_verify = True
if opts.keep_pkgs and not os.path.isdir(opts.keep_pkgs):
if os.path.exists(opts.keep_pkgs):
raise oscerr.WrongOptions('Preferred save location \'%s\' is not a directory' % opts.keep_pkgs)
else:
os.makedirs(opts.keep_pkgs)
if opts.prefer_pkgs:
for d in opts.prefer_pkgs:
if not os.path.isdir(d):
raise oscerr.WrongOptions('Preferred package location \'%s\' is not a directory' % d)
if opts.keep_pkgs and not os.path.isdir(opts.keep_pkgs):
raise oscerr.WrongOptions('Preferred save location \'%s\' is not a directory' % opts.keep_pkgs)
if opts.noinit and opts.offline:
raise oscerr.WrongOptions('--noinit and --offline are mutually exclusive')