Summary: | sys-apps/portage: INSTALL_MASK does not filter symlinks to existing dirs | ||
---|---|---|---|
Product: | Portage Development | Reporter: | SpanKY <vapier> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | sam |
Priority: | Normal | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | https://crbug.com/924355 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 837899 | ||
Bug Blocks: |
Description
SpanKY
![]() When adding a symlink to 'files' variable, you forgot to remove it from 'dirs' variable: if os.path.islink(abs_path): files.append(d) dirs.remove(d) Then your patch would happen to work. ChromiumOS patch: https://chromium.googlesource.com/chromiumos/third_party/portage_tool/+/6473079d07351dda49a906cb89d24a9a39526bf7%5E%21/ The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=5cc166489106da93c20ad3c5bb138ba8a359de2c commit 5cc166489106da93c20ad3c5bb138ba8a359de2c Author: Jeff Chase <jnchase@google.com> AuthorDate: 2021-05-04 17:29:58 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-04-15 04:26:22 +0000 install_mask: remove masked symlinks to directories (bug 678462) os.walk() categorizes symlinks to directories as directories so they were being ignored by INSTALL_MASK. This change calls os.scandir() instead which efficiently provides more control. [sam: cherry-picked from chromiumos' third_party/portage_tool repo] (cherry picked from commit 6473079d07351dda49a906cb89d24a9a39526bf7) Bug: https://bugs.gentoo.org/678462 Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/gentoo/portage/pull/820 Signed-off-by: Sam James <sam@gentoo.org> lib/portage/tests/util/test_install_mask.py | 33 +++++++++++++++++++++++++++-- lib/portage/util/install_mask.py | 18 ++++++++++------ 2 files changed, 42 insertions(+), 9 deletions(-) |