From owner-freebsd-ports Wed Apr 26 10:04:11 1995 Return-Path: ports-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id KAA17042 for ports-outgoing; Wed, 26 Apr 1995 10:04:11 -0700 Received: from time.cdrom.com (time.cdrom.com [192.216.223.46]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id KAA17036 for ; Wed, 26 Apr 1995 10:04:09 -0700 Received: from localhost (localhost [127.0.0.1]) by time.cdrom.com (8.6.11/8.6.9) with SMTP id KAA11305 for ; Wed, 26 Apr 1995 10:03:51 -0700 X-Authentication-Warning: time.cdrom.com: Host localhost didn't use HELO protocol To: ports@FreeBSD.org Subject: pkg_{add,info} and URLs Date: Wed, 26 Apr 1995 10:03:51 -0700 Message-ID: <11303.798915831@time.cdrom.com> From: "Jordan K. Hubbard" Sender: ports-owner@FreeBSD.org Precedence: bulk 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