Skip to contentSkip to conversation

build.py: Preserve sigdata files in the stamps directory

PATCH In review Richard Purdie 2 participants 4 messages Nov 28, 2012 – Nov 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build.py: Preserve sigdata files in the stamps directory

Leaving the sigdata files around can aid debugging and doesn't harm anything. This is the easiest way to allow this to happen.

---

bitbake/lib/bb/build.py +7 -2
index 8ff7fb2..f9f0a65 100644
@@ -29,6 +29,7 @@ import os
 import sys
 import logging
 import shlex
+import glob
 import bb
 import bb.msg
 import bb.process
@@ -504,8 +505,12 @@ def make_stamp(task, d, file_name = None):
     """
     cleanmask = stamp_cleanmask_internal(task, d, file_name)
     for mask in cleanmask:
-        bb.utils.remove(mask)
-
+        # Preserve sigdata files in the stamps directory
+        for name in glob.glob(mask):
+            if name.find("sigdata") != -1:
+                continue
+            os.unlink(name)
+    
     stamp = stamp_internal(task, d, file_name)
     # Remove the file and recreate to force timestamp
     # change on broken NFS filesystems
#1 lore raw

bitbake/lib/bb/build.py def make_stamp(task, d, file_name = None): · line 510

Quoted 6 lines · Richard Purdie
bitbake/lib/bb/build.py +3 -2
-        bb.utils.remove(mask)
-
+        # Preserve sigdata files in the stamps directory
+        for name in glob.glob(mask):
+            if name.find("sigdata") != -1:

if 'sigdata' not in name:

Signature · 1 line
Christopher Larson
#2 lore raw
Quoted 11 lines · Chris Larson

bitbake/lib/bb/build.py def make_stamp(task, d, file_name = None): · line 510

Quoted 6 lines · Richard Purdie
bitbake/lib/bb/build.py +3 -2
-        bb.utils.remove(mask)
-
+        # Preserve sigdata files in the stamps directory
+        for name in glob.glob(mask):
+            if name.find("sigdata") != -1:

if 'sigdata' not in name:

Erm, s/not in/in/. You get the idea. Use of 'find' only really makes sense if you need the locations within the string.

Signature · 1 line
Christopher Larson
#3 lore raw
Quoted 11 lines · Chris Larson

On Wed, Nov 28, 2012 at 3:19 PM, Chris Larson <[email protected]> wrote:
On Wed, Nov 28, 2012 at 1:26 PM, Richard Purdie <[email protected]> wrote:
- bb.utils.remove(mask)
-
+ # Preserve sigdata files in the stamps
directory
+ for name in glob.glob(mask):
+ if name.find("sigdata") != -1:

Quoted 4 lines

if 'sigdata' not in name:

Erm, s/not in/in/. You get the idea. Use of 'find' only really makes sense if you need the locations within the string.

Yes, good point, thanks.

Richard