From owner-freebsd-ports Thu Oct 12 12: 0:26 2000 Delivered-To: freebsd-ports@freebsd.org Received: from blues.jpj.net (blues.jpj.net [204.97.17.146]) by hub.freebsd.org (Postfix) with ESMTP id AAA1437B503 for ; Thu, 12 Oct 2000 12:00:22 -0700 (PDT) Received: from localhost (trevor@localhost) by blues.jpj.net (right/backatcha) with ESMTP id e9CIv5q23318; Thu, 12 Oct 2000 14:57:05 -0400 (EDT) Date: Thu, 12 Oct 2000 14:57:05 -0400 (EDT) From: Trevor Johnson To: Johann Visagie Cc: James Housley , Carlos A M dos Santos , FreeBSD ports mailing list Subject: Re: Script to genarate PLIST? In-Reply-To: <20001012120017.A97048@fling.sanbi.ac.za> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Johann Visagie wrote: > James Housley on 2000-10-11 (Wed) at 09:58:24 -0400: > > > > The porters handbook show how to do this. > > > > http://www.freebsd.org/porters-handbook/porting-autoplist.html > > > > However it could use some improvements. > > Specifically, I'd pipe the find command that adds the files to $PLIST through > sort(1) first (cuts down the size of future diff files), Yes. I hadn't noticed that was missing from the Handbook. > and the output of > the find that adds the directories to $PLIST through "sort -r" (pretty much > ensures the directories are removed in a sane order when deinstalling). Instead of sort -r, using the -d option will also work. The example in the Handbook fails on uninstallation when there is more than one level of directories. The output of find -d is sorted in alphabetical order. So long as you stick with one or the other, your updates won't cause bloat. I'd like to correct this part of the Handbook--does anyone have objections to me mentioning both methods? > Hmm, and add something to remove man pages from $PLIST, I suppose. :-) Let > me see what I can do... A pass through "grep -vw man" should give a close approximation. Then you'll want to generate the MAN lines. Here's what I've come up with (contains tabs and a long line): #!/bin/sh echo -n ""; for i in l n 1 2 3 4 5 6 7 8 9; do echo -n MAN$i; echo -n "= "; for j in `find /usr/local/man/*$i /usr/local/lib/perl*/*/man/*$i /usr/X11R6/man/*$i -mtime 1 -type f`; do echo -n `basename $j | cut -f1 -d\. `; echo " \\" echo -n " "; done echo done Maxim Sobolev mentioned some options for find that look like they'll match more recent files. The output of my script looks something like: MANl= MANn= append \ array \ bgerror \ binary \ break \ case \ [...] menubar \ palette \ scrollbar \ packagens \ chooseDirectory \ MAN1= tclsh \ wish \ MAN2= MAN3= Alloc \ Async \ Concat \ AllowExc \ [...] GetHINSTANCE \ HWNDToWindow \ AddOption \ MAN4= MAN5= MAN6= MAN7= MAN8= MAN9= -- Trevor Johnson http://jpj.net/~trevor/gpgkey.txt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message