Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 20202 - Read-only listing of injected stubs
Summary: Read-only listing of injected stubs
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-30 03:34 UTC by Narada Sage
Modified: 2011-10-30 22:19 UTC (History)
2 users (show)

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


Attachments
Patch for injected stubs (qpkg.diff,1.41 KB, patch)
2003-11-11 09:21 UTC, Narada Sage
Details | Diff
Minor corrections including comment (qpkg.diff,1.43 KB, patch)
2003-11-11 09:28 UTC, Narada Sage
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Narada Sage 2003-04-30 03:34:14 UTC
I would like to propose an enhancement bug for portage if it has not been
mentioned already.  At the moment, one can inject stubs and remove them but not
do anything else with them.  It should be made possible to do the following.

- display all applied stubs
- remove all injected stubs
- manipulate stubs so that when a newer version of package is released on stable
the stub for the older version is removed or the user is notified of it
- if a package needs to be installed that is currently stubbed user is notified

Here is a script I use for displaying stubs that was published on gentoo-user ML.

----
#!/bin/sh
# Display stub injected packages
pushd /var/db/pkg > /dev/null
for d in */*; do
        echo $d `ls $d | wc -l` | awk '{ if ($2 <= 2) print $1 }'
done
popd > /dev/null
----

Many thanks.
Comment 1 SpanKY gentoo-dev 2003-04-30 15:58:34 UTC
why not add your bit of code to qpkg in gentoolkit ...
Comment 2 Narada Sage 2003-05-06 08:51:31 UTC
Hello.  Here is some food for thought and an attempt to clarify ambiguity on this subject.  There exists emerge, etcat and qpkg with a large degree of overlap between them although latter two are primarily read only.  This brings about the question that if portage doesn't assimilate a new feature request being already heavily overloaded and feature rich then which of etcat and qpkg should adopt it?  Now, given that qpkg isn't actively maintained and that I find the new etcat utility much more promising I would like to motion the gradual migration of qkpg functionality possibly to eventually deprecate it.  This will mean that new feature requests can then be adopted without indecisiveness by etcat.  I'd be glad to hear your thoughts.
Comment 3 Narada Sage 2003-08-23 05:04:20 UTC
Is there any intention at all to ever add functionality to manipulate injected stubs into portage?  If not, please add that bit of code below to qpkg and close the bug.  If you do not wish to add it to qpkg that is also fine.  This has been open for a long time without any real feedback.  Thanks.
Comment 4 Heinrich Wendel (RETIRED) gentoo-dev 2003-08-23 15:54:28 UTC
write a patch ... 
Comment 5 Martin Holzer (RETIRED) gentoo-dev 2003-09-30 12:10:41 UTC
qpkg feature
Comment 6 Narada Sage 2003-11-11 08:36:02 UTC
Hello.  Here is a simpler and quicker way of finding stubs without using
awk.
----
for D in /var/db/pkg/*/*; do
  if [ $(ls "$D" | wc -l) == 1 ]; then
    echo -e "$D" | cut -d'/' -f5-
  fi
done
----
Sorry I haven't had time to make a patch.  Time is so short that I haven't
been able to browse qpkg code to write a patch.  I will try and do so as
soon as time allows.
Comment 7 SpanKY gentoo-dev 2003-11-11 08:58:51 UTC
injected packages dont have a CONTENTS file ... thus we can do it all in
bash:

for D in /var/db/pkg/*/*; do
  [ ! -f ${D}/CONTENTS ] && echo ${D/*\/}
done
Comment 8 Narada Sage 2003-11-11 09:21:13 UTC
Created attachment 20599 [details, diff]
Patch for injected stubs

Here is a patch for qpkg to display injected stubs using the most recent
suggestion by SpanKY.  Do with what you will :)  I've used the standard
practice of directories in ${BR} and remainder in ${CY} colour.  I wasn't
sure
about conflicting options but I've added an exit in that section so it doesn't
do anything else.  Thanks.
Comment 9 Narada Sage 2003-11-11 09:28:38 UTC
Created attachment 20600 [details, diff]
Minor corrections including comment
Comment 10 Narada Sage 2004-01-15 00:38:16 UTC
Since gentoolkit has been rewritten into gentoolkit-dev I suppose this bug is obsolete now?
Comment 11 Marius Mauch (RETIRED) gentoo-dev 2004-06-09 20:01:10 UTC
I don't really see a need for this and I certainly don't want to encourage the use of --inject unless it's really necessary. Also gentoolkit tools are generally read-only and shouldn't modify the package database.
Comment 12 Narada Sage 2004-06-22 16:38:05 UTC
Genone.  What you say makes absolutely no sense whatsoever.  I am asking for a way to list all injected packages on a system.

First of all, this is 100% read only.  It does not modify the package database.

Secondly, it does not encourage injection of stubs but if you do have some stubs injected which you have to do sometimes then it lets you list them in order to delete them.  Otherwise how are you supposed to know what's injected and what's not.

From what you have said it seems you have not read about this bug properly.  If you don't like the patches attached please modify to your liking.  It's a ridiculously easy task.
Comment 13 Marius Mauch (RETIRED) gentoo-dev 2004-06-22 16:52:36 UTC
> - remove all injected stubs
> - manipulate stubs so that when a newer version of package is released on stable
> the stub for the older version is removed or the user is notified of it

That's read-only ? The summary says "manipulating", doesn't sound like read-only to me too. The listing feature might be useful, if you're _only_ after that feel free to reopen and change the summary accordingly. I'm always looking at the whole bug, not only the last 3 comments.
Btw, I'm on dev-portage, no need to CC me.
Comment 14 Narada Sage 2004-06-22 17:04:18 UTC
Sorry my mistake.  I actually completely forgot about the write functionality and I think everyone else had too considering how little attention it had received.  I'll change it to read only listing of injected stubs.  This should simplify this bug a fair bit.  And now that qpkg and equery have evolved so considerably and I'm so out of touch and out of time I doubt my patches here are of any use.  Considering how easy this is though one of the devs will no doubt whip this up in a couple of minutes.  Thanks for clearing this up genone.
Comment 15 Jason Stubbs (RETIRED) gentoo-dev 2004-10-05 05:15:13 UTC
portage-2.0.51 deprecates --inject and has a package.provided config file in it's place. If you want to find everything that you have injected so that you can migrate, just look for all dirs in /var/db/pkg that don't have a CONTENTS file.