Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.96k stars 11.34k forks source link

--force should force symlink creation too #33

Closed robhudson closed 14 years ago

robhudson commented 15 years ago

Here's some output of a git build after pulling own that tree:

[snip]
cp private-Error.pm blib/lib/Error.pm
cp Git.pm blib/lib/Git.pm
Manifying blib/man3/private-Error.3pm
Manifying blib/man3/Git.3pm
    SUBDIR templates
install -d -m 755 '/usr/local/Cellar/git/1.6.4.2/bin'
install -d -m 755 '/usr/local/Cellar/git/1.6.4.2/libexec/git-core'
install   git-fast-import git-hash-object git-index-pack git-merge-index git-merge-tree git-mktag git-pack-redundant git-patch-id git-shell git-show-index git-unpack-file git-update-server-info git-upload-pack git-var git-http-push git-daemon git-imap-send git-am git-bisect git-difftool--helper git-filter-branch git-lost-found git-merge-octopus git-merge-one-file git-merge-resolve git-mergetool git-mergetool--lib git-parse-remote git-pull git-quiltimport git-rebase--interactive git-rebase git-repack git-request-pull git-sh-setup git-stash git-submodule git-web--browse git-add--interactive git-difftool git-archimport git-cvsexportcommit git-cvsimport git-cvsserver git-relink git-send-email git-svn git-instaweb '/usr/local/Cellar/git/1.6.4.2/libexec/git-core'
install git git-upload-pack git-receive-pack git-upload-archive git-shell git-cvsserver '/usr/local/Cellar/git/1.6.4.2/bin'
make -C templates DESTDIR='' install
install -d -m 755 '/usr/local/Cellar/git/1.6.4.2/share/git-core/templates'
(cd blt && tar cf - .) | \
    (cd '/usr/local/Cellar/git/1.6.4.2/share/git-core/templates' && umask 022 && tar xfo -)
make -C perl prefix='/usr/local/Cellar/git/1.6.4.2' DESTDIR='' install
Appending installation info to /usr/local/Cellar/git/1.6.4.2/Library/Perl/Updates/5.10.0/darwin-thread-multi-2level/perllocal.pod
Can't open file /usr/local/Cellar/git/1.6.4.2/lib/perl5/site_perl/5.10.0/darwin-thread-multi-2level/auto/Git/.packlist: Permission denied at /System/Library/Perl/5.10.0/ExtUtils/Install.pm line 691
Writing /usr/local/Cellar/git/1.6.4.2/lib/perl5/site_perl/5.10.0/darwin-thread-multi-2level/auto/Git/.packlist
make[2]: *** [pure_site_install] Error 13
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [install] Error 2
make: *** [install] Error 2
==> Error: make install

Also, now that git is broken, I'm not sure of the best way to "git pull" down a fix. :)

robhudson commented 15 years ago

It probably helps to know the steps I did leading up to this...

Yesterday (I believe) I installed Git as I saw some updates to both brewkit and git. Today I saw more updates so I did: git pull, then brew install -f git.

I tried running it again and got a new error:

/usr/local [git:masterbrew] > brew install -f git ==> Downloading http://kernel.org/pub/software/scm/git/git-1.6.4.2.tar.bz2 File already downloaded and cached ==> ./configure --prefix=/usr/local/Cellar/git/1.6.4.2 ==> make install ==> Downloading http://kernel.org/pub/software/scm/git/git-manpages-1.6.4.2.tar.bz2 File already downloaded and cached ==> Finishing up ln: ./5.10.0: Operation not permitted ==> Error: Could not create symlink /usr/local/lib/perl5/site_perl/5.10.0

mxcl commented 15 years ago

Ahh yes this was prolly due to another fix on the site_perl dir. Try brew rm git first. As the force parameter just forces the install, but won't force eg. symlink creation.

Maybe it should though? What do you think?

robhudson commented 15 years ago

I removed the pre-existing symlink that was at lib/perl5/site_perl and the install worked.

I think I also misunderstood the brew install -f git command as something that would update git. The wiki states that an upgrade command doesn't exist yet and it is best to brew rm and brew install. Apologies.

robhudson commented 15 years ago

If brew install -f package could be treated like an upgrade, including symlink creation, I think it would be nice. I have mysql installed, for example, and by default the data tables went in /usr/local/Cellar/mysql/5.1.37/var, so brew rm mysql would also remove the data tables.

I just realized while typing that, though, that this is very not optimal as now my data tables depend on which mysql version is installed. Hmm. I should move those to an appropriate place on my filesystem.

mxcl commented 15 years ago

yeah we plan to move the var into Cellar/mysql by default. But I would like more feedback on this as I am not a db user in general so don't know what is best.

mxcl commented 15 years ago

I'll leave this open for now because there is a bug in there, but I can't decide which one is the bug and which the feature currently. Time will tell.

adamv commented 14 years ago

I think there may be at least one issue still being described in this thread, but it has drifted away from the bug title.

Might be worth extracting any work items into new bugs and closing this one?

mxcl commented 14 years ago

force should force symlink creation as per title.

adamv commented 14 years ago

Just tried brewing something where the targets in bin were already symlinks; "brew install -f" blew away the existing symlinks and created them correctly.