From 4f4508c0ae246ee66542a2529d9225d110373253 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 24 Nov 2010 08:15:00 -0800 Subject: [PATCH] grab*_package: optimize for non-existent files --- pym/portage/util/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.26.2