If outdir is not checked into git when sources() is called, create the appropriate directory (RESOLVES: 0007297)

This commit also moves a comment that was checked in on the wrong line
This commit is contained in:
Brian Stinson 2014-07-05 04:57:54 -05:00 committed by Johnny Hughes
parent 9f3a0fae27
commit 5a3f501158

View file

@ -113,8 +113,20 @@ class Commands(pyrpkg.Commands):
csum, file = archive.strip().split(None, 1)
except ValueError:
raise pyrpkg.rpkgError('Malformed sources file.')
# See if we already have a valid copy downloaded
# If a directory is specified in the metadata file, append it to
# outdir
if os.path.dirname(file):
outdir = os.path.join(self.path, os.path.dirname(file))
file = os.path.basename(file)
# Create the output directory if it's not checked into git
if not os.path.exists(outdir):
self.log.info("Creating OUTDIR: {0}".format(outdir))
os.makedirs(outdir)
outfile = os.path.join(outdir, file)
# See if we already have a valid copy downloaded
if os.path.exists(outfile):
if self._verify_file(outfile, csum, self.lookasidehash):
continue