summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-09-15 03:12:26 +0000
committerZac Medico <zmedico@gentoo.org>2006-09-15 03:12:26 +0000
commit4830c53e94c55c2510d6425d6afb5766416cac91 (patch)
tree235a1cefe819fa88f5f37b05406a6d0bc140975f /pym
parentc838662cf7e4bdbc94e6cbc871df86ba929b1c46 (diff)
downloadportage-4830c53e94c55c2510d6425d6afb5766416cac91.tar.gz
portage-4830c53e94c55c2510d6425d6afb5766416cac91.tar.bz2
portage-4830c53e94c55c2510d6425d6afb5766416cac91.zip
Move all env.d file name filtering into a single loop.
svn path=/main/trunk/; revision=4451
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 537850699..93ee33c04 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -463,15 +463,17 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None):
portage_util.ensure_dirs(envd_dir, mode=0755)
fns = listdir(envd_dir, EmptyOnError=1)
fns.sort()
- pos=0
- while (pos<len(fns)):
- if len(fns[pos])<=2:
- del fns[pos]
+ templist = []
+ for x in fns:
+ if len(x) <= 3:
+ continue
+ if not x[0].isdigit() or not x[1].isdigit():
continue
- if (fns[pos][0] not in string.digits) or (fns[pos][1] not in string.digits):
- del fns[pos]
+ if x.startswith(".") or x.endswith("~") or x.endswith(".bak"):
continue
- pos=pos+1
+ templist.append(x)
+ fns = templist
+ del templist
specials={
"KDEDIRS":[],"PATH":[],"CLASSPATH":[],"LDPATH":[],"MANPATH":[],
@@ -490,9 +492,6 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None):
env={}
for x in fns:
- # don't process backup files
- if x[-1]=='~' or x[-4:]==".bak":
- continue
file_path = os.path.join(envd_dir, x)
try:
myconfig = getconfig(file_path)