[OE-core] [PATCH 2/2] sstatesig.py: Add a path argument to dump_lockedsigs()

Paul Eggleton paul.eggleton at linux.intel.com
Wed Sep 10 17:19:32 UTC 2014


From: Randy Witt <randy.e.witt at linux.intel.com>

Previously the function always used os.getcwd() for the location to
write the locked signatures file. However, that isn't easily used by
calling tasks, so only use os.getcwd() if the caller doesn't specify
a path.

Signed-off-by: Randy Witt <randy.e.witt at linux.intel.com>
Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
---
 meta/lib/oe/sstatesig.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index add2619..9fcbc2b 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -130,8 +130,9 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
             return
         super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime)
 
-    def dump_lockedsigs(self):
-        bb.plain("Writing locked sigs to " + os.getcwd() + "/locked-sigs.inc")
+    def dump_lockedsigs(self, path=os.getcwd()):
+        outfile = os.path.join(path, "locked-sigs.inc")
+        bb.plain("Writing locked sigs to %s" % outfile)
         types = {}
         for k in self.runtaskdeps:
             fn = k.rsplit(".",1)[0]
@@ -140,7 +141,7 @@ class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
                 types[t] = []
             types[t].append(k)
 
-        with open("locked-sigs.inc", "w") as f:
+        with open(outfile, "w") as f:
             for t in types:
                 f.write('SIGGEN_LOCKEDSIGS_%s = "\\\n' % t)
                 types[t].sort()
-- 
1.9.3




More information about the Openembedded-core mailing list