Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 637902 - sys-apps/portage: quickpkg erroneously reports failure with FEATURES=binpkg-multi-instance
Summary: sys-apps/portage: quickpkg erroneously reports failure with FEATURES=binpkg-m...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 637452
  Show dependency tree
 
Reported: 2017-11-16 23:06 UTC by Zac Medico
Modified: 2018-02-01 23:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2017-11-16 23:06:13 UTC
The getname/stat sanity check can fail with FEATURES=binpkg-multi-instance, and there's a simple fix:

diff --git a/bin/quickpkg b/bin/quickpkg
index faf1eddd4..7e9aa1373 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -177,8 +177,12 @@ def quickpkg_atom(options, infos, arg, eout):
 		finally:
 			if have_lock:
 				dblnk.unlockdb()
-		bintree.inject(cpv, filename=binpkg_tmpfile)
-		binpkg_path = bintree.getname(cpv)
+		pkg_info = bintree.inject(cpv, filename=binpkg_tmpfile)
+		# The pkg_info value ensures that the following getname call
+		# returns the correct path when FEATURES=binpkg-multi-instance
+		# is enabled, but fallback to cpv in case the inject call
+		# returned None due to some kind of failure.
+		binpkg_path = bintree.getname(pkg_info or cpv)
 		try:
 			s = os.stat(binpkg_path)
 		except OSError as e:
Comment 1 Larry the Git Cow gentoo-dev 2017-11-16 23:22:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=25ce021c8630fb75bab1bcce70f06fdafcd5c5a7

commit 25ce021c8630fb75bab1bcce70f06fdafcd5c5a7
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-11-16 23:13:26 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-11-16 23:15:12 +0000

    quickpkg: fix stat sanity check for binpkg-multi-instance (bug 637902)
    
    Fixes: 328dd4712f88 ("binpkg-multi-instance 3 of 7")
    Bug: https://bugs.gentoo.org/637902

 bin/quickpkg | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)}
Comment 2 Larry the Git Cow gentoo-dev 2017-11-16 23:47:33 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=682fc4b8ea1b2caeeef88596508026edea8e8ac5

commit 682fc4b8ea1b2caeeef88596508026edea8e8ac5
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-11-16 23:41:57 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-11-16 23:47:18 +0000

    quickpkg: report all binarytree.inject failures (bug 637902)
    
    The binarytree.inject method should not return None unless
    something went wrong, therefore report failure whenever it
    returns None.
    
    Bug: https://bugs.gentoo.org/637902

 bin/quickpkg | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)}