Skip to contentSkip to conversation

fetch2/__init__.py: Error if lockfile path invalid

PATCH New Richard Purdie 1 participant 1 message Feb 26, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2/__init__.py: Error if lockfile path invalid

Rather than create ".lock" and ".done" files with no name, error, forcing us to fix the cases where this is a problem.

bitbake/lib/bb/fetch2/__init__.py +4 -1
index 2d31493..6d00703 100644
@@ -1185,8 +1185,11 @@ class FetchData(object):
             basepath = self.localpath
         elif self.localpath:
             basepath = dldir + os.sep + os.path.basename(self.localpath)
-        else:
+        elif self.basepath or self.basename:
             basepath = dldir + os.sep + (self.basepath or self.basename)
+        else:
+             bb.fatal("Can't determine lock path for url %s" % url)
+
         self.donestamp = basepath + '.done'
         self.lockfile = basepath + '.lock'