[med-svn] r1657 - trunk/community/infrastructure/scripts

tille at alioth.debian.org tille at alioth.debian.org
Mon Mar 24 22:15:54 UTC 2008


Author: tille
Date: 2008-03-24 22:15:53 +0000 (Mon, 24 Mar 2008)
New Revision: 1657

Modified:
   trunk/community/infrastructure/scripts/update-tasks
Log:
Make sure that created files have 664 permission in any case


Modified: trunk/community/infrastructure/scripts/update-tasks
===================================================================
--- trunk/community/infrastructure/scripts/update-tasks	2008-03-24 11:07:48 UTC (rev 1656)
+++ trunk/community/infrastructure/scripts/update-tasks	2008-03-24 22:15:53 UTC (rev 1657)
@@ -15,6 +15,8 @@
 import HTMLTemplate
 import re
 from sys import argv, exit, stderr
+from os import chmod
+from stat import S_IWGRP, S_IRUSR, S_IRGRP, S_IWUSR, S_IROTH
 import time
 from datetime import datetime
 from email.Utils import formatdate
@@ -217,7 +219,8 @@
 f = open("%s/htdocs/tasks_idx.tmpl" % base)
 tmpl = HTMLTemplate.Template(renderIndex, f.read(), codecs=(None,None)) ##myEncoder, myDecoder))
 f.close()
-f = open("%s/static/tasks/index.php" % base, "w")
+outputfile = "%s/static/tasks/index.php" % base
+f = open(outputfile, "w")
 
 tasks        = cdeps.tasknames
 packages     = cdeps.GetNamesOnlyDict()
@@ -225,6 +228,7 @@
 
 f.write(tmpl.render(tasks))
 f.close()
+chmod(outputfile,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH)
 
 # Let's render single pages now.
 f = open("%s/htdocs/tasks.tmpl" % base)
@@ -232,11 +236,12 @@
 f.close()
 
 for task in tasks:
-	f = open("%s/static/tasks/%s.php" % (base, task), "w")
+	outputfile = "%s/static/tasks/%s.php" % (base, task)
+	f = open(outputfile, "w")
 
 	# This is to avoid useless <br>eaks before closing the cell
 	source = tmpl.render(task, packages[task], task_details[task])
 	f.write(re.sub(r"<br /><br />[ ]*</td>", "</td>", source))
 
 	f.close()
-
+	chmod(outputfile,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH)




More information about the debian-med-commit mailing list