Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 160735 - app-portage/portage-utils: help qfile finding file collisions
Summary: app-portage/portage-utils: help qfile finding file collisions
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Portage Utils Team
URL:
Whiteboard:
Keywords:
Depends on: 158829
Blocks:
  Show dependency tree
 
Reported: 2007-01-07 17:06 UTC by TGL
Modified: 2007-01-13 19:21 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
qfile--exclude-pkg.patch (qfile--exclude-pkg.patch,4.12 KB, patch)
2007-01-07 17:07 UTC, TGL
Details | Diff
man/include/qfile-05-collisions.include (qfile-05-collisions.include,1.53 KB, text/plain)
2007-01-07 17:08 UTC, TGL
Details
qfile--exclude-pkg.patch (qfile--exclude-pkg.patch,4.84 KB, patch)
2007-01-07 22:16 UTC, TGL
Details | Diff
man/include/qfile-05-collisions.include (qfile-05-collisions.include,1.56 KB, text/plain)
2007-01-12 16:48 UTC, TGL
Details
man/include/qfile-05-collisions.include (qfile-05-collisions.include,1.60 KB, text/plain)
2007-01-12 17:45 UTC, TGL
Details
qfile--exclude.patch (qfile--exclude.patch,5.02 KB, patch)
2007-01-12 17:46 UTC, TGL
Details | Diff
qfile--exclude--syntax_fixes.patch (qfile--exclude--syntax_fixes.patch,4.88 KB, patch)
2007-01-13 10:32 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description TGL 2007-01-07 17:06:41 UTC
Following the introduction of the --from-file option (bug #158829), i've added another new option to file:
  -x, --exclude-pkg <arg>   * Don't look in package <arg>

"<arg>" can be either "category/name", or "category/name-version", or "category/name:slot".

It allows excluding one of your vdb packages from the qfile search.  It is useful when you want to use qfile for detecting file collisions beetween packages.  I will also attach a new qfile.1 man section, with two example scripts showing this option in action.
Comment 1 TGL 2007-01-07 17:07:46 UTC
Created attachment 105879 [details, diff]
qfile--exclude-pkg.patch

This patch is incremental over the one attached to bug #158829.
Comment 2 TGL 2007-01-07 17:08:40 UTC
Created attachment 105881 [details]
man/include/qfile-05-collisions.include

A new man section which shows this option at work.
Comment 3 TGL 2007-01-07 22:16:37 UTC
Created attachment 105947 [details, diff]
qfile--exclude-pkg.patch

Updated patch which applies to revision 1.40 and passes the "make check".
Comment 4 TGL 2007-01-12 16:48:22 UTC
Created attachment 106701 [details]
man/include/qfile-05-collisions.include

Oops, one example script was broken.
Comment 5 solar (RETIRED) gentoo-dev 2007-01-12 17:20:53 UTC
Two comments. 
1) Can you rename it to just --exclude (I like short long options)
2) Can you not use /tmp for example scripts (it promotes bad security.)
Comment 6 TGL 2007-01-12 17:45:34 UTC
Created attachment 106704 [details]
man/include/qfile-05-collisions.include

Use an mktemp created dir in the example script, instead of /tmp directly.
Comment 7 TGL 2007-01-12 17:46:21 UTC
Created attachment 106705 [details, diff]
qfile--exclude.patch

Renamed the option "--exclude".
Comment 8 solar (RETIRED) gentoo-dev 2007-01-12 22:16:42 UTC
Is this expected behavior?

solar@onyx /var/cvsroot/gentoo-projects/portage-utils $ ./qfile -x sys-apps/coreutils-6.2:0 ls
solar@onyx /var/cvsroot/gentoo-projects/portage-utils $ ./qfile -x sys-apps/coreutils-6.2 ls
solar@onyx /var/cvsroot/gentoo-projects/portage-utils $ ./qfile -x sys-apps/coreutils ls
solar@onyx /var/cvsroot/gentoo-projects/portage-utils $ ./qfile -x coreutils ls
sys-apps/coreutils (/bin/ls)
sys-apps/coreutils (/usr/bin/ls)


Notice the last check was simply PN vs CAT/PN.. 
I'm going to commit this as is. If you do any changes please cvs up first.

Comment 9 TGL 2007-01-13 10:28:53 UTC
(In reply to comment #8)
> Is this expected behavior?
> 
> solar@onyx /var/cvsroot/gentoo-projects/portage-utils $ ./qfile -x
> sys-apps/coreutils-6.2:0 ls

This one was not really expected, i hadn't thought about it...

The ":slot" syntax was rather meant to be used after a CAT/PN:
$ qfile -x sys-apps/coreutils:0 /bin/ls

That's what is used in the .tbz2 checking script, so that no conflict is reported for a pkg update.

> solar@onyx /var/cvsroot/gentoo-projects/portage-utils $ ./qfile -x coreutils ls
> sys-apps/coreutils (/bin/ls)
> sys-apps/coreutils (/usr/bin/ls)
> 
> 
> Notice the last check was simply PN vs CAT/PN.. 

I hadn't thought about that one neither, but yes, it would be better to handle it too.  A patch for current CVS follows, which extends the supported argument syntax to "(CAT/)?(PN|PF)(:SLOT)?".

Btw, thanks for the patch reviews.
Comment 10 TGL 2007-01-13 10:32:21 UTC
Created attachment 106772 [details, diff]
qfile--exclude--syntax_fixes.patch

Incremental patch which:
 - extends --exclude argument syntax to "(CAT/)?(PN|PF)(:SLOT)?"
 - documents this syntax extension in the manpage include file
 - adds some "-o", "-f -" and "-x pkg" tests to the tests/qfile/dotest script
Comment 11 solar (RETIRED) gentoo-dev 2007-01-13 19:21:34 UTC
Commited this to CVS. Thanks again.