You are here: Home Articles Buildout hard reset
Navigation
OpenID Log in

 

Buildout hard reset

by Martin Aspeli last modified Jun 12, 2011 06:22 AM

How to get back to square one with a Plone buildout

If all else fails, reboot. Or, in the base of a buildout, delete any generated files and start again.

The commands below should remove everything and allow you to run a fresh buildout. Run this from the root of the buildout directory, and don't worry if you get a few "file not found" warnings.

$ rm -rf .installed.cfg .mr.developer.cfg parts/ eggs/ develop-eggs/
$ find . -name '*.pyc' -or -name '*.egg-info' | xargs rm -rf
$ bin/buildout -n

Finally, if you are using a shared buildout directory and a previous buildout had network trouble, it's possible that you'll have a partially downloaded .zip or .tar.gz or .egg file that is corrupt and confuses buildout. If so, you can remove the offending file from the dist/ directory in your download cache, e.g.:

$ rm ~/.buildout/downloads/dist/foo.bar.zip

or, if you want to clean up all downloaded source archives:

$ rm ~/.buildout/downloads/dist/*

This should be safe, since any egg that's actually used will have been turned into a .egg file/directory anyway.

Check your ~/.buildout/default.cfg file if you've forgotten where your download cache is located.

Document Actions

Very Usefull

Posted by https://profiles.google.com/christian.ledermann at Jun 13, 2011 02:50 AM
Thanks a lot for this insight, this came at the best possible moment for me ;)

Thanks (and some Find Pedantry)

Posted by https://www.google.com/accounts/o8/id?id=AItOawnZibOGmr482if395yAxvl6PEu-2UUi-Y0 at Jun 17, 2011 11:16 AM
Thanks, that was timely. I was just wondering how to reset my buildout for today's tuneup.

For the portability zealots (like me), I'd like to point out that -o is the POSIX compliant -or for find, and that you can have a more portable, efficient and secure version of the find command above by using -exec +. Here's what I'd probably do:

find . \( -name '*.egg-info' -o -name '*.py[co]' \) -exec rm -rv {} +

…even if you do prefer xargs for some reason, find . \( … \) -print0 | xargs -0 rm -r would be preferable for security reasons (although it is not POSIX).
Plone Book
Professional Plone 4 Development

I am the author of a book called Professional Plone Development. You can read more about it here.

About this site

This Plone site is kindly hosted by: 

Six Feet Up