Cleanup subformulae downloads #17414
Comments
Cleanup isn't aware of subformulae |
@adamv why does running: Show git-htmldocs for the latest version I have installed. I thought scrub does not remove installed versions? |
(But it does remove the htmldocs tarball and not the manpages) |
@jacknagel Correct. Removed htmldocs and left manpages. |
(gps ~)$ ls -la /Library/Caches/Homebrew/ |
Not surprising that this is broken, this is an actual line from cleanup: if (f and f.version > version) or (ARGV.switch? "s" and (f and (not f.installed?))) or old_bottle |
What @adamv says is true though, formula don't maintain references to subformulae, so that this worked at all was a coincidence. |
@jacknagel So cleanup is just supposed to remove 'git' and not the htmldocs or manpages since they are subformulae. It just happens to be doing that as well, correct? Is it ok to manually remove them from /Library/Cache/Homebrew? |
Yeah. Presumably the regexp that matches filenames also matches the subformulae tarballs. You can remove anything in the cache, it's just a cache after all. |
@jacknagel Are there any plans to have cleanup remove subformulae? |
I sketched up a Homebrew2 API that made subformulae explicit in the DSL once |
I'm working on this in #20212. |
(If anyone wants to state what they expect the behavior of |
I think as @jacknagel said "Presumably the regexp that matches filenames also matches the subformulae tarballs." But the Homebrew devs should also weigh in. |
I'm a Homebrew dev...but I never use |
I know, I'm just looking for @samueljohn @MikeMcQuaid to weigh in. I think the main issue I experience as a user is that subformulae tarballs are not removed. So when I do a clean up on git after an upgrade the 'manpages" tar ball does not get removed. I have to manually go in and clear the cache. |
I expect |
Is this expected when a formula isn't installed but has files in the cache? |
The current implementation of "clean up the cache" isn't very good. This is what it does:
This can fail in a lot of ways, mostly because our filename conventions are somewhat inconsistent. Now that we have resources, and all cached files should begin with "name" or "name--resource_name", we should be able to improve this. A few complications remain:
|
Currently it doesn't do any cache cleanup when formula arguments are given. |
For times when HEAD and one or more of stable & devel are all vcs checkouts. Common when a project has submodules that they don't package in a tarball. |
What I was getting at is that we only do it for svn checkouts, in other cases (git, hg, etc) the checkout is shared by stable and head. Maybe it's not as straightforward to do this with svn? |
Ah, OK. My memory of why I set this up gets hazy at this point. |
We don't really use subformulae any more and this is broadly encompassed by Homebrew/brew#568. |
I just updated to the latest version of git:
(gps ~)$ brew info git
git: stable 1.8.1.2, HEAD
http://git-scm.com
/usr/local/Cellar/git/1.8.1.2 (1267 files, 26M) *
https://github.com/mxcl/homebrew/commits/master/Library/Formula/git.rb
==> Options
--with-blk-sha1
Compile with the block-optimized SHA1 implementation
--with-pcre
Compile with the PCRE library
==> Caveats
The OS X keychain credential helper has been installed to:
/usr/local/bin/git-credential-osxkeychain
The 'contrib' directory has been installed to:
/usr/local/share/git-core/contrib
zsh completion has been installed to:
/usr/local/share/zsh/site-functions
and noticed that running brew cleanup did not remove git-manpages-1.8.1.1.tar.gz. It removed the outdated formula and the htmldocs but left manpages. Is there a reason cleanup left it?
The text was updated successfully, but these errors were encountered: