Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 549324

Summary: sys-apps/portage-2.2.18 does not function properly when PKGDIR is readonly for --getbinpkg, unmerge-backups, and downgrade-backup
Product: Portage Development Reporter: Adam Feldman <np-hardass>
Component: Binary packages supportAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: davidweb
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=549072
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 377365    

Description Adam Feldman gentoo-dev 2015-05-13 02:48:14 UTC
Portage attempts to use PKGDIR even when PKGDIR is mounted readonly if --getbinpkg is used, or if FEATURES="unmerge-backup" or FEATURES="downgrade-backup".

As far as expected behavior is concerned, I assume that the two FEATURES situations would require notifying the user of the issue.  Regarding --getbinpkg, in my mind, ideally, the binpkg should be stored in a temporary location, merged, and then removed from the temporary location.  This logic for --getbinpkg might not hold if you take a different view, that --getbinpkg is simply to get a remote binpkg, and then it would be used, but the fact that --getbinpkg currently means get pkg and use it, to me implies that the previous logic regarding a tempdir should hold.


To reproduce this scenario, mount PKGDIR as readonly by a means of your choice, in my case, nfs readonly, and then either emerge --getbinpkg foo  or FEATURES="unmerge-backup" emerge --depclean foo or FEATURES="downgrade-backup" emerge <foo-cur.ver
Comment 1 Adam Feldman gentoo-dev 2015-05-13 02:51:53 UTC
URL is source of bug discovery
Comment 2 Zac Medico gentoo-dev 2015-05-13 17:33:51 UTC
(In reply to NP-Hardass from comment #0)
> As far as expected behavior is concerned, I assume that the two FEATURES
> situations would require notifying the user of the issue.  Regarding
> --getbinpkg, in my mind, ideally, the binpkg should be stored in a temporary
> location, merged, and then removed from the temporary location.  This logic
> for --getbinpkg might not hold if you take a different view, that
> --getbinpkg is simply to get a remote binpkg, and then it would be used, but
> the fact that --getbinpkg currently means get pkg and use it, to me implies
> that the previous logic regarding a tempdir should hold.

We can add a setting that causes downloaded binary packages to be placed it a temporary directory and deleted after they have been installed. When PKGDIR is readonly, portage could suggest to enable this setting if it isn't already enabled.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-05-14 13:15:06 UTC
(In reply to NP-Hardass from comment #0)
> Portage attempts to use PKGDIR even when PKGDIR is mounted readonly if
> --getbinpkg is used, or if FEATURES="unmerge-backup" or
> FEATURES="downgrade-backup".
> 
> As far as expected behavior is concerned, I assume that the two FEATURES
> situations would require notifying the user of the issue.  Regarding
> --getbinpkg, in my mind, ideally, the binpkg should be stored in a temporary
> location, merged, and then removed from the temporary location.  This logic
> for --getbinpkg might not hold if you take a different view, that
> --getbinpkg is simply to get a remote binpkg, and then it would be used, but
> the fact that --getbinpkg currently means get pkg and use it, to me implies
> that the previous logic regarding a tempdir should hold.

This is just plain stupid. If you want binary packages in a temporary directory, set PKGDIR to that directory instead of expecting Portage to do special magic to workaround invalid configuration.
Comment 4 Adam Feldman gentoo-dev 2015-05-14 19:46:45 UTC
(In reply to Michał Górny from comment 3)
> 
> This is just plain stupid. If you want binary packages in a temporary
> directory, set PKGDIR to that directory instead of expecting Portage to do
> special magic to workaround invalid configuration.

I agree that the FEATURES are a misconfiguration. --getbinpkg allows fetching of packages from a remote location. In this scenario, being unable to use remote packages when a local pkgdir is not a not a misconfiguration issue, in my opinion, and the temp dir during the emerge process is a reasonable remedy.