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.
Created attachment 105879 [details, diff] qfile--exclude-pkg.patch This patch is incremental over the one attached to bug #158829.
Created attachment 105881 [details] man/include/qfile-05-collisions.include A new man section which shows this option at work.
Created attachment 105947 [details, diff] qfile--exclude-pkg.patch Updated patch which applies to revision 1.40 and passes the "make check".
Created attachment 106701 [details] man/include/qfile-05-collisions.include Oops, one example script was broken.
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.)
Created attachment 106704 [details] man/include/qfile-05-collisions.include Use an mktemp created dir in the example script, instead of /tmp directly.
Created attachment 106705 [details, diff] qfile--exclude.patch Renamed the option "--exclude".
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.
(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.
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
Commited this to CVS. Thanks again.