]> code.ossystems Code Review - openembedded-core.git/commitdiff
package.bbclass: Deal with write protected files correctly
authorRichard Purdie <richard@openedhand.com>
Mon, 6 Aug 2007 14:05:51 +0000 (14:05 +0000)
committerRichard Purdie <richard@openedhand.com>
Mon, 6 Aug 2007 14:05:51 +0000 (14:05 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2374 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/classes/package.bbclass

index 202e594c0839587b29bda415eeb9232381fa3c2d..6c25b0d7deeed2b733287bc0de99833efbae9319 100644 (file)
@@ -141,7 +141,7 @@ def runstrip(file, d):
     # A working 'file' (one which works on the target architecture)
     # is necessary for this stuff to work, hence the addition to do_package[depends]
 
-    import bb, os, commands
+    import bb, os, commands, stat
 
     pathprefix = "export PATH=%s; " % bb.data.getVar('PATH', d, 1)
 
@@ -159,8 +159,8 @@ def runstrip(file, d):
 
     newmode = None
     if not os.access(file, os.W_OK):
-        origmode = os.stat(file)[os.stat.ST_MODE]
-        newmode = origmode | os.stat.S_IWRITE
+        origmode = os.stat(file)[stat.ST_MODE]
+        newmode = origmode | stat.S_IWRITE
         os.chmod(file, newmode)
 
     extraflags = ""