1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 14:56:14 +01:00

Use './binaries' as default directory for getbinaries.

Previously, there was no directory set when fetching multiple arches and
distinct dirs for specific arches. Should be more consistent now.
This commit is contained in:
Sascha Peilicke 2011-01-21 10:35:47 +01:00
parent fe8febe56e
commit 0a40037d27

View File

@ -4885,7 +4885,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
@cmdln.option('-q', '--quiet', action='store_true', @cmdln.option('-q', '--quiet', action='store_true',
help='do not show downloading progress') help='do not show downloading progress')
@cmdln.option('-d', '--destdir', default='./', metavar='DIR', @cmdln.option('-d', '--destdir', default='./binaries', metavar='DIR',
help='destination directory') help='destination directory')
@cmdln.option('--sources', action="store_true", @cmdln.option('--sources', action="store_true",
help='also fetch source packages') help='also fetch source packages')
@ -4947,6 +4947,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
else: else:
package = [package] package = [package]
# Set binary target directory and create if not existing
target_dir = os.path.normpath(opts.destdir)
if not os.path.isdir(target_dir):
print 'Creating %s' % target_dir
os.makedirs(target_dir, 0755)
for arch in arches: for arch in arches:
for pac in package: for pac in package:
binaries = get_binarylist(apiurl, project, repository, arch, binaries = get_binarylist(apiurl, project, repository, arch,
@ -4955,14 +4961,6 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print >>sys.stderr, 'no binaries found: Either the package %s ' \ print >>sys.stderr, 'no binaries found: Either the package %s ' \
'does not exist or no binaries have been built.' % pac 'does not exist or no binaries have been built.' % pac
continue continue
target_dir = opts.destdir
if architecture is None:
# we're going to fetch all repo arches
target_dir = '%s/%s' % (opts.destdir, arch)
target_dir = os.path.normpath(target_dir)
if not os.path.isdir(target_dir):
print 'Creating %s' % target_dir
os.makedirs(target_dir, 0755)
for i in binaries: for i in binaries:
# skip source rpms # skip source rpms