summaryrefslogtreecommitdiffstats
path: root/py/mock/backend.py
diff options
context:
space:
mode:
Diffstat (limited to 'py/mock/backend.py')
-rw-r--r--py/mock/backend.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/py/mock/backend.py b/py/mock/backend.py
index f22ac12..e35c6c7 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -542,8 +542,18 @@ class Root(object):
# copy spec/sources
shutil.copy(spec, self.makeChrootPath(self.builddir, "SPECS"))
- os.rmdir(self.makeChrootPath(self.builddir, "SOURCES"))
- shutil.copytree(sources, self.makeChrootPath(self.builddir, "SOURCES"))
+
+ # Resolve any symlinks
+ sources = os.path.realpath(sources)
+
+ if os.path.isdir(sources):
+ os.rmdir(self.makeChrootPath(self.builddir, "SOURCES"))
+ shutil.copytree(sources, self.makeChrootPath(self.builddir, "SOURCES"))
+ else:
+ shutil.copy(sources, self.makeChrootPath(self.builddir, "SOURCES"))
+
+ spec = self.makeChrootPath(self.builddir, "SPECS", os.path.basename(spec))
+ chrootspec = spec.replace(self.makeChrootPath(), '') # get rid of rootdir prefix
spec = self.makeChrootPath(self.builddir, "SPECS", os.path.basename(spec))
chrootspec = spec.replace(self.makeChrootPath(), '') # get rid of rootdir prefix