From owner-freebsd-ports Thu Apr 27 12: 6:27 2000 Delivered-To: freebsd-ports@freebsd.org Received: from ipt2.iptelecom.net.ua (ipt2.iptelecom.net.ua [212.9.224.2]) by hub.freebsd.org (Postfix) with ESMTP id 61C8037B549 for ; Thu, 27 Apr 2000 12:06:21 -0700 (PDT) (envelope-from sobomax@altavista.net) Received: from vega.vega.com (dialup8-15.iptelecom.net.ua [212.9.227.207]) by ipt2.iptelecom.net.ua (8.9.3/8.9.3) with ESMTP id WAA24837; Thu, 27 Apr 2000 22:14:01 +0300 (EEST) Received: from altavista.net (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.9.3/8.9.3) with ESMTP id WAA21511; Thu, 27 Apr 2000 22:05:44 +0300 (EEST) (envelope-from sobomax@altavista.net) Message-ID: <39088F88.50085B4D@altavista.net> Date: Thu, 27 Apr 2000 22:05:44 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.72 [en] (WinNT; I) X-Accept-Language: uk,ru,en MIME-Version: 1.0 To: Neil Blakey-Milner Cc: Will Andrews , Michael Haro , ports@FreeBSD.ORG Subject: Re: port helper scripts directory References: <20000426170301.A24093@area51.fremont.ca.us> <3907F075.1D6865E8@altavista.net> <20000427075903.A39186@area51.fremont.ca.us> <20000427111810.A369@argon.blackdawn.com> <20000427193908.A27000@mithrandr.moria.org> <3908820E.3DCC85B1@altavista.net> <20000427201115.C27000@mithrandr.moria.org> Content-Type: multipart/mixed; boundary="------------EECB7B06004BD3041824304A" Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multi-part message in MIME format. --------------EECB7B06004BD3041824304A Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Neil Blakey-Milner wrote: > On Thu 2000-04-27 (21:08), Maxim Sobolev wrote: > > > I wrote a similar thing, inspired by Maxim, but in perl, which is a bit > > > more flexible and efficient. It's at > > > http://rucus.ru.ac.za/~nbm/old/distclean.pl > > > > The only thing I'm really missing in your version is ability to interactively > > select which distfiles to delete (IMHO rather useful feature for porters, > > because I usually have several unassociated distfiles from ports still waiting > > for their destiny in GNATS or in my own queue). However, it could be easily > > added. > > Yeah. I generally run the script with '-d' and it doesn't delete the > files, just says them to stdout. I pipe that to a file, and look > through there myself. I'll be happy to add interactive choice, though. I look forward to see it implemented/commited. Speaking about various cleaning scripts I have two other ideas on various stages of implementation: 1. wordclean. This script intended to clean mandatory pieces of base system resulting from removing/renaming/moving in /usr/src. This problem is known to all people actively tracking -current or doing system upgrade via cvsup/makeworld. The idea is simple: - do "make buildworld installworld" as usually; - do "make DESTDIR=[....] installworld" into some temporary directory (/tmp/world in my case); - list files in each dir in /tmp/world, compare it with the listing in the appropriate "real" directory and report differences I've actually wrote small script in Python doing this procedure and use it regularly. I'm attaching it with this message. 2. . The script to report stale files in ${LOCALBASE} and ${X11BASE} usually resulting from incomplete PLISTs. Following is main idea: - parse +CONTENT files in /var/db/pkg and build list of files which are "allowed" to be in ${LOCALBASE} and ${X11BASE} - list actual files in above mentioned directories, compare list with one obtained on previous step and report differences (optionally comparing md5 checksums). This is still in the "idea" stage, but if someone could implement it please be my guest ;). -Maxim --------------EECB7B06004BD3041824304A Content-Type: text/plain; charset=koi8-r; name="worldclean.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="worldclean.py" #!/usr/local/bin/python import os.path TMPDIR = '/tmp/world' SRCDIR = '/usr/src' UNTOUCHABLES = ('/', '/boo', '/var', '/etc', '/roo', '/tmp', '/dev', '/pro', '/mnt') def tmplister(arg, dirname, names): rootname = os.path.join('/',dirname[len(TMPDIR)+1:]) if rootname[:4] in UNTOUCHABLES: return 0 tmpnames=[] for i in names: if os.path.isfile(os.path.join(dirname, i)): tmpnames.append(i) for name in os.listdir(rootname): if os.path.isfile(os.path.join(rootname, name)): try: tmpnames.index(name) except ValueError: print "rm -i ", os.path.join(rootname, name) try: os.path.walk(TMPDIR,tmplister,0) except: exit --------------EECB7B06004BD3041824304A-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message