Skip nonexisting extra sources

Make the `copy_extra_sources` method more foolproof and don't
traceback when a SourceX file doesn't exist.
This commit is contained in:
Jakub Kadlcik 2020-10-06 16:23:19 +02:00 committed by Jakub Kadlčík
parent 5947384f32
commit 00ee487ed2

View file

@ -517,6 +517,10 @@ class Builder(ConfigObject, BuilderBase):
debug('Source "%s" is not a local file. Skiping.' % source)
continue
if not os.path.exists(source):
debug('Source "%s" file does not exist. Skiping.' % source)
continue
src = os.path.join(self.rpmbuild_sourcedir, self.tgz_dir, source)
if os.path.islink(src) and os.path.isabs(src):
src = os.path.join(self.start_dir, os.readlink(src))