Re: Keeping track of automatically installed dependency-only ports
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Doug Barton wrote: Personally I think that portmaster's approach is the right one. If you accidentally delete something that it turns out you really do need, you can always install it again. On the other hand, the presence of an empty +REQUIRED_BY file is a very reliable indication that something was previously installed as a dependency, but is no longer needed. How about having a special meta-port that depends on all packages directly installed by the user: packages-required-by-user-20070708 or some such. Because this will automatically add a field to +REQUIRED_BY it should give the desired behaviour of blocking (or at least warning about) deinstalling wanted packages for all of the ports management tools I know of. It will need some hackery to have the dependency list of the meta-port updated whenever the end user (de)installs a port/package by name or decides that a package previously installed as a dependency is needed in its own right (or vice versa) Perhaps something like the way OPTIONS processing works, except it dynamically generates a RUN_DEPENDS list, and it should use the same sort of trick as ports-mgmt/vulnerability-test-port -- ie. use the date as its version number -- to ensure it gets updated frequently. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGkIwH8Mjk52CukIwRCLQdAJ4t2NCY39ORu9D5bV6zvRkuZ8YcFACcDNar 60lCEAnKd41QtxuJuOLp+EE= =6rDR -END PGP SIGNATURE- ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
Doug Barton said: Jeremie Le Hen wrote: Hi, Is there a way to track dependency-only ports, so that if I install port0 which requires port1 which in turn requires port2 and so on, deinstalling port0 will deinstall portN up to the first one required by another port or one I explicitely installed. I realize that this is an old post, but the thread it generated indicated that there is demand for this kind of functionality, and no solutions were presented that I could see. Portmaster actually has what I believe you are looking for. Finding installed packages which have no REQUIRED_BY is easy, portmaster do it, check_pkg.py do it, but i don't think this is the solution of the problem. For example, port1 may require port2 which itself requires port3. Assume you remove port1, and that, as a consequence port2 and port3 are no more necessary. It is only port2 which has an empty REQUIRED_BY, as long as you have not removed port2, port3 mentions it in REQUIRED_BY. So the deletion should have to be recursive. Moreover on a large installation you may have a large number of ports that should be removed and should require user approval to do so. But it is hard to remember several months after the fact, if a port without REQUIRED_BY has been installed as a dependency or for a precise reason. The only reliable way to detect ports which have been installed as a dependency is to create a database indicating which ports have been required by the end user, and which ones have been automatically installed. Such a database doesn't exist in the FreeBSD ports system, and as a consequence, it cannot do a good job of cleaning the installed packages. Moreover due to the tendency of some configure scripts to detect automatically installed libraries and behave accordingly, the presence of unwanted and uncleaned ports may be not only a small inconvenience, but may have bad consequences. So i think it should be wise to introduce a database as indicated above, in the same way it has been introduced in aptitude as an enhancement of apt-get. -- Michel TALON ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
Michel Talon wrote: Doug Barton said: Jeremie Le Hen wrote: Hi, Is there a way to track dependency-only ports, so that if I install port0 which requires port1 which in turn requires port2 and so on, deinstalling port0 will deinstall portN up to the first one required by another port or one I explicitely installed. I realize that this is an old post, but the thread it generated indicated that there is demand for this kind of functionality, and no solutions were presented that I could see. Portmaster actually has what I believe you are looking for. Finding installed packages which have no REQUIRED_BY is easy, portmaster do it, check_pkg.py do it, but i don't think this is the solution of the problem. Ok, thanks for clarifying how you see the problem. :) For example, port1 may require port2 which itself requires port3. Assume you remove port1, and that, as a consequence port2 and port3 are no more necessary. It is only port2 which has an empty REQUIRED_BY, Until you remove port2. as long as you have not removed port2, port3 mentions it in REQUIRED_BY. So the deletion should have to be recursive. The 'portmaster -s' function is indeed recursive, for exactly the reason you suggest. Moreover on a large installation you may have a large number of ports that should be removed and should require user approval to do so. But it is hard to remember several months after the fact, if a port without REQUIRED_BY has been installed as a dependency or for a precise reason. I tend to disagree with you here, but since this is a matter of opinion, I'll agree to disagree. :) The only reliable way to detect ports which have been installed as a dependency is to create a database *shudder* You just tripped over your own argument here. There are plenty of ways that we could recognize a port that was installed as a dependency. The one that comes immediately to mind is to create a flag file in /var/db/pkg/foo (or /var/db/ports/foo) to indicate that the port was installed as a dependency. It would be trivial for portmaster and portupgrade to do this, slightly more complicated for it to be done in bsd.port.mk, but not impossible. indicating which ports have been required by the end user, and which ones have been automatically installed. Well, what happens if an application (rather than a library) gets installed as a dependency, but you decide that you like that application, and want to keep it? How do you promote something from dependency installed to user installed? Personally I think that portmaster's approach is the right one. If you accidentally delete something that it turns out you really do need, you can always install it again. On the other hand, the presence of an empty +REQUIRED_BY file is a very reliable indication that something was previously installed as a dependency, but is no longer needed. I'd be interested to hear if others have opinions about this ... Doug -- This .signature sanitized for your protection ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
On Sat, Jul 07, 2007 at 09:57:59AM -0700, Doug Barton wrote: The only reliable way to detect ports which have been installed as a dependency is to create a database *shudder* You just tripped over your own argument here. There are plenty of ways that we could recognize a port that was installed as a dependency. The one that comes immediately to mind is to create a flag file in /var/db/pkg/foo (or /var/db/ports/foo) to indicate that the port was installed as a dependency. It would be trivial for portmaster and portupgrade to do this, slightly more complicated for it to be done in bsd.port.mk, but not impossible. I agree completely with you. Of course when i say that a database has to be created, this may very well be reduced to a flag somewhere in /var/db/pkg. For me, /var/db/pkg is a database describing the installed ports. Wether abusing the filesystem to create this database is good for performance is a completely different problem, at least it has the advantage of being very transparent. indicating which ports have been required by the end user, and which ones have been automatically installed. Well, what happens if an application (rather than a library) gets installed as a dependency, but you decide that you like that application, and want to keep it? How do you promote something from dependency installed to user installed? Indeed you are right, it should be possible to decide of such a promotion. Personally I think that portmaster's approach is the right one. If you accidentally delete something that it turns out you really do need, you can always install it again. On the other hand, the presence of an empty +REQUIRED_BY file is a very reliable indication that something was previously installed as a dependency, but is no longer needed. Typically you can install the java jdk to do programming, and without any required_by stuff. If you accidently erase it, it will be expensive to recreate. Obviously this is not a very good example because this one you will remember. I was thinking more to some obscure ports that you install by curiosity. After several months, perhaps you discover it is on your machine, and you have some use for it. Perhaps if you had erased it, the distfile would have disappeared, or marked broken with new versions of FreeBSD, no more compilable, etc. I'd be interested to hear if others have opinions about this ... Sure this is a point of interest, the more opinions, the better. -- Michel TALON ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
On Sat, 07 Jul 2007 09:57:59 -0700 Doug Barton [EMAIL PROTECTED] wrote: Personally I think that portmaster's approach is the right one. If you accidentally delete something that it turns out you really do need, you can always install it again. [...] I think that the point of this thread was how to avoid such unwanted accidental deletitions -- a very useful thing when you, for example, install/deinstall a lot of applications for testing purposes, as someone pointed out. There is down the thread a proposed idea (related to portupgrade/pkg_deinstall) about introducing a +NEVERDEINSTALL file, e.g. here: http://lists.freebsd.org/pipermail/freebsd-ports/2007-June/041997.html I don't know very much about portmaster so I don't know if something similar already exists there. Nikola Lečić ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
Jeremie Le Hen wrote: Hi, Is there a way to track dependency-only ports, so that if I install port0 which requires port1 which in turn requires port2 and so on, deinstalling port0 will deinstall portN up to the first one required by another port or one I explicitely installed. I realize that this is an old post, but the thread it generated indicated that there is demand for this kind of functionality, and no solutions were presented that I could see. Portmaster actually has what I believe you are looking for. The -e option will expunge an installed port (pkg_delete + option to remove distfiles) and it will then call the -s option recursively to remove any stale ports that were previously installed as a dependency, but are no longer depended on. The -s mode prompts the user before deleting a port, and offers an option to remove the empty +REQUIRED_BY file which is the hallmark of a port that was once a dependency, but is no longer. Finally, portmaster has a -l option to list your installed ports according to categories based on whether they do/don't have dependencies, and whether they are/aren't depended on. This will give you a good view of ports that you're not using any more that could be safely deleted from the root and leaf categories. I should also point out that because portmaster uses (and modifies) only the existing data in the /var/db/pkg directory, all of these features are available whether you use portmaster to keep your ports up to date or not. hope this helps, Doug -- This .signature sanitized for your protection ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
[LoN]Kamikaze wrote: When I want to use Software that is not in ports, I get it into the ports tree. I unfortunately don't have the time to maintain ports for every piece of software I use. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
Peter Jeremy wrote: On 2007-Jun-16 20:44:53 -0700, Stephen Hurd [EMAIL PROTECTED] wrote: Agreed, but this situation is not easy to detect with the automated ports checks that are in place. Impossible even since we're not using automated tools. I was thinking of pointyhat The scenario is installing something *not* from ports which relies on a port which was installed as a dependency then removing the port that required the dependency. The proposed feature would remove the dependency also. Of course, simply not automatically deinstalling SDL would help out quite a bit. If I decide to remove SDL, all the results of that are my fault. If removing portXXX also removes SDL, I can blame the ports system for removing stuff out from under me. A normal 'pkg_delete' will not remove any ports other than those specified and will only remove the port(s) specified iff those ports have no other ports depending on them. If portXYZ registers a dependency on SDL then it will not be possible to remove SDL without disabling the dependency check (via '-f'). The problematic scenario is where the GNU configure script (or equivalent) for portXYZ senses the presence of SDL and decides to use it even though the port doesn't list SDL as a dependency. Two things 1) The suggestion is that pkg_delete SHOULD remove dependencies with no other dependencies marked. 2) The scenario I used was not a port, but a 3rd party piece of software. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
On 2007-Jun-16 20:44:53 -0700, Stephen Hurd [EMAIL PROTECTED] wrote: Agreed, but this situation is not easy to detect with the automated ports checks that are in place. Impossible even since we're not using automated tools. I was thinking of pointyhat Yes - but since it requires the maintainer to manually determine what features are automatically detected and enabled, it is something that is error-prone - the maintainer could easily accidently overlook it. A maintainer needs to do this anyways. A maintainer _should_ do this. They may accidently miss a dependency or they might be too lazy to do a proper job. Of course, simply not automatically deinstalling SDL would help out quite a bit. If I decide to remove SDL, all the results of that are my fault. If removing portXXX also removes SDL, I can blame the ports system for removing stuff out from under me. A normal 'pkg_delete' will not remove any ports other than those specified and will only remove the port(s) specified iff those ports have no other ports depending on them. If portXYZ registers a dependency on SDL then it will not be possible to remove SDL without disabling the dependency check (via '-f'). The problematic scenario is where the GNU configure script (or equivalent) for portXYZ senses the presence of SDL and decides to use it even though the port doesn't list SDL as a dependency. -- Peter Jeremy pgp6Q8dut5wQb.pgp Description: PGP signature
Re: Keeping track of automatically installed dependency-only ports
Peter Jeremy wrote: For an opposing PoV: I often see ports that looks interesting or look like a possible solution to a problem and will install the port to have a play. If it turns out that it's not suitable, I would like to be able to easily unistall the port and any dependencies it pulled in that I didn't already have. Currently, this is a fairly delicate operation and I usually base it on timestamps within /var/db/pkg. All of this rather assumes that *everything* is installed from ports. 1) install portXXX which requires SDL, so SDL gets sucked in 2) build thingYYY (which uses configure and only uses SDL if it's already installed - common) manually and install it 3) remove portXXX (which takes SDL away since I didn't add it to KEEPFOREVER not knowing it was a dependency) 4) Six days later my wife calls me at work complaining that thingYYY doesn't work anymore and what did I do to break it? Surely we are not assuming that everything anyone wants is in the ports system are we? ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
Hi Stephen, On Sat, Jun 16, 2007 at 02:54:27AM -0700, Stephen Hurd wrote: All of this rather assumes that *everything* is installed from ports. 1) install portXXX which requires SDL, so SDL gets sucked in 2) build thingYYY (which uses configure and only uses SDL if it's already installed - common) manually and install it If thingYYY detects SDL and uses it at configure stage, it should be recorded in the dependency list. I suppose this is up to the maintainer to deal with this as whether the aforementioned feature exists or not, nothing would prevent the user from deinstalling SDL and break thingYYY otherwise. Best regards, -- Jeremie Le Hen jeremie at le-hen dot org ttz at chchile dot org ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
On 2007-Jun-16 13:41:54 +0200, Jeremie Le Hen [EMAIL PROTECTED] wrote: On Sat, Jun 16, 2007 at 02:54:27AM -0700, Stephen Hurd wrote: All of this rather assumes that *everything* is installed from ports. 1) install portXXX which requires SDL, so SDL gets sucked in 2) build thingYYY (which uses configure and only uses SDL if it's already installed - common) manually and install it If thingYYY detects SDL and uses it at configure stage, it should be recorded in the dependency list. Agreed, but this situation is not easy to detect with the automated ports checks that are in place. I suppose this is up to the maintainer to deal with this Yes - but since it requires the maintainer to manually determine what features are automatically detected and enabled, it is something that is error-prone - the maintainer could easily accidently overlook it. exists or not, nothing would prevent the user from deinstalling SDL and break thingYYY otherwise. Unfortunately, I can't think of any way to automatically detect this situation. This means that we are basically limited to waiting for people to trip over instances of the problem and report it. -- Peter Jeremy pgp2LX1YrOuBx.pgp Description: PGP signature
Re: Keeping track of automatically installed dependency-only ports
Stephen Hurd wrote: Jeremie Le Hen wrote: Hi Stephen, On Sat, Jun 16, 2007 at 02:54:27AM -0700, Stephen Hurd wrote: All of this rather assumes that *everything* is installed from ports. 1) install portXXX which requires SDL, so SDL gets sucked in 2) build thingYYY (which uses configure and only uses SDL if it's already installed - common) manually and install it If thingYYY detects SDL and uses it at configure stage, it should be recorded in the dependency list. I suppose this is up to the maintainer to deal with this as whether the aforementioned feature exists or not, nothing would prevent the user from deinstalling SDL and break thingYYY otherwise. Hrm? In step 2, manually meant Not using ports That is to say that I downloaded it from Sourceforge myself, extracted it myself, built and installed it myself. I do this fairly often. When I want to use Software that is not in ports, I get it into the ports tree. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
Peter Jeremy writes: At the first place, I think such a situation occurs extremly rare. For an opposing PoV: I often see ports that looks interesting or look like a possible solution to a problem and will install the port to have a play. If it turns out that it's not suitable, I would like to be able to easily unistall the port and any dependencies it pulled in that I didn't already have. Oh, pretty - me want! Robert Huff ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
On Fri, 15 Jun 2007 22:11:25 +1000 Peter Jeremy [EMAIL PROTECTED] wrote: [...] On 2007-Jun-15 01:22:38 +0200, Nikola Lecic [EMAIL PROTECTED] wrote: At the first place, I think such a situation occurs extremly rare. For an opposing PoV: I often see ports that looks interesting or look like a possible solution to a problem and will install the port to have a play. If it turns out that it's not suitable, I would like to be able to easily unistall the port and any dependencies it pulled in that I didn't already have. Currently, this is a fairly delicate operation and I usually base it on timestamps within /var/db/pkg. Hmm, are you sure that's the _opposing_ issue? I think that's exactly what Jeremie Le Hen asked starting this thread. He wants to do upward-recursive deinstall without accidentally removing ports he needs. (And yes, your idea to look at the installation time to distinguish such ports sounds very fine!) So, would you find useful the idea of adding +NEVERDEINSTALL as I proposed down the thread? You installed an experimental port A; pkg_deinstall -R A deinstalls it and all dependencies it introduced, except: * dependencies needed by some other ports (you want them, of course), * ports marked with +NEVERDEINSTALL (by including them to the -x list), since you want them for some special reason (they were -- optionally, of course -- marked so when you listed them with portinstall on the command line). Please take a look. Nikola Lečić ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
On Thu, 14 Jun 2007 09:06:02 +0200 Jeremie Le Hen [EMAIL PROTECTED] wrote: Hi, Is there a way to track dependency-only ports, so that if I install port0 which requires port1 which in turn requires port2 and so on, deinstalling port0 will deinstall portN up to the first one required by another port or one I explicitely installed. Aren't you speaking about 'pkg_deinstall --upward-recursive port0'? Nikola Lečić ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Keeping track of automatically installed dependency-only ports
Nikola, Thanks for your reply. On Thu, Jun 14, 2007 at 09:14:33AM +0200, Nikola Lecic wrote: On Thu, 14 Jun 2007 09:06:02 +0200 Jeremie Le Hen [EMAIL PROTECTED] wrote: Is there a way to track dependency-only ports, so that if I install port0 which requires port1 which in turn requires port2 and so on, deinstalling port0 will deinstall portN up to the first one required by another port or one I explicitely installed. Aren't you speaking about 'pkg_deinstall --upward-recursive port0'? My request ismore subtle, I think. Consider the following fake port tree: port1 port2 port3*port4 \/ \ | / \ / \ | / port12* \|/ \ | / port234* A trailing * marks a port manually installed. If I run pkg_deinstall --upward-recursive port234, this will remove port234, port3 and port4 (at least I suppose, the manual page doesn't give the details). But since I've installed port3 manually it's likely because I need it for some reason, therefore I don't want it to be deinstalled. Best regards, -- Jeremie Le Hen jeremie at le-hen dot org ttz at chchile dot org ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]