Skip to content
Snippets Groups Projects
Commit 231bfad3 authored by Joe Garcia's avatar Joe Garcia
Browse files

sort files for some comparison ability from order consistency

parent 0b6d682b
No related branches found
No related tags found
No related merge requests found
......@@ -374,6 +374,11 @@ def printerr(*args,**kwargs):
sys.stderr.write("\n")
sys.stderr.flush()
def sortlist(l):
ret=list(l)
ret.sort()
return ret
def hunt_elfs(base, exclude_stripped=False, elvish=True):
""" yield relative paths of ELF files within base
requires patchelf for ELF identification, provided in OPTS
......@@ -387,7 +392,7 @@ def hunt_elfs(base, exclude_stripped=False, elvish=True):
else:
exclude = re.compile("|".join([("(?:"+x+")") for x in OPTS.exclude_re]))
for (path, dirs, files) in os.walk(base):
for fn in files:
for fn in sortlist(files):
pn = os.path.join(path, fn)
if (exclude is not None) and exclude.match(pn):
#printerr(pn+' excluded')
......
......@@ -255,12 +255,17 @@ def is_script(fn):
def fullresolve_relative(scr):
return os.path.relpath(os.path.realpath(scr),base)
def sortlist(l):
ret=list(l)
ret.sort()
return ret
def recurseFiles(*files):
for f in files:
if not os.path.exists(f):
continue
if os.path.isdir(f):
for nf in recurseFiles(*[os.path.join(f,nf) for nf in os.listdir(f)]):
for nf in recurseFiles(*[os.path.join(f,nf) for nf in sortlist(os.listdir(f))]):
yield nf
else:
yield f
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment