From owner-freebsd-bugs Thu Jul 20 9:10:12 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id CE4FD37C0AB for ; Thu, 20 Jul 2000 09:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id JAA65156; Thu, 20 Jul 2000 09:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from smtp13.bellglobal.com (smtp13.bellglobal.com [204.101.251.52]) by hub.freebsd.org (Postfix) with ESMTP id 4266E37B5CF for ; Thu, 20 Jul 2000 09:03:30 -0700 (PDT) (envelope-from abeaupre@chemcomp.com) Received: from hermes.chemcomp.com (ppp12498.qc.bellglobal.com [206.172.133.11]) by smtp13.bellglobal.com (8.8.5/8.8.5) with ESMTP id MAA18096 for ; Thu, 20 Jul 2000 12:07:40 -0400 (EDT) Received: from sky.chemcomp.com (sky.chemcomp.com [192.1.1.62]) by hermes.chemcomp.com (Postfix) with ESMTP id 96B3C16817 for ; Thu, 20 Jul 2000 12:03:17 -0400 (EDT) Received: by sky.chemcomp.com (Postfix, from userid 1111) id C0AF3A7; Thu, 20 Jul 2000 12:02:48 -0400 (EDT) Message-Id: <20000720160248.C0AF3A7@sky.chemcomp.com> Date: Thu, 20 Jul 2000 12:02:48 -0400 (EDT) From: abeaupre@chemcomp.com Reply-To: abeaupre@chemcomp.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/20062: New (?) package management utilities Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 20062 >Category: bin >Synopsis: New (?) package management utilities >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jul 20 09:10:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Antoine Beaupre >Release: FreeBSD 4.0-RELEASE i386 >Organization: Chemical Computing Group, Inc. >Environment: FreeBSD sky.chemcomp.com 4.0-RELEASE FreeBSD 4.0-RELEASE #7: Tue Jun 27 16:42:57 EDT 2000 root@sky.chemcomp.com:/usr/src/sys/compile/SKY i386 >Description: I have "coded" a few shell scripts to help me in the titanic task of managing packages under FreeBSD, and I think there would be place in the base system for this. These are basic shell scripts that make a heavy use of grep and ls and that are much faster than pkg_info(1) and that (you guessed it!) support regular expressions (yay!). Description of utilities: pkg_find [regexp] [displays names of matching packages] pkg_findBin [regexp] [displays names of packages which +CONTENTS file matches regexp] pkg_desc [regexp] [gives +DESC files of matching packages, uses pkg_find] pkg_plist [regexp] [idem with +CONTENTS file] One could add one called pkg_comment or something like that to give the short description of the package and/or merge the last 2 together since the code is the same. Only the displayed file is different. >How-To-Repeat: $ pkg_find em movemail-1.0 xemacs-mule-21.1.9 xemacs-mule-common-21.1.9 xemacs-mule-packages-1.1 xemacs-packages-1.1 $ pkg_findBin '\(apache\)\|\(xemacs\)' File found in: apache-1.3.12 xemacs-mule-21.1.9 xemacs-mule-common-21.1.9 xemacs-mule-packages-1.1 xemacs-packages-1.1 $ pkg_desc xemacs ... You get the picture.. >Fix: Source code (!): pkg_find (that's a hard one... :) ---- Cut Here ---- #! /bin/sh ls /var/db/pkg | grep $@ ---- Cut Here ---- pkg_findBin: ---- Cut Here ---- #! /bin/sh pkgDir="/var/db/pkg" echo "Matching packages:" for package in `ls $pkgDir` { grep -q $@ $pkgDir/$package/+CONTENTS && \ echo $package } ---- Cut Here ---- pkg_desc: ---- Cut Here ---- #! /bin/sh hits=`pkg_find $@` if [ ! -z "$hits" ] then echo "Matches:" echo echo $hits echo echo "To display package(s) description, press ENTER. Ctrl-C to cancel." read botch for hit in $hits do $PAGER /var/db/pkg/$hit/+DESC read -p "Press ENTER to continue" done else echo No match. fi ---- Cut Here ---- pkg_plist (could probably be merged with pkg_desc): ---- Cut Here ---- #! /bin/sh hits=`pkg_find $@` if [ ! -z "$hits" ] then echo "Matches:" echo echo $hits echo echo "To display package(s) description, press ENTER. Ctrl-C to cancel." read botch for hit in $hits do $PAGER /var/db/pkg/$hit/+CONTENTS read -p "Press ENTER to continue: " botch done else echo No match. fi ---- Cut Here ---- TODO: - Compatibility with pkg_info commandline and environnement. - Full pkg_info replacement?? - Merge pkg_desc pkg_plist and potential pkg_comment together >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message