From owner-freebsd-questions@FreeBSD.ORG Mon Jul 19 09:59:43 2004 Return-Path: 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 6EBEF16A4CE for ; Mon, 19 Jul 2004 09:59:43 +0000 (GMT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00A4343D31 for ; Mon, 19 Jul 2004 09:59:42 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i6J9xaoS022494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Jul 2004 10:59:36 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i6J9xaQl022493; Mon, 19 Jul 2004 10:59:36 +0100 (BST) (envelope-from matthew) Date: Mon, 19 Jul 2004 10:59:36 +0100 From: Matthew Seaman To: Kris Kennaway Message-ID: <20040719095936.GA21175@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Kris Kennaway , Travis Poppe , freebsd-questions@freebsd.org References: <20040719002221.21b6b9a3@maya.liquidx.org> <20040719070953.GA69143@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: <20040719070953.GA69143@xor.obsecurity.org> User-Agent: Mutt/1.5.6i X-Greylist: Message not sent from an IPv4 address, not delayed by milter-greylist-1.5.3 (smtp.infracaninophile.co.uk [0.0.0.0]); Mon, 19 Jul 2004 10:59:36 +0100 (BST) X-Virus-Scanned: clamd / ClamAV version devel-20040705, clamav-milter version 0.74a on smtp.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org cc: Travis Poppe Subject: Re: Our package system: "Fundamentally Flawed" - A Linux User. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2004 09:59:43 -0000 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 19, 2004 at 12:09:53AM -0700, Kris Kennaway wrote: > On Mon, Jul 19, 2004 at 12:22:21AM -0600, Travis Poppe wrote: > For i386 they're updated every week or so, sometimes more frequently. >=20 > > Are these new > > packages that are being rebuilt automatically defaulted to by pkg_add -= r?=20 >=20 > If you're using -STABLE or -CURRENT, yes. -RELEASE gets package sets > produced at the time of release, which means they are unchanging. However packages for 4.10-STABLE should work on a 4.10-RELEASE box. It seems odd to me that there's no way of overriding the logic in 'pkg_add -r' that chooses the subdirectory of the FTP sites to search for packages. Before I go and try and chip some of the rust off my C programming skills, how does this sound: Add another environment variable 'PACKAGECOLLECTION' that pkg_add(1) refers to. This should be set to the name of one of the subdirectories under ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/ (Or whatever architecture is appropriate). Values might be: packages-4-stable packages-5.2.1-release packages-current In fact, wotthehell: takes more time to describe than to do. Here's the patch to usr.sbin/pkg_install/add/main.c: --- main.c.orig Mon Jul 19 10:31:16 2004 +++ main.c Mon Jul 19 10:46:17 2004 @@ -256,13 +256,20 @@ if (strlcat(sitepath, u.machine, sizeof(sitepath)) >=3D sizeof(sitepat= h)) return NULL; =20 - reldate =3D getosreldate(); - for(i =3D 0; releases[i].directory !=3D NULL; i++) { - if (reldate >=3D releases[i].lowver && reldate <=3D releases[i].hiver) { - if (strlcat(sitepath, releases[i].directory, sizeof(sitepath)) - >=3D sizeof(sitepath)) - return NULL; - break; + if (getenv("PACKAGECOLLECTION")) { + if (strlcat(sitepath, "/", sizeof(sitepath)) >=3D sizeof(sitepath) || + strlcat(sitepath, getenv("PACKAGECOLLECTION"), sizeof(sitepath)) + >=3D sizeof(sitepath)) + return NULL; + } else { + reldate =3D getosreldate(); + for(i =3D 0; releases[i].directory !=3D NULL; i++) { + if (reldate >=3D releases[i].lowver && reldate <=3D releases[i].hiver= ) { + if (strlcat(sitepath, releases[i].directory, sizeof(sitepath)) + >=3D sizeof(sitepath)) + return NULL; + break; + } } } =20 On this 4.10-STABLE system that gives this effect: % env PACKAGECOLLECTION=3Dpackages-4.10-release pkg_add -n -v -r cvsup-= without-gui looking up ftp.freebsd.org connecting to ftp.freebsd.org:21 setting passive mode opening data connection initiating transfer Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-4.10-rel= ease/Latest/cvsup-without-gui.tgz...+CONTENTS +COMMENT +DESC +MTREE_DIRS man/man1/cvpasswd.1.gz man/man1/cvsup.1.gz man/man8/cvsupd.8.gz bin/cvpasswd bin/cvsup sbin/cvsupd share/cvsup/License tar command returns 0 status Done. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA+5uIiD657aJF7eIRAszUAJ9lqNFUGRksHQyA9hNup1PvoE4IfwCfWs70 /7QdFr5ZAVaIU+h8jSj8FMA= =CJum -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--