Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 2003 11:57:54 -0400
From:      Jason Andresen <jandrese@mitre.org>
To:        Daniel Lang <langd-freebsd-hackers@leo.org>
Cc:        'Kris Kennaway' <kris@obsecurity.org>
Subject:   Re: cvsupd
Message-ID:  <3EC3B902.3070202@mitre.org>
In-Reply-To: <20030515153343.GC71411@atrbg11.informatik.tu-muenchen.de>
References:  <20030515152046.GB71411@atrbg11.informatik.tu-muenchen.de> <004a01c31af6$3c24fd80$0200a8c0@mainframe> <20030515153343.GC71411@atrbg11.informatik.tu-muenchen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Daniel Lang wrote:

> Sure. CVSup does not delete files, it doesn't know about.
> Certainly it doesn't know anything about fart and therefore
> won't touch it. This is intended behaviour of CVSup.
> (Think about the "make readmes" nightmare, that several
>  users, including me stubled across. The README.html files
>  never get deleted and so you are stuck with dozens of
>  virtually empty and outdated port directories).

Nightmare?  I always thought of it more as a nusance.

Can't you run something like (note, I write in zsh, convert to whatever 
language you like):

cd /usr/ports
for foo ( * )
do
	if [[ -d $foo ]]
	then
		cd $foo
		for bar ( * )
		do
			if [[ -d $bar ]]
			then
				rm $bar/README.html
				rmdir $bar
			fi
		done
		cd ..
	fi
done
make readmes

You'll have to ignore a huge number of warnings about being unable to 
rmdir directories with files in them, but it seems pretty simple and 
shouldn't take too long to run on most machines.

You could also probably make this a little safer by running some checks 
to make sure you don't cd into directories you don't have permission to, 
but that's left as an exercise for the reader.

-- 
   \  |_ _|__ __|_ \ __| Jason Andresen        jandrese@mitre.org
  |\/ |  |    |    / _|  Network and Distributed Systems Engineer
_|  _|___|  _| _|_\___| Office: 703-883-7755




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3EC3B902.3070202>