| |
@@ -5226,6 +5226,7 @@
|
| |
|
| |
self.assert_policy()
|
| |
self.set_volume()
|
| |
+ self.check_build_dir()
|
| |
|
| |
koji.plugin.run_callbacks('preImport', type='cg', metadata=metadata,
|
| |
directory=directory)
|
| |
@@ -5313,6 +5314,13 @@
|
| |
self.buildinfo['volume_name'] = vol['name']
|
| |
|
| |
|
| |
+ def check_build_dir(self):
|
| |
+ """Check that the import directory does not already exist"""
|
| |
+ path = koji.pathinfo.build(self.buildinfo)
|
| |
+ if os.path.lexists(path):
|
| |
+ raise koji.GenericError("Destination directory already exists: %s" % path)
|
| |
+
|
| |
+
|
| |
def prep_build(self):
|
| |
metadata = self.metadata
|
| |
buildinfo = get_build(metadata['build'], strict=False)
|
| |