From: Zac Medico Date: Fri, 23 Jun 2006 03:41:07 +0000 (-0000) Subject: Test the basename for starting with "." instead of the full path. X-Git-Tag: v2.1.1~424 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=65f99858a8e7ca52a2ccf4d59d3d7b4a3d515b6e;p=portage.git Test the basename for starting with "." instead of the full path. svn path=/main/trunk/; revision=3613 --- diff --git a/pym/portage_util.py b/pym/portage_util.py index 337085ac3..798937b63 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -182,11 +182,10 @@ def grabfile_package(myfilename, compatlevel=0, recursive=0): def grablines(myfilename,recursive=0): mylines=[] if recursive and os.path.isdir(myfilename): - myfiles = [myfilename+os.path.sep+x for x in os.listdir(myfilename)] - myfiles = [f for f in myfiles if not f.startswith(".")] - myfiles.sort() - for f in myfiles: - mylines.extend(grablines(f, recursive)) + for f in os.listdir(myfilename): + if not f.startswith("."): + mylines.extend(grablines( + os.path.join(myfilename, f), recursive)) else: try: myfile = open(myfilename, "r")