From owner-freebsd-ports Sat Sep 18 15:22:37 1999 Delivered-To: freebsd-ports@freebsd.org Received: from scrabble.freeuk.net (scrabble.freeuk.net [212.126.144.6]) by hub.freebsd.org (Postfix) with ESMTP id F1F6E1505C; Sat, 18 Sep 1999 15:22:28 -0700 (PDT) (envelope-from andrew@cream.org) Received: from [212.126.149.5] (helo=cream.org) by scrabble.freeuk.net with esmtp (Exim 2.11 #1) id 11SSsE-00016v-00; Sat, 18 Sep 1999 22:22:26 +0000 Content-Length: 2348 Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <19990915231305.A31588@kilt.nothing-going-on.org> Date: Sat, 18 Sep 1999 23:22:22 +0100 (BST) From: Andrew Boothman To: Nik Clayton Subject: RE: Building a page of installed software docs Cc: ports@freebsd.org, doc@freebsd.org Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 15-Sep-99 Nik Clayton wrote: > Thinking about it, this should probably not be limited to just the HTML > documentation that's installed. There's no reason why bzip2 couldn't > have a pkg/URLS file that looked something like > > ${PREFIX}/share/doc/bzip2/manual_toc.html:HTML:User manual > ${PREFIX}/share/doc/bzip2/manual.ps:PS:User manual > ${PREFIX}/share/doc/bzip2/manual.txt:TXT:User manual > > which would turn in to > >

archivers/bzip2

> > OK. I had a spare few minutes, so I threw together the following script : #!/usr/bin/perl -w # Produces an HTML list of documentation installed by # the FreeBSD ports system. Intended to be run daily # from /var/periodic/daily # By Andrew Boothman opendir 'portsdir', '/var/db/pkg' or die "docindex: Can't open /var/db/pkg"; @allfiles = readdir 'portsdir'; closedir 'portsdir'; print ' Installed FreeBSD Documentation

Installed FreeBSD Documentation


    '; foreach(@allfiles){ if (-e "/var/db/pkg/$_/+DOCS") { open 'DOCS',"/var/db/pkg/$_/+DOCS"; @docs = ; close 'DOCS'; chomp @docs; print "
  • $_
      "; foreach(@docs) { @docinfo = split(/ /); print "
    • $docinfo[0] - [$docinfo[1]]\n"; }; print "
    \n" }; }; print "
"; It goes through the /var/db/pkg directory, looking for the ports that have our new 'DOCS' file, which is in the format of : FAQ txt /usr/local/share/doc/Sharity-Light/FAQ README txt /usr/local/share/doc/Sharity-Light/README I made this file up for Sharity Light as an example. If the port has a docs file, then the script produces a nice set of links to each type of documentation. Nik, is this what you had in mind? Any comments gladly recieved!! --- Andrew Boothman http://sour.cream.org Unmetered Telecoms. Join the Fight! http://www.unmetered.org.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message