On Fri, 2003-11-28 at 02:42, David Neary wrote:
> Hi Joao,
> 
> Joao S. O. Bueno wrote:
> > But, right now, I want to update it. So, let?s go by steps:
> > I go
> >  cvs -z3 update
> 
> You should use cvs up -dP - this will create directories present
> in the repository, but not locally, and prune (remove)
> directories which have been emptied via file removals. There are
> reasonable defaults, and should probably go in your .cvsrc, along
> with diff -u.
> 
> That alone will fix some of your problems.
> 
> > I go
> >  make distclean
> 
> If you really want to clean out everything, then maintainer-clean
> is perhaps better. After doing this, you will need to re-run
> autogen.sh. Among other things, this rebuilds Makefile.ins from
> Makefile.ams, which is probably the point at which the changed
> filenames are causing a problem for you.

If you are going to run 'make distclean' or 'make maintainer-clean' you
should do it *before* the CVS update. Otherwise files in the make
processes' run might have been removes, Makefile.am files could have
been changed (leading to changed Makefiles) and so the right files will
not be cleaned and so on and so on. Your current method arbitrarily
changes a bunch of code and then hopes that the old Makefile will still
be relevant. Not always a good assumption.

Also, the attached file may prove useful if your tree is a little
confused. Run 'python super-clean.py .' inside the gimp directory. It
will remove all files that are not known to CVS from your local copy
(without running out on the network -- it just looks at the local CVS
control files). You can run this, then 'cvs update' to get any new files
and be assured that you have a pristine CVS copy.

Malcolm
#!/usr/bin/env python
"""
Copyright 2003 Malcolm Tredinnick <[EMAIL PROTECTED]>

Remove files from a CVS checkout that are not known to CVS. This is all done by
looking at the local CVS/ directory, not by checking with the CVS repository.
Useful for saving space or starting a build from a completely clean CVS tree
(no symlinks to libtool.sh or anything like that).

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Library General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.
"""
import sys, os, stat

def main(argv = None):
	if len(argv) != 1:
		print >> sys.stderr, "Calling format: super-clean.py <start-dir>"
		sys.exit(1)
	removals = []
	os.path.walk(argv[0], cleaner, removals)
	remove(removals)

def cleaner(removals, dirname, names):
	"""
	Record the name of any file not in the appropriate CVS/Entries file. The
	'names' list is adjusted appropriately so that any directories scheduled
	for removal are not recursed into.
	"""
	if 'CVS' not in names:
		print >> sys.stderr, "Bad directory %r" % dirname
		sys.exit(1)
	files = open('%s/CVS/Entries' % dirname).readlines()
	# Don't descend into the CVS directory, but we don't want to remove it
	# either.
	names.remove('CVS')
	keepers = [line.split('/')[1] for line in files if line != "D\n"]
	for file in names[:]:
		if file not in keepers:
			removals.append(os.path.join(dirname, file))
			names.remove(file)

def remove(removals):
	"""
	Remove all of the files in the 'removals' list.
	"""
	for file in removals:
		if stat.S_ISDIR(os.lstat(file)[0]):
			os.system('rm -rf %s' % file)
		else:
			os.remove(file)

if __name__ == '__main__':
	main(sys.argv[1:])
_______________________________________________
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user

Reply via email to