Create the sources path if not present and the user has forced.

This commit is contained in:
Chris Johns 2012-10-30 02:41:34 +11:00
parent 864360e67e
commit ed0de00d6d

View File

@ -119,7 +119,10 @@ class build:
def get_file(self, url, local): def get_file(self, url, local):
if not os.path.isdir(os.path.dirname(local)): if not os.path.isdir(os.path.dirname(local)):
raise error.general('source path not found: ' + os.path.dirname(local)) if not self.opts.force():
raise error.general('source path not found: %s; (--force to create)' \
% (os.path.dirname(local)))
self.mkdir(os.path.dirname(local))
if not os.path.exists(local): if not os.path.exists(local):
# #
# Not localy found so we need to download it. Check if a URL # Not localy found so we need to download it. Check if a URL