diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-11-24 08:15:00 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-11-24 08:15:00 -0800 |
commit | 4f4508c0ae246ee66542a2529d9225d110373253 (patch) | |
tree | 2d5fc3781ed982b9c300f232f2d401ecb2cbddc7 | |
parent | 14a87aad60059a15a7022a5f3f56f08016d67dc9 (diff) | |
download | portage-4f4508c0ae246ee66542a2529d9225d110373253.tar.gz portage-4f4508c0ae246ee66542a2529d9225d110373253.tar.bz2 portage-4f4508c0ae246ee66542a2529d9225d110373253.zip |
grab*_package: optimize for non-existent files
-rw-r--r-- | pym/portage/util/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index b32ebb86e..e0908f0a3 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -381,6 +381,8 @@ def grabdict_package(myfilename, juststrings=0, recursive=0, allow_wildcard=Fals """ Does the same thing as grabdict except it validates keys with isvalidatom()""" pkgs=grabdict(myfilename, juststrings, empty=1, recursive=recursive) + if not pkgs: + return pkgs if verify_eapi and eapi is None: eapi = read_corresponding_eapi_file(myfilename) @@ -402,6 +404,8 @@ def grabfile_package(myfilename, compatlevel=0, recursive=0, allow_wildcard=Fals remember_source_file=False, verify_eapi=False, eapi=None): pkgs=grabfile(myfilename, compatlevel, recursive=recursive, remember_source_file=True) + if not pkgs: + return pkgs if verify_eapi and eapi is None: eapi = read_corresponding_eapi_file(myfilename) mybasename = os.path.basename(myfilename) |