Date: Sun, 24 Feb 2002 22:54:02 -0500 (EST) From: Jason Hunt <leth@primus.ca> To: freebsd-ports@freebsd.org Subject: Upgrading ports Message-ID: <Pine.BSF.4.40.0202242121200.98553-100000@lethargic.dyndns.org>
next in thread | raw e-mail | index | archive | help
I'm looking for some comments on this. If this is the wrong mailing list, where might be a good spot? This seemed reasonable. Upgrading ports appears to be a pain. I'm getting frusterated just writing this email. Keep in mind that I might be ignorant to something here, and if so please let me know. Also, this could have been discussed before, but I havn't been able to find anything in the archives. There are two main ways of upgrading ports that are available. Firstly, there is "pkg_version -c". This one seems sorta dangerous to me. It also appears to assume that every port will be upgraded. It could leave stale dependancies. I've never actually used it either, so I don't know. pkg_add and pkg_delete do not deal with dependancies from what I have heard - maybe this is an idea? Secondly, there is portupgrade. My understanding of portupgrade is that it will make it's own database of ports. You are also supposed to use portupgrades own utilities for adding and removing ports. The pkgdb utility also asks me too many questions. Sorry, I don't like any of this, I'm stubborn. Maybe I'm just a fool. Regardless, what I have always done is just installed the new version of a port overtop of the old one. You could remove the old version, but depenancies get in the way. Putting a new one overtop always seems to work without a problem. However, you are then left with two versions being listed as installed. This gets to be messy. Explaining this whole thing gets to be even worse, so I will use an example. First, I will go over how I see the /var/db/pkg structure working. If you know how this works, go to the next paragraph. For every port that is installed, there is a directory in /var/db/pkg for it. Inside these directories are the files named +COMMENT, +CONTENTS, +DESC and +REQUIRED_BY. +COMMENT and +DESC have their obvious purposes. +CONTENTS has numerous things, including a list of packages that the current package depends on, which are the "@pkgdep" lines. There is also the +REQUIRED_BY file, which lists the packages that required this package. This is redundant, but maybe this cross-referencing is good? On with the example; gnomedb-0.2.93_2 (v2) is currently installed. The ports tree gets updated, and now there is a new version available, gnomedb-0.2.93_3 (v3). I install v3 without removing v2. So now v3 is installed and it works and everything is great. Now we need to get rid of v2 and all references to it. gnomedb-v2 depends on numerous other packages. One of these is esound. Both versions of gnomedb are listed in esound's REQUIRED_BY file, but that is fine. I take out gnomedb-v2 from esound's REQUIRED_BY list. This is repeated for every other other port. Now no other packages will complain that gnomedb-v2 depends on it. There are also other packages that will have gnomedb-v2 listed in their "@pkgdep" lines. They should be modified to depend on gnomedb-v3 instead. So for every occurance of gnomedb-v2 in the CONTENTS file, replace it with gnomedb-v3. It's a simple search and replace I suppose. Now gnomedb-v2 is not listed in any thing. I then remove the /var/db/pkg/gnomedb-0.2.93_2 (v2) directory. It is uninstalled. I have not noticed any negative side effects to this method. I'm wondering if this is worthwhile to be made into an automated tool of some sort? Something that would clean up the /var/db/pkg directories after the fact, of installing a newer version of a port. portupgrade seemed to have the right idea, but I don't like how it actually operates. Or maybe something of this nature could be incorporated into pkg_add as an option? Or maybe when running make install, you could specify which package this is to be a replacement for? There are lots of ways it could be done. Comments? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.40.0202242121200.98553-100000>