Michał Górny  committed f381830

Write the variable output code into the temporary script.

Now the code responsible for outputting variables (in a simpler form) is
written into the temporary file (one with the variable declarations copied
from environment.bz2) instead of being inlined in the bash call.

This is the first step towards (hopefully more efficient) server/client
model for environment parsing.

  • Participants
  • Parent commits ab99bd2

Comments (0)

Files changed (1)

File SmartLiveRebuild/vcs/, 0)
 		shutil.copyfileobj(envf, f)
+		f.write('\nprintf "%%s\\0" %s\n' % ' '.join(['"${%s}"' % x for x in vars]))
-		script = 'source "%s"||exit 1;%s' % (,
-			';echo -ne "\\0";'.join(['echo -n "${%s}"' % x for x in vars]))
-		return dict(zip(vars,['bash', '-c', script]).split('\0')))
+		return dict(zip(vars,['bash',]).split('\0')))
 	def __init__(self, cpv, envf, tmpf, opts, settings):
 		self.cpv = [cpv]