No bug - Don't chmod before deleting target in nsinstall.py on non Windows to avoid touching CLOBBER on a CLOSED TREE
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 25 Jul 2014 09:01:23 +0900
changeset 196080 b0a916157c9a924b6887fdd1a2c9d8413f037648
parent 196079 0300f04572b6a6d1ad192acd1608da0dd8cc1ba5
child 196081 de374e83ed83b5d028c98a808f019f5e1c744167
push idunknown
push userunknown
push dateunknown
milestone34.0a1
No bug - Don't chmod before deleting target in nsinstall.py on non Windows to avoid touching CLOBBER on a CLOSED TREE
config/nsinstall.py
--- a/config/nsinstall.py
+++ b/config/nsinstall.py
@@ -122,17 +122,18 @@ def _nsinstall_internal(argv):
         entries = [os.path.join(srcpath, e) for e in os.listdir(srcpath)]
         copy_all_entries(entries, targetpath)
         # options.t is not relevant for directories
         if options.m:
           os.chmod(targetpath, options.m)
       else:
         if os.path.exists(targetpath):
           # On Windows, read-only files can't be deleted
-          os.chmod(targetpath, stat.S_IWUSR)
+          if sys.platform == "win32":
+            os.chmod(targetpath, stat.S_IWUSR)
           os.remove(targetpath)
         if options.t:
           shutil.copy2(srcpath, targetpath)
         else:
           shutil.copy(srcpath, targetpath)
 
   # the last argument is the target directory
   target = args.pop()