Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 May 2001 23:04:33 +0200
From:      Anton Berezin <tobez@tobez.org>
To:        Dominik Brettnacher <domi@saargate.de>
Cc:        ports@freebsd.org
Subject:   Re: perl script to find orphaned files
Message-ID:  <20010520230433.B75758@heechee.tobez.org>
In-Reply-To: <Pine.BSF.4.21.0105191527020.8899-200000@dominik.saargate.de>; from domi@saargate.de on Sat, May 19, 2001 at 03:29:16PM %2B0200
References:  <Pine.BSF.4.21.0105191527020.8899-200000@dominik.saargate.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 19, 2001 at 03:29:16PM +0200, Dominik Brettnacher wrote:

> I don't know if somebody already wrote something like this, but if
> not, it could be useful e.g. to clean up the /usr/local and /usr/X11R6
> directories or to complete pkg-plist files.

> Feedback is always welcome!

There are already several ways to complete pkg-plist files, as you put
it - one of them is even described in the porters handbook.  I am sure
that many people here have their own trade secrets for doing it.

Otherwise, the idea is useful.  Why don't you make a port out of this
script?  It will require improvements in some areas, of course, like:

1. Use -w.
2. Use use strict.
3. Have a usage screen printed somewhere.
4. Always check the return values of functions that may fail.  In your
   case of piped open(), you even have to check for the return value of
   close().
5. There are much better ways to read the lines after __END__ than
   open(THIS,"<$0"), which you use.  Read about the DATA filehandle in
   the perldata manpage.
6. It is arguably better to use File::Find module instead of invoking
   find(1).

Cheers,
*Anton.
-- 
May the tuna salad be with you.

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?20010520230433.B75758>