cameronbracken / pgfSweave

Quality graphics and speedy compilation with Sweave
http://r-forge.r-project.org/projects/pgfsweave/
29 stars 6 forks source link

Clean up old cache directories #27

Open yihui opened 13 years ago

yihui commented 13 years ago

I think I can understand the situation now. The only thing that makes me uncomfortable is the creation of new cache directories without removing the old ones, thus each time I change a code chunk, I get a new directory created.

This is not a really big issue, though. I can live with it.

cameronbracken commented 13 years ago

I agree, that is somewhat unfortunate, but I think the benefits outweigh the negatives. It still respects the cache dir so you wont have directories cluttering up the main folder. Maybe I should set a default for the cache dir to not be ., perhaps pgfSweaveCache?

yihui commented 13 years ago

or maybe remove the dir's with the same prefix and only keep the most recent one? (do this in the function pgfSweave())

cameronbracken commented 13 years ago

That is actually a good suggestion, the only reason to keep the extras around is if the code is changed back to an exact older state, which I think is quite unlikely.

This could be done in pgfSweave after the code has been run but I wonder if it might not be easier to do it in the driver. At that level we would have the names of the code chunks and their checksums to do an easy clobber of all the old cache directories.

cameronbracken commented 13 years ago

I'm changing the name of the issue if you dont mind. from

external=TRUE --> cache=TRUE

to

Clean up old cache directories

yihui commented 13 years ago

I don't mind at all. I just jumped from the email to github and did not consider a meaningful title.