Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Apr 1995 10:03:51 -0700
From:      "Jordan K. Hubbard" <jkh@time.cdrom.com>
To:        ports@FreeBSD.org
Subject:   pkg_{add,info} and URLs
Message-ID:  <11303.798915831@time.cdrom.com>

next in thread | raw e-mail | index | archive | help
In case you don't read cvs-all, I've just enhanced the package tools
to accept URLs for package names.  There is method to my madness.

My rationale, in no particular order:

1. I wanted a small-scale test application of libftp. :-)
2. It's handy from scripts.
3. This lets you put together "meta packages" very easily.  Imagine,
   for example, a "package" with a packing list like this:

	@name network-fun-pack
	@exec pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/packages/net/pkg1.tgz
	@unexec pkg_delete pkg1_name
	@exec pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/packages/net/pkg2.tgz
	@unexec pkg_delete pkg2_name
	@exec pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/packages/net/pkg3.tgz
	@unexec pkg_delete pkg3_name
	@exec pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/packages/net/pkg4.tgz
	@unexec pkg_delete pkg4_name

   (Where pkg1..4 would be names like lynx4.01, chimera-2.1, etc..)

   Then you point to THIS package from some dialog menu that shows you
   4 or 5 "fun packs" of various types, the action for each of which is
   to pkg_add one of these skeletal packages.

   You could also do it in such a way that you used absolute paths at one
   level of the script which would call your own pkg_add function.  Then
   you could write your script something like this:

#!/bin/sh

package-add()
{
        PFILE=/usr/ports/packages/$1
        if [ ! -f ${PFILE} ]; then
                PFILE=ftp://ftp.freebsd.org/pub/FreeBSD/packages/$1
        fi
        dialog --prgbox "pkg_add -v ${PFILE}" 20 72
}

dialog --title "Pick a package" --menu "Each of the packages on this menu are \
\`super packages\', each\n\
containing multiple packages of its own.  If the various\n\
sub-packages cannot be found on this machine, they will be\n\
retrieved automatically over the Internet." -1 -1 4 \
"network-pack" "Various nice utilities to have around the Internet" \
"games-pack" "Numerous games packages to while away the hours" \
"admin-pack" "An administrator's grab-bag of helpful utilities." \
"x11-pack" "Our pick of some of the best contributed X software." 2> /tmp/tmp.$$
        RETVAL=$?
        ANSWER=`cat /tmp/tmp.$$`
        rm -f /tmp/tmp.$$
        if [ ${RETVAL} -ne 0 ]; then exit 1; fi
        package-add metapack/${ANSWER}.tgz


Allowing you to DTRT in the largest number of reasonable scenarios.
The "meta packages" would describe themselves just as thoroughly 
as any other package, and would truly be indistinguishable to
the end-user.

Just an idea.. :-)

					Jordan



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