Permalink
Browse files

Set permissions of generated scripts.

  • Loading branch information...
tom111 committed Oct 15, 2012
1 parent 4b27eba commit 054c73b3bb60e6eef240dcce9a87c4129b0e17ac
Showing with 10 additions and 0 deletions.
  1. +10 −0 tatt/scriptwriter.py
View
@@ -49,7 +49,11 @@ def writeusecombiscript(job, config):
for p in job.packageList:
outfile.write("# Code for " + p.packageCatName() + "\n")
outfile.write(useCombiTestString(p, config).replace("@@REPORTFILE@@",reportname))
+ # Note: fchmod needs the filedescriptor which is an internal
+ # integer retrieved by fileno().
+ os.fchmod(outfile.fileno(),0711)
outfile.close()
+
######################################
@@ -96,6 +100,7 @@ def writerdepscript(job, config):
# Todo: remove duplicates
localsnippet = rdepTestString (r, config)
outfile.write(localsnippet.replace("@@REPORTFILE@@", reportname))
+ os.fchmod(outfile.fileno(),0711)
outfile.close()
@@ -111,6 +116,7 @@ def writesucessreportscript (job, config):
succmess = config['successmessage'].replace("@@ARCH@@", config['arch'])
outfile.write("else bugz modify " + job.bugnumber + ' -c' + "\"" + succmess + "\";\n")
outfile.write("fi;")
+ os.fchmod(outfile.fileno(),0711)
outfile.close()
print(("Success Report script written to " + outfilename))
@@ -175,6 +181,7 @@ def writecommitscript (job, config):
outfile.write(s)
# Footer (committing)
outfile.write (commitfooterfile.read().replace("@@ARCH@@", config['arch']).replace("@@BUG@@", job.bugnumber))
+ os.fchmod(outfile.fileno(),0711)
outfile.close()
print(("Commit script written to " + outfilename))
@@ -195,3 +202,6 @@ def writeCleanUpScript (job, config):
print(("WARNING: Will overwrite " + outfilename))
outfile = open(outfilename,'w')
outfile.write(script)
+ os.fchmod(outfile.fileno(),0711)
+ outfile.close()
+

0 comments on commit 054c73b

Please sign in to comment.