[Reproducible-builds] [dh-python] 150/183: pyremove: remove files from old site-dirs
Jérémy Bobbio
lunar at moszumanska.debian.org
Fri Sep 19 15:30:32 UTC 2014
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch pu/reproducible_builds
in repository dh-python.
commit dc71d93beb5aea42bca05287d107117c634b2707
Author: Piotr Ożarowski <piotr at debian.org>
Date: Tue Nov 5 23:16:56 2013 +0100
pyremove: remove files from old site-dirs
in case files were not moved yet (will be useful for Python 3 packages)
---
dhpython/tools.py | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/dhpython/tools.py b/dhpython/tools.py
index 1a48acb..e2f944b 100644
--- a/dhpython/tools.py
+++ b/dhpython/tools.py
@@ -298,16 +298,15 @@ def pyremove(interpreter, package, vrange):
log.debug('%s.pyremove: no matching versions for line %s',
package, line)
for version in myvers:
- files = glob(interpreter.sitedir(package, version) + details['pattern'])
- if not files:
- log.debug('%s.pyremove: nothing to remove: python%s, %s',
- package, version, details['pattern'])
- continue
- for fpath in files:
- if isdir(fpath):
- rmtree(fpath)
- else:
- os.remove(fpath)
+ site_dirs = interpreter.old_sitedirs(package, version)
+ site_dirs.append(interpreter.sitedir(package, version))
+ for sdir in site_dirs:
+ files = glob(sdir + details['pattern'])
+ for fpath in files:
+ if isdir(fpath):
+ rmtree(fpath)
+ else:
+ os.remove(fpath)
from dhpython.interpreter import Interpreter
from dhpython.version import Version, get_requested_versions, RANGE_PATTERN
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dh-python.git
More information about the Reproducible-builds
mailing list