Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jul 2004 10:59:36 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        Travis Poppe <tlp@LiquidX.org>
Subject:   Re: Our package system: "Fundamentally Flawed" - A Linux User.
Message-ID:  <20040719095936.GA21175@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <20040719070953.GA69143@xor.obsecurity.org>
References:  <20040719002221.21b6b9a3@maya.liquidx.org> <20040719070953.GA69143@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040719095936.GA21175>