Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Oct 2000 14:57:05 -0400 (EDT)
From:      Trevor Johnson <trevor@jpj.net>
To:        Johann Visagie <wjv@cityip.co.za>
Cc:        James Housley <jim@thehousleys.net>, Carlos A M dos Santos <casantos@cpmet.ufpel.tche.br>, FreeBSD ports mailing list <freebsd-ports@FreeBSD.ORG>
Subject:   Re: Script to genarate PLIST?
Message-ID:  <Pine.BSI.4.21.0010121325390.19642-100000@blues.jpj.net>
In-Reply-To: <20001012120017.A97048@fling.sanbi.ac.za>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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