Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 570530 - sys-apps/portage-2.2.24: INSTALL_MASK does not apply to broken symlinks
Summary: sys-apps/portage-2.2.24: INSTALL_MASK does not apply to broken symlinks
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 549914
  Show dependency tree
 
Reported: 2016-01-01 22:17 UTC by Bruno
Modified: 2016-03-14 03:55 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 Bruno 2016-01-01 22:17:09 UTC
When using INSTALL_MASK to filter out files when installing (from .tbz2 binary packages) filter applies to folders or regular files but symlinks still get installed.





Reproducible: Always

Steps to Reproduce:
echo << EOF > /etc/portage/package.env
app-arch/gzip INSTALL_MASK.conf app-arch/gzip.conf
EOF
echo << EOF > /etc/portage/env/INSTALL_MASK.conf
INSTALL_MASK="*.a
*.o
*.la
/usr/lib/debug/
/usr/include/
/usr/share/doc/
/usr/share/gtk-doc/
/usr/share/info/
/usr/share/aclocal/
/usr/share/man/man3/
/usr/lib/pkgconfig/
/etc/conf.d/
/etc/init.d/
/run/
/var/run/"
EOF
echo << EOF > /etc/portage/env/app-arch/gzip.conf
INSTALL_MASK="${INSTALL_MASK}
/bin/gunzip
/bin/uncompress
/bin/zcat
/usr/bin
/usr/share/man/man1/gunzip.1*
/usr/share/man/man1/uncompress.1*
/usr/share/man/man1/zcat.1*
/usr/share/man/man1/gzexe.1*
/usr/share/man/man1/zcmp.1*
/usr/share/man/man1/zdiff.1*
/usr/share/man/man1/zforce.1*
/usr/share/man/man1/zgrep.1*
/usr/share/man/man1/zless.1*
/usr/share/man/man1/zmore.1*
/usr/share/man/man1/znew.1*"
EOF

emerge --oneshot --usepkg app-arch/gzip
Actual Results:  
These are the packages that would be merged, in order:
Calculating dependencies... done!
[binary   R    ] app-arch/gzip-1.6::gentoo to /mnt/soekris/ USE="-pic -static" 0 KiB

Total: 1 package (1 reinstall, 1 binary), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] 

>>> Emerging binary (1 of 1) app-arch/gzip-1.6::gentoo for /
 * gzip-1.6.tbz2 MD5 SHA1 size ;-) ...                                   [ ok ]
>>> Extracting info
>>> Extracting app-arch/gzip-1.6

>>> Installing (1 of 1) app-arch/gzip-1.6::gentoo to /
 * Removing /usr/lib/debug/
 * Removing /usr/share/doc/
 * Removing /usr/share/info/
 * Removing /bin/gunzip
 * Removing /bin/zcat
 * Removing /usr/bin
 * Removing /usr/share/man/man1/gunzip.1*
 * Removing /usr/share/man/man1/zcat.1*
 * Removing /usr/share/man/man1/gzexe.1*
 * Removing /usr/share/man/man1/zcmp.1*
 * Removing /usr/share/man/man1/zdiff.1*
 * Removing /usr/share/man/man1/zforce.1*
 * Removing /usr/share/man/man1/zgrep.1*
 * Removing /usr/share/man/man1/zless.1*
 * Removing /usr/share/man/man1/zmore.1*
 * Removing /usr/share/man/man1/znew.1*
 * checking 3 files for package collisions
>>> Merging app-arch/gzip-1.6 to /mnt/soekris/
--- /bin/
>>> /bin/gzip
--- /usr/
--- /usr/lib/
--- /usr/share/
--- /usr/share/man/
--- /usr/share/man/man1/
>>> /usr/share/man/man1/gzip.1.bz2
 * QA Notice: Symbolic link /bin/uncompress points to /bin/gunzip which does not exist.
>>> /bin/uncompress -> gunzip
>>> Safely unmerging already-installed instance...
No package files given... Grabbing a set.
--- replaced obj /usr/share/man/man1/gzip.1.bz2
--- replaced dir /usr/share/man/man1
--- replaced dir /usr/share/man
--- replaced dir /usr/share
--- replaced dir /usr/lib
--- replaced dir /usr
--- replaced sym /bin/uncompress
--- replaced obj /bin/gzip
--- replaced dir /bin
>>> Regenerating /etc/ld.so.cache...
>>> Original instance of package unmerged safely.
>>> app-arch/gzip-1.6 merged.
>>> Auto-cleaning packages...



Expected Results:  
The /bin/uncompress symlink should not get installed as it's listed in INSTALL_MASK as is symlink's target.


Note: in the past this worked correctly though I can't tell when it stopped working.
Comment 1 Bruno 2016-01-01 22:54:09 UTC
A probably important detail:

If symlink target is masked by INSTALL_MASK the symlink is still installed even though listed in INSTALL_MASK.

If symlink target is not masked (that it, it's being effectively installed), the symlink when masked by INSTALL_MASK does not get installed as expected.


So for above example case, if /bin/gunzip was no covered by INSTALL_MASK, /bin/uncompress symlink would not get installed as requested by INSTALL_MASK.
Comment 2 Zac Medico gentoo-dev 2016-01-02 04:40:14 UTC
It's a regression from this commit:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=5a1b870fe54ac06f864a648c3ea5cc118f6ce911
Comment 3 Zac Medico gentoo-dev 2016-01-02 05:20:31 UTC
This is fixed in the master branch:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=f9d1791dbb8f61e836d1b453258502d800776bf2
Comment 4 Zac Medico gentoo-dev 2016-03-14 03:55:13 UTC
Fixed in 2.2.27.