From owner-freebsd-doc Sun Sep 19 13:45:48 1999 Delivered-To: freebsd-doc@freebsd.org Received: from scrabble.freeuk.net (scrabble.freeuk.net [212.126.144.6]) by hub.freebsd.org (Postfix) with ESMTP id BC0E2156AA; Sun, 19 Sep 1999 13:45:34 -0700 (PDT) (envelope-from andrew@cream.org) Received: from [212.126.149.143] (helo=cream.org) by scrabble.freeuk.net with esmtp (Exim 2.11 #1) id 11Snq0-0001fw-00; Sun, 19 Sep 1999 20:45:32 +0000 Content-Length: 2181 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: Date: Sun, 19 Sep 1999 21:45:29 +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-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 18-Sep-99 Andrew Boothman wrote: > 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. I've changed the seperator for the file to a colon. Many thanks to Slaven Rezic for pointing out that it's just possible that there might be some whitespace in the title of a document! :-) Plus, I've taken out the dash that went in after the name of the port, because it looked a bit stupid. :-) Script is now : #!/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 "
"; (Watch out for weird wrapping of lines by your e-mail client. There should only be a newline where is a semicolon) And example file for Sharity Light is : FAQ:txt:/usr/local/share/doc/Sharity-Light/FAQ README:txt:/usr/local/share/doc/Sharity-Light/README Also, speaking for myself, my machine rarely gets to run its' daily script. So, certainly for my own use, it would be better to have the script run from rc. What does everyone think? --- 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-doc" in the body of the message