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

Bug 658322

Summary: sys-apps/portage-2.3.40-r1 does not apply INSTALL_MASK with trailing slashes (but sees it)
Product: Portage Development Reporter: Bruno <bonbons>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 659322    

Description Bruno 2018-06-17 18:19:27 UTC
Since update from sys-apps/portage-2.3.24-r1 to sys-apps/portage-2.3.40-r1 INSTALL_MASK is not being respected any more (at least for files installed from binpkg).

With newer portage /var/db/pkg/** does have a INSTALL_MASK whose contents match expected mask but all files listed still end up installed.


Snipplet of /etc/portage/package.env:
...
dev-db/mariadb-connector-c INSTALL_MASK.conf dev-db/mariadb-connector-c.conf
...


Contents of /etc/portage/env/INSTALL_MASK.conf:
INSTALL_MASK="*.a
*.o
*.la
/lib/systemd/*/
/lib64/systemd/*/
/usr/lib/systemd/
/usr/lib64/systemd/
/usr/include/
/usr/share/doc/
/usr/share/gtk-doc/
/usr/share/info/
/usr/share/aclocal/
/usr/share/man/man3/
/usr/share/man/ja/
/usr/lib64/cmake/
/usr/lib64/pkgconfig/
/usr/lib64/debug/
/usr/lib/debug/
/usr/lib/tmpfiles.d/"


Contents of /etc/portage/env/dev-db/mariadb-connector-c.conf
INSTALL_MASK="${INSTALL_MASK}
/usr/bin/
/usr/share/doc/"
Comment 1 Zac Medico gentoo-dev 2018-06-19 00:02:43 UTC
It should work if you remove the trailing slashes, because this code doesn't handle trailing slashes:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=3416876c0ee7301ab7434e3d9928ab7629a784ef
Comment 2 Bruno 2018-06-23 10:13:45 UTC
(In reply to Zac Medico from comment #1)
> It should work if you remove the trailing slashes, because this code doesn't
> handle trailing slashes:
> 
> https://gitweb.gentoo.org/proj/portage.git/commit/
> ?id=3416876c0ee7301ab7434e3d9928ab7629a784ef

I can confirm it applies those entries without trailing slash (though doing so silently where-as older portage listed applied INSTALL_MASK just before starting to merge files.

It's annoying though that trailing slashes for directories are no more supported.

Trailing slashes allow visually showing an entry as being a directory and would preferably only apply if match is a directory (but fail/complain if something else was encountered - symlinks to be handled based on their target).
Comment 3 Zac Medico gentoo-dev 2018-06-24 22:06:45 UTC
(In reply to Bruno from comment #2)
> Trailing slashes allow visually showing an entry as being a directory and
> would preferably only apply if match is a directory (but fail/complain if
> something else was encountered - symlinks to be handled based on their
> target).

I've posted a patch that implements the directory-only match:

https://github.com/gentoo/portage/pull/328
https://archives.gentoo.org/gentoo-portage-dev/message/1cffa323301be8ef9d100dd1424096ce
Comment 4 Larry the Git Cow gentoo-dev 2018-06-27 03:32:24 UTC
The bug has been referenced in the following commit(s):

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

commit deb87a465306d05146d7eb55d27d7d89943725c0
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-06-24 21:42:52 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-06-27 03:15:08 +0000

    {,PKG_}INSTALL_MASK: support trailing slash (bug 658322)
    
    Fix the python INSTALL_MASK implementation so that a trailing slash
    matches a directory, for compatibility with the previous bash
    implementation.
    
    Fixes: 3416876c0ee7 ("{,PKG_}INSTALL_MASK: python implementation")
    Bug: https://bugs.gentoo.org/658322

 pym/portage/tests/util/test_install_mask.py | 129 ++++++++++++++++++++++++++++
 pym/portage/util/install_mask.py            |   7 +-
 2 files changed, 134 insertions(+), 2 deletions(-)