From: Zac Medico Date: Wed, 24 Nov 2010 16:15:00 +0000 (-0800) Subject: grab*_package: optimize for non-existent files X-Git-Tag: v2.1.9.25~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6c69cc2a16798c28d39383383af21ee7afdf2fe3;p=portage.git grab*_package: optimize for non-existent files --- diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py index 5d4dfa750..24beb2ef7 100644 --- a/pym/portage/util/__init__.py +++ b/pym/portage/util/__init__.py @@ -354,6 +354,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) @@ -375,6 +377,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)