[PATCH 2/9] make-secnet-sites: Fix userv invocation after pfilepath

Ian Jackson ijackson at chiark.greenend.org.uk
Wed Jul 11 01:09:59 BST 2012

The commit 9b8369e07aeba5ed2c69fb4a7f74d07c8cebe015
 make-secnet-sites: refactor to break out new function "pfilepath"
broke the userv service invocation, because it turned out that later
code depended on the "headerlines" variable whose assignment had been
removed and replaced by a call to pfilepath.

Make pfilepath return the lines read from the file and assign the
result to headerlines.

Signed-off-by: Ian Jackson <ijackson at chiark.greenend.org.uk>
 make-secnet-sites |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/make-secnet-sites b/make-secnet-sites
index 547f572..5911a39 100755
--- a/make-secnet-sites
+++ b/make-secnet-sites
@@ -391,8 +391,10 @@ def pline(i,allow_include=False):
 def pfilepath(pathname,allow_include=False):
-	pfile(pathname,f.readlines(),allow_include=allow_include)
+	lines=f.readlines()
+	pfile(pathname,lines,allow_include=allow_include)
+	return lines
 def pfile(name,lines,allow_include=False):
 	"Process a file"
@@ -465,7 +467,7 @@ else:
 		if not ok:
 			print "caller not in group %s"%group
-		pfilepath(header,allow_include=True)
+		headerinput=pfilepath(header,allow_include=True)
 		pfile("user input",userinput)

More information about the sgo-software-discuss mailing list