diff options
author | Thomas Kahle <tomka@gentoo.org> | 2012-10-15 09:31:25 -0700 |
---|---|---|
committer | Thomas Kahle <tomka@gentoo.org> | 2012-10-15 09:31:25 -0700 |
commit | 054c73b3bb60e6eef240dcce9a87c4129b0e17ac (patch) | |
tree | a8761ab909a26263332e1e4ad7af5c9655aab857 | |
parent | Make emerge options configurable via emergeopts (diff) | |
download | tatt-054c73b3bb60e6eef240dcce9a87c4129b0e17ac.tar.gz tatt-054c73b3bb60e6eef240dcce9a87c4129b0e17ac.tar.bz2 tatt-054c73b3bb60e6eef240dcce9a87c4129b0e17ac.zip |
Set permissions of generated scripts.
-rw-r--r-- | tatt/scriptwriter.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tatt/scriptwriter.py b/tatt/scriptwriter.py index bf88aa6..27904db 100644 --- a/tatt/scriptwriter.py +++ b/tatt/scriptwriter.py @@ -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() + |