mirror of
https://git.centos.org/centos/centpkg.git
synced 2025-02-23 16:22:55 +00:00
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:
parent
9f3a0fae27
commit
5a3f501158
1 changed files with 13 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue