From owner-freebsd-questions@FreeBSD.ORG Sat May 20 21:32:14 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6CB1A16A424 for ; Sat, 20 May 2006 21:32:14 +0000 (UTC) (envelope-from beech@alaskaparadise.com) Received: from pinnacle.akherb.com (60-105-237-24.gci.net [24.237.105.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86E8043D45 for ; Sat, 20 May 2006 21:32:12 +0000 (GMT) (envelope-from beech@alaskaparadise.com) Received: by pinnacle.akherb.com (Postfix, from userid 1007) id 802865D7B; Sat, 20 May 2006 13:32:11 -0800 (AKDT) X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pinnacle.akherb.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=4.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.1 Received: from 114-103-74-65.gci.net (114-103-74-65.gci.net [65.74.103.114]) by pinnacle.akherb.com (Postfix) with ESMTP id D66AB5D24; Sat, 20 May 2006 13:32:07 -0800 (AKDT) From: Beech Rintoul Organization: Alaska Paradise To: freebsd-questions@freebsd.org Date: Sat, 20 May 2006 13:31:53 -0800 User-Agent: KMail/1.9.1 References: <446F8282.9060807@computer.org> In-Reply-To: <446F8282.9060807@computer.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2037083.aDVZ48N0R6"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200605201332.05804.beech@alaskaparadise.com> Cc: Eric Schuele Subject: Re: Managing a [local] package repository.... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 May 2006 21:32:16 -0000 --nextPart2037083.aDVZ48N0R6 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 20 May 2006 12:56, Eric Schuele wrote: > Hello, > > I'm wondering how others manage a local store of packages... or even if > anyone does this sort of thing. Let me explain... > > Some short time back I decided to start stockpiling packages of all the > ports I have installed on my machine. I was/am doing this because I > intend on doing a fresh install to 6.1-RELEASE when I have the time. > But, although I do prefer to compile the ports (as opposed to > downloading the packages) I do not wish to recompile them all *again*, > because it is a significant amount of time. I intend to just transfer > them to the new installation. So I wrote a small script (appended > below, comments welcome) to create packages of everything on my system. > I did that one time, and have since done "make install package clean" > to install new packages, and done "portupgrade -aprR" to upgrade those > presently installed. > > While this does seem to work well for me, it has left one problem I did > not foresee. As ports get upgraded, their new package is built and > placed in my package dir, but the *old* port's package is not removed. > So I now have quite a few packages in my package directory that are not > the most recent, and hence are just taking up space. > > Example (/usr/ports/packages/All): > ---- > ImageMagick-6.2.5.5_4.tbz > ORBit-0.5.17_3.tbz > ORBit2-2.14.0.tbz <--- > ORBit2-2.14.0_1.tbz <--- > OpenSP-1.5_7.tbz > aspell-0.60.4_3.tbz > at-spi-1.7.7.tbz <--- > at-spi-1.7.7_1.tbz <--- > aterm-1.0.0_1.tbz > atk-1.11.4.tbz <--- > atk-1.11.4_1.tbz <--- > autoconf-2.13.000227_5.tbz > autoconf-2.59_2.tbz > automake-1.4.6_2.tbz > automake-1.9.6.tbz > avahi-0.6.10.tbz <--- > avahi-0.6.10_1.tbz <--- > avahi-0.6.10_3.tbz <--- > avahi-0.6.9_5.tbz <--- > ----- > > So my question is: > Is there a way to automatically remove the old packages as existing > packages get upgraded? Or is there some more appropriate means for > generating packages (and keeping them up to date) that I could transfer > to a fresh install (or even another machine for that matter)? > > My mk_pkgs.sh. Comments are appreciated. > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > #!/bin/sh > > # This will create a binary package for all ports installed on a machine. > # It will place the packages in /usr/ports/packages/All > > db_pkg_dir=3D/var/db/pkg > > pkg_dir=3D/usr/ports/packages/All > mkdir -p $pkg_dir > > cd $db_pkg_dir > for dname in * > do > > if [ "$dname" !=3D "pkgdb.db" ] > then > > pkg_create -v -b $dname $pkg_dir/$dname.tbz > > fi > > done > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > Thanks for your help. Look at man portsclean. Beech =2D-=20 =2D------------------------------------------------------------------------= =2D------------- Beech Rintoul - Sys. Administrator - beech@alaskaparadise.com /"\ ASCII Ribbon Campaign | Alaska Paradise \ / - NO HTML/RTF in e-mail | 201 East 9Th Avenue Ste.310 X - NO Word docs in e-mail | Anchorage, AK 99501 / \ - Please visit Alaska Paradise - http://www.alaskaparadise.com =2D------------------------------------------------------------------------= =2D------------- --nextPart2037083.aDVZ48N0R6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQBEb4rVp5D0B1NlT4URAu6yAJwJNRZbADmLeNwrELba5/zEozeiJQCeORJV IqiaI1aT3B80j9Azns4seCc= =ynPz -----END PGP SIGNATURE----- --nextPart2037083.aDVZ48N0R6--