Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 652720 - app-portage/portage-utils: qfile: Initial path prefixes incorrectly stripped for matching
Summary: app-portage/portage-utils: qfile: Initial path prefixes incorrectly stripped ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All All
: Normal normal
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-07 02:12 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2018-05-18 12:27 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 Arfrever Frehtes Taifersar Arahesis 2018-04-07 02:12:18 UTC
Initial path prefixes are incorrectly stripped for matching, but they should be preserved.
All of the following commands match /bin directory:

# qfile /bin
app-arch/bzip2 (/bin)
app-arch/cpio (/bin)
app-arch/gzip (/bin)
app-arch/tar (/bin)
...
# qfile bla/bin
app-arch/bzip2 (/bin)
app-arch/cpio (/bin)
app-arch/gzip (/bin)
app-arch/tar (/bin)
...
# qfile /bla/bin
app-arch/bzip2 (/bin)
app-arch/cpio (/bin)
app-arch/gzip (/bin)
app-arch/tar (/bin)
...
# qfile bla/bla/bin
app-arch/bzip2 (/bin)
app-arch/cpio (/bin)
app-arch/gzip (/bin)
app-arch/tar (/bin)
...
# qfile /bla/bla/bin
app-arch/bzip2 (/bin)
app-arch/cpio (/bin)
app-arch/gzip (/bin)
app-arch/tar (/bin)
...
# qfile bla/bla/bla/bin
app-arch/bzip2 (/bin)
app-arch/cpio (/bin)
app-arch/gzip (/bin)
app-arch/tar (/bin)
...
# qfile /bla/bla/bla/bin
app-arch/bzip2 (/bin)
app-arch/cpio (/bin)
app-arch/gzip (/bin)
app-arch/tar (/bin)
...



The result of this bug is that `qfile /usr/bin` prints both packages which own /usr/bin and packages which own /bin:
# qfile /usr/bin
app-admin/apache-tools (/usr/bin)
app-admin/eselect (/usr/bin)
app-admin/sudo (/usr/bin)
app-admin/syslog-ng (/usr/bin)
app-arch/brotli (/usr/bin)
app-arch/bzip2 (/bin)
app-arch/bzip2 (/usr/bin)
app-arch/cabextract (/usr/bin)
app-arch/cpio (/bin)
app-arch/gcab (/usr/bin)
app-arch/gzip (/bin)
app-arch/gzip (/usr/bin)
app-arch/libarchive (/usr/bin)
app-arch/p7zip (/usr/bin)
app-arch/rpm2targz (/usr/bin)
app-arch/tar (/bin)
app-arch/unzip (/usr/bin)
app-arch/xz-utils (/usr/bin)
app-arch/zip (/usr/bin)
...
Comment 1 Fabian Groffen gentoo-dev 2018-04-07 10:43:54 UTC
Question, is this behaviour new since 0.70 for you, or has it always been like this?
Comment 2 Fabian Groffen gentoo-dev 2018-04-07 10:51:51 UTC
Ok, this is not new, and interestingly enough only hits non-Prefix systems.
Comment 3 Arfrever Frehtes Taifersar Arahesis 2018-04-07 19:54:17 UTC
For testing on Prefix system, try:

cd ${EPREFIX}
mkdir -p var/db/pkg/app-misc/aaa-0
echo "obj /aaa d41d8cd98f00b204e9800998ecf8427e 0" > var/db/pkg/app-misc/aaa-0/CONTENTS

qfile /aaa
qfile /bla/bla/aaa
Comment 4 Larry the Git Cow gentoo-dev 2018-04-15 12:04:29 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=23c09a20dfcc044343b16bfe4b5873f663a46286

commit 23c09a20dfcc044343b16bfe4b5873f663a46286
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2018-04-15 12:03:14 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2018-04-15 12:03:14 +0000

    qfile: fix matching of files
    
    A bit overenthusiastic check for files in the current directory caused
    weird directory prefixes to be ignored.
    
    Bug: https://bugs.gentoo.org/652720

 man/include/qfile-01-owners.include |  9 ++--
 qfile.c                             | 94 ++++++++++++++++++++++---------------
 2 files changed, 60 insertions(+), 43 deletions(-)}
Comment 5 Larry the Git Cow gentoo-dev 2018-05-18 12:27:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47d5c9788b9550078e17aad238fa03cabe20fd46

commit 47d5c9788b9550078e17aad238fa03cabe20fd46
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2018-05-18 12:27:07 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2018-05-18 12:27:23 +0000

    app-portage/portage-utils: version bump to v0.71
    
    Closes: https://bugs.gentoo.org/619988
    Closes: https://bugs.gentoo.org/653202
    Closes: https://bugs.gentoo.org/652312
    Closes: https://bugs.gentoo.org/652720
    Closes: https://bugs.gentoo.org/653032
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 app-portage/portage-utils/Manifest                                | 2 +-
 .../{portage-utils-0.65.ebuild => portage-utils-0.71.ebuild}      | 8 --------
 2 files changed, 1 insertion(+), 9 deletions(-)