From owner-freebsd-arch@FreeBSD.ORG Wed Sep 3 12:14:32 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C5C916A4BF for ; Wed, 3 Sep 2003 12:14:32 -0700 (PDT) Received: from mail1.qc.uunet.ca (mail1.qc.uunet.ca [198.168.54.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id A135343FE0 for ; Wed, 3 Sep 2003 12:14:30 -0700 (PDT) (envelope-from anarcat@espresso-com.com) Received: from xtanbul.studio.espresso-com.com ([216.94.147.57]) by mail1.qc.uunet.ca (8.12.9/8.12.9) with ESMTP id h83JETsB030519 for ; Wed, 3 Sep 2003 15:14:29 -0400 Received: from anarcat by xtanbul.studio.espresso-com.com with local (Exim 3.36 #1 (Debian)) id 19ud5I-0005Ck-00 for ; Wed, 03 Sep 2003 15:14:28 -0400 Date: Wed, 3 Sep 2003 15:14:28 -0400 From: The Anarcat To: freebsd-arch@freebsd.org Message-ID: <20030903191427.GE541@xtanbul> References: <20030903143948.GA61515@gattaca.yadt.co.uk> <20030903144734.GZ47671@procyon.firepipe.net> <20030903182925.GA79913@gattaca.yadt.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030903182925.GA79913@gattaca.yadt.co.uk> User-Agent: Mutt/1.5.4i Sender: The Anarcat Subject: config files in packages (Re: (proposal) new flag for pkg_delete) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2003 19:14:32 -0000 (This is just moot since I have absolutely no time to implement this, but it's food for thought i have been digesting for a long time now) Debian adopted what I think is an elegant solution to this problem. The configuration files are marked as such in the package. When deinstalling, you must explicitely ask it if you want the configuration files to be removed. When upgrading or installing over, the package "knows" the old MD5 of the config files, so if they match (ie the config wasn't modified), they're overwritten. If the md5 don't match (ie the config was modified), the user is presented with an interface similar to that of mergemaster (minus the merge capabilities, unfortunatly). I think this scheme could be generalized to all the files in the package. What I would see for our pkg_tools is the following: 1- overwriting of unmodified files 2- merging of modified files (1) already works, provided that we don't use the -f flag to pkg_delete, since the old files simply get deleted. (2) would need a better integration between pkg_add and pkg_delete, because problem is right now, unless I'm mistaken, a package upgrade is made in 2 seperate process that don't really talk to each other: pkg_delete and pkg_add. The way I see it, ideally, pkg_add should be able to call pkg_delete on the old package. When files would be left behind, it would mean that they were modified outside the package system and that we need to merge. Anyways, pkg_add shouldn't overwrite already existing files. So the most basic solution to this whole problem would be to hack pkg_add to make it merge with existing non-binary files and ask in case of binary. Doing this would allow us to get out of the "default config" and "working config" scheme that is hard to maintain. When using such a scheme, if a major configuration parameter changes, you're SOL unless you diff against the your copy of the config. The pkg_add hack could take care of that. But then there's also the problem of make install in the ports. We would need a custom install target for configuration files that would check for existence before installing. This could actually be a little script that is called by pkg_add and do-install for certain files. Just my $CA 0,02... A.