From owner-freebsd-ports@FreeBSD.ORG Thu Jul 31 04:51:06 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 229561065672 for ; Thu, 31 Jul 2008 04:51:06 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id C4AB08FC0C for ; Thu, 31 Jul 2008 04:51:05 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 14851 invoked by uid 399); 31 Jul 2008 04:51:04 -0000 Received: from localhost (HELO ?192.168.0.4?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 31 Jul 2008 04:51:04 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <489144B5.4030101@FreeBSD.org> Date: Wed, 30 Jul 2008 21:51:01 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Ivan Voras References: In-Reply-To: X-Enigmail-Version: 0.95.6 X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org Subject: Re: Call for comments - pkg_trans X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2008 04:51:06 -0000 Ivan Voras wrote: > Hi, > > I apologize in advance if what I'm trying to do seems stupid or it has > already existed since the Dawn of Time (i.e. when McKusick was in > diapers) but I'd like your comments on this idea: > > http://wiki.freebsd.org/IvanVoras/PkgTransProposal > > I can write the pkg_trans utility and modify the C utilities (pkg_add, > pkg_delete, if they're sane) but I can't do makefiles and ruby, so if > this is to work, I'll need some help :) You have some very interesting ideas there. Not that I want to dissuade you in any way from doing this, but I would like to point out that portmaster already does some of what you're suggesting and it could fairly easily be modified to do just about all the rest of it. The two things it does now already are to save binary packages before running pkg_delete, and it has the ability to "roll back" installation of ports you no longer want, along with all dependencies related to those ports that become obsolete. Take a look at the -e and -s options for the latter, and the -b and -g options for the former. By default portmaster saves the backup packages until the current round of updates is done, then if the user hasn't specified the -b option they get deleted before portmaster exits. In terms of the rest of your proposal, off the top of my head the transaction IDs should probably be saved in /var/db/ports. I need to think harder about what format .... you could probably have a /var/db/ports/trans/ and then save the logs of the transactions as individual files by transaction ID. The wheels are spinning in my mind right now about how this could get hairy down the road when you install a bunch of stuff as dependencies for fooport, then you start doing upgrades on the individual dependencies the log of the transaction quickly becomes less valuable. Some thought would have to be given to exactly what the goals are, how long those logs should be valid/useful, etc. As I said though, portmaster already has the capability to do two things you say you want to support, albeit the "rollback" operation would have to be done manually. I think it would be pretty simple to add support for an "undo" feature when it comes to upgrading something in place and/or deleting existing stuff as long as you don't expect the ability to undo that particular transaction to last longer than the time period until you modify something that was part of it. I think "undo" for a new installation is harder for the reasons I mentioned above, but the good news is that it's already possible to do most of that just using the existing ports infrastructure. hth, Doug -- This .signature sanitized for your protection