diff mbox

Bug #577 directory as local URI

Message ID CACPcEYn7JFLbWfcSm8369+Jvyu+-0waH1HwuM8ssc5oDD2fTRg@mail.gmail.com
State Accepted
Delegated to: Esben Haabendal
Headers show

Commit Message

Yann Diorcet Feb. 18, 2014, 4:20 p.m. UTC

diff mbox

Patch

diff --git a/lib/oelite/fetch/local.py b/lib/oelite/fetch/local.py
index 4903fe9..9992415 100644
--- a/lib/oelite/fetch/local.py
+++ b/lib/oelite/fetch/local.py
@@ -32,6 +32,8 @@  class LocalFetcher():
             return self._signature
         except AttributeError:
             pass
+        if os.path.isdir(self.localpath):
+            raise oelite.fetch.NoSignature(self.uri, "can't compute directory signature")
         m = hashlib.sha1()
         m.update(open(self.localpath, "r").read())
         self._signature = m.digest()