LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Questions about building git to install in non-standard directory (http://www.linuxquestions.org/questions/slackware-14/questions-about-building-git-to-install-in-non-standard-directory-4175498228/)

coldbeer 03-14-2014 05:00 PM

Questions about building git to install in non-standard directory
 
I'm new to doing this sort of thing.

I am working on a project where I will need to have multiple versions of git installed. I'm on Slackware 14.1 with the defacto git 1.8.4 installed by the slackware install dvd.

I have downloaded git 1.9.0 and have built the config file and compiled with a prefix:

make configure
./configure --prefix=/opt/git1_9_0
make all
sudo make install

Then I changed my $PATH in .bashrc to:

PATH=/opt/git1_9_0/bin:$PATH

Git seems to work but how do I know /opt/git1_9_0/bin/git is using the directories in the /opt/git1_9_0 directories and not the ones from the standard install?

/opt/git1_9_0/
|-- bin
| |-- git
| |-- git-cvsserver
| |-- git-receive-pack
| |-- git-shell
| |-- git-upload-archive
| |-- git-upload-pack
| `-- gitk
|-- lib64
| `-- perl5
|-- libexec
| `-- git-core
`-- share
|-- git-core
|-- git-gui
|-- gitk
|-- gitweb
|-- locale
|-- man
`-- perl5

Should I be including the /opt/git1_9_0/libexec & share in the path or does git know where these are from relative paths set by the configuration? Is there a way to be certain?

Thanks.

55020 03-15-2014 03:45 AM

Quote:

Originally Posted by coldbeer (Post 5134735)
I am working on a project where I will need to have multiple versions of git installed.

This is almost always a bad strategy; I hope you know that already. The proprietary software world is full of Java products that demand a very specific JRE with very specific bugs that the vendor can't get their poor heads around fixing, so they just dump complexity on their customers instead. Don't be like that if you can avoid it. If an incompatible change in git-1.9 is holding you back, it will have to be tackled sooner or later, and sooner is better, because it will save you work implementing workrounds like this.

Having said that, the setup that you describe should just about work. The biggest issue I see with your current setup is that, unless you set MANPATH, you are getting the wrong versions of the manpages. If the exact version of git is so important to you, then getting the right documentation is a big deal.

Other stuff is also worryingly shared or sidelined, like the hooks and perl stuff. See below for a suggestion of how to deal with this.

Quote:

Originally Posted by coldbeer (Post 5134735)
Should I be including the /opt/git1_9_0/libexec & share in the path or does git know where these are from relative paths set by the configuration? Is there a way to be certain?

You have plenty of options.
  • Delete /opt/git1_9_0/libexec, observe whether git-1.9 stops working, and then reinstall git 1.9.0. (This is why you should be making a proper package, not just doing 'make install')
  • Uninstall git-1.8.4 and observe whether git-1.9 continues to work, then reinstall git-1.8.4
  • Inspect the binaries with 'strings'. If you look carefully, you will see that the only occurrence of 'libexec' is in a single string, 'libexec/git-core'. This path fragment has no hardcoded prefix, or suffix, which suggests strongly that it works out the right prefix as required.
  • The string 'libexec/git-core' also suggests a good way of grepping the place in the source code where you will be able to see exactly what it does and how it does it

*But* it would probably be much better to uninstall Slackware's git-1.8.4, and build your own 1.8.4 to install under /opt/git1_8_4, so that you have both /opt/git1_9_0 and /opt/git1_8_4. Then only the nondefault paths exist in each version. Thus there would be nothing shared and no possibility of cross-contamination.

[Why the mangled name, anyway? Call it /opt/git-1.9.0 ;)]


All times are GMT -5. The time now is 05:15 PM.