lgp: fix string expansion in shell command when script are invoked (closes: #72414)

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset5e695b561d98
branchdefault
phasepublic
hiddenno
parent revision#8f203182838e Only parse one block from the debian changelog
child revision#1a064c88dda2 lgp: fix sources.list corruption when using lgp shell (closes: #72434)
files modified by this revision
lgp/shell.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1312527464 -7200
# Fri Aug 05 08:57:44 2011 +0200
# Node ID 5e695b561d980b93fb6766c0f652cbe675c39c76
# Parent 8f203182838ea440f5fc8113475a6ea77d38f63e
lgp: fix string expansion in shell command when script are invoked (closes: #72414)

diff --git a/lgp/shell.py b/lgp/shell.py
@@ -47,11 +47,11 @@
1                   'metavar': "<directory>",
2                   'help': "mount compilation results directory"
3                  })
4      ]
5      arguments = "[options] [<script> [args...]]"
6 -    cmd = "%s %s --configfile %s --hookdir %s --bindmounts %s --othermirror %s --override-config %s"
7 +    cmd = "%s %s --configfile %s --hookdir %s --bindmounts %s --othermirror %s --override-config %s %s"
8      pbuilder_cmd = "/usr/sbin/pbuilder %s"
9      sudo_cmd = "/usr/bin/sudo -E"
10 
11      def go_into_package_dir(self, arguments):
12          pass
@@ -87,11 +87,11 @@
13                  image = self.get_basetgz(distrib, arch)
14                  resultdir = self.get_distrib_dir(distrib)
15                  other_mirror = self.other_mirror(resultdir)
16 
17                  cmd = self.cmd % (self.sudo_cmd, (self.pbuilder_cmd % command), CONFIG_FILE, HOOKS_DIR,
18 -                                  resultdir, other_mirror, script + ' '.join(args))
19 +                                  resultdir, other_mirror, script, ' '.join(args))
20 
21                  if command == "login":
22                      msg = "run shell in %s/%s image" % (distrib, arch)
23                  else:
24                      msg = "run script '%s' in %s/%s image with arguments: %s" % (script, distrib, arch, ' '.join(args))