Date: Thu, 8 Mar 2001 10:23:16 -0500 (EST) From: The Anarcat <anarcat@dojo.tao.ca> To: ports@freebsd.org Cc: jkh@freebsd.org Subject: Multiple packages version conflict resolving script/procedure Message-ID: <20010308152316.48B094E91@dojo.tao.ca>
next in thread | raw e-mail | index | archive | help
Hi! [I CC this to jkh since it seems he's the grand pkg_install guru.. :)] I have been working on a small (perl) script to resolve version conflicts in cases where multiple versions of a same package are installed. This sometimes happens within ports or even pkg_add installs and the result is quite annoying when installing many thing automagically. Say for example, that I install a package which needs libxml-1.0.2 but I already have 1.0.1 installed. pkg_add (AFAIK) will happily install 1.0.2 over 1.0.1, effectively creating an annoying problem: if we pkg_delete 1.0.1, we also remove files in 1.0.2, so we basically must pkg_delete 1.0.1 1.0.2 && pkg_add 1.0.2... Numbers are probably wrong, but you get the idea. One might argue that you must not install 1.0.2 in the first place (duh!) before removing the older package but sometimes, as I said, these things are processed automatically, by the ports or pkg_add dependency systems. The script I'm working on (let's call it pkg_resolve) will allow us to "hack" through the process a bit. It examines files installed in the /var/db/pkg directory (optionnally matching a regexp) and check if there are pairs of packages with the same names (actually, ?(.*)-[0-9].*$ where $1 is the package name). It then examines the conflicting (same name) packages 2 by 2, starting with older versions. For now, the processing is quite crude. The +CONTENT files are diffed and if some of the files present in the older package are not in the new one, they are removed (upon confirmation, of course). This will be improved to deal with various '@' directives diffs (for now it deals only with @comment, @ignore, and other various trivial tags :). The +CONTENT file is then "merged" to take into account what files are really installed. The +REQUIRED_BY is also examined to be merged, but I don't know yet how to precisely deal with it (for now it's just "unioned"). Once this is done, the old package is "removed" (that is rm -rf $pkg_dir, because pkg_delete would delete our precious installed files). The reasoning behind the script is that you do not want to deinstall and reinstall over and over again if you already have a working installed version. This script could have various uses, especially for people (like me) who install ports by the day and try to follow recent developpment in software like GNOME or KDE... You do *not* want to reinstall these packages a few times in a row, especially if you d/l then via the network with pkg_add. :) Another great use would be a sort of a hack to allow an upgrade via the ports, a bit like pkg_upgrade (could it be integrated into the "make install" process?). Since you may not necessarly want to de-install a port before upgrading it, this script might just be for you... I will publish code on a site somewhere tonight (EST) and maybe submit it as a port (or pr as bin?). I don't know how to call it yet, though. :) Anyways, I just want to know what you guys think about this, suggestions, etc... Thanks A. -- Everything is normal. Thus, nothing is. 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?20010308152316.48B094E91>