summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Ipsum <richard.ipsum@codethink.co.uk>2015-10-15 09:19:51 +0000
committerRichard Ipsum <richard.ipsum@codethink.co.uk>2015-10-16 15:43:11 +0000
commita5c7071be3e19872af15a31605b3f3eaaa33bdc2 (patch)
tree2d628c0bd6aafc40bb4f5f4e94bf2359c7f03f31
parentf74e7e428325be1cb018898a52d0aed4aec7a549 (diff)
downloadimport-a5c7071be3e19872af15a31605b3f3eaaa33bdc2.tar.gz
Fix no git dir err in cpan ext
If no definitions dir exists then we incorrectly use mkdir() alone to create a new directory, morphset later fails because the directory isn't a repository. This fixes it so that we git init the definitions dir after the mkdir Change-Id: I1dc665d2c51cdc7afac45db14e4d2e699d9cf1ec
-rw-r--r--baserockimport/app.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/baserockimport/app.py b/baserockimport/app.py
index ae95d58..ecdfff5 100644
--- a/baserockimport/app.py
+++ b/baserockimport/app.py
@@ -26,6 +26,7 @@ import sys
import requests
import json
+import morphlib
import baserockimport
@@ -333,10 +334,13 @@ class BaserockImportApplication(cliapp.Application):
'''
distribution = metadata['distribution']
-
depends_filename = 'strata/%s/ROOT.meta' % distribution
- depends_path = os.path.join(self.settings['definitions-dir'],
- depends_filename)
+ defsdir = self.settings['definitions-dir']
+ depends_path = os.path.join(defsdir, depends_filename)
+
+ if not os.path.exists(defsdir):
+ os.makedirs(defsdir)
+ morphlib.gitdir.init(defsdir)
p, _ = os.path.split(depends_path)
if not os.path.exists(p):