From a5c7071be3e19872af15a31605b3f3eaaa33bdc2 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Thu, 15 Oct 2015 09:19:51 +0000 Subject: 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 --- baserockimport/app.py | 10 +++++++--- 1 file 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): -- cgit v1.2.1