Codebase list debian-goodies / debian/0.59
Imported Debian version 0.59 Javier Fernandez-Sanguino 12 years ago
2 changed file(s) with 27 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
6161 sys.stderr.write('usage: checkrestart [-vhpa]\n')
6262
6363 def main():
64 global lc_all_c_env
6465 process = None
6566 toRestart = {}
67
68 lc_all_c_env = os.environ
69 lc_all_c_env['LC_ALL'] = 'C'
70
6671
6772 # Process options
6873 try:
130135 for process in toRestart:
131136 print "Process %s (PID: %d) " % (process.program, process.pid)
132137 process.listDeleted()
133
134 lc_all_c_env = os.environ
135 lc_all_c_env['LC_ALL'] = 'C'
136138
137139 packages = {}
138140 diverted = None
173175 if package == 'util-linux':
174176 continue
175177 dpkgQuery = ["dpkg-query", "--listfiles", package.name]
176 dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, stderr=None)
178 dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, stderr=None,
179 env = lc_all_c_env)
177180 for line in dpkgProc.stdout.readlines():
178181 path = line[:-1]
179182 if path.startswith('/etc/init.d/'):
259262 # - 0 (NO) for known locations of files which might be deleted
260263 # - 1 (YES) for valid deleted files we are interested in
261264 def isdeletedFile (f):
265
266 global lc_all_c_env
267
262268 if allFiles:
263269 return 1
264270 # We don't care about log files
306312 return 0
307313 # Skip, if asked to, files that do not belong to any package
308314 if onlyPackageFiles:
309 dpkgQuery = ["dpkg-query", "--search", f]
310 dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, stderr=None)
315 file_in_package = False
316 # Remove some lsof information from the file to ensure that it is
317 # a proper filename
318 file_name = re.sub(r'\(.*\)','', f)
319 file_name = re.sub(r'\s+$','', file_name)
320 dpkgQuery = ["dpkg-query", "--search", file_name]
321 dpkgProc = subprocess.Popen(dpkgQuery, stdout=subprocess.PIPE, stderr=None,
322 env = lc_all_c_env)
311323 for line in dpkgProc.stdout.readlines():
312324 if line.endswith(f):
313325 file_in_package = True
0 debian-goodies (0.59) unstable; urgency=low
1
2 * [checkrestart]:
3 - Properly define variables to prevent Python errors when using the
4 -p switch (Closes: #646513)
5 - Pass a default environment for all subprocess calls
6
7 -- Javier Fernandez-Sanguino Pen~a <jfs@debian.org> Tue, 25 Oct 2011 00:19:02 +0200
8
09 debian-goodies (0.58) unstable; urgency=low
110
211 * [dglob]