Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2000 22:05:44 +0300
From:      Maxim Sobolev <sobomax@altavista.net>
To:        Neil Blakey-Milner <nbm@mithrandr.moria.org>
Cc:        Will Andrews <andrews@technologist.com>, Michael Haro <mharo@area51.fremont.ca.us>, ports@FreeBSD.ORG
Subject:   Re: port helper scripts directory
Message-ID:  <39088F88.50085B4D@altavista.net>
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>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39088F88.50085B4D>