Much ado about scripting, Linux & Eclipse: card subject to change

2006-08-26

Beyond CVS for Linux

Solved a long-standing annoyance this week - using the BeyondCVS Eclipse plugin on Linux.

One day, if I have time I'll try to turn this into a fragment so that it'll work without outside effort, but for now, here's the HOWTO:

0. Install WINE using yum, apt-get, etc. as appropriate for your linux distro. (Chances are this is already installed.)

1. Install beyond compare, from Scooter Software. I installed it using wine into /opt/beyondcompare2:

 $ wine beycomp.exe 
2. Create a script (eg., ~/bc2.sh) to handle passing commandline args. Your script might require a different drive letter prefix, depending on your wine install - I've had to use both s: and z:. chmod your script so it's executable (chmod +x ~/bc2.sh).
#!/bin/sh

# collect commandline params and turn them into wine-friendly paths
opts="";
while [ "$#" -gt 0 ]; do
  opts=$opts" s:"$1; shift 1;
done

/usr/bin/wine /opt/beyondcompare2/BC2.exe $opts
3. Test your script by running it in a console window.
$ ~/bc2.sh

4. Install BeyondCVS plugin and feature into your Eclipse 3.2+ install (or using a .link file).

5. Start Eclipse. Open up Help > Window > Preferences... > External Tools Launcher > Beyond Compare. In the field Path To Beyond Compare, enter the path to your shell script, eg., /home/nickb/bc2.sh. Leave the Show Debugging Info? checkbox enabled.

6. Select two files or folders in your Package Explorer or Navigator. Beyond Compare should launch under WINE. If it doesn't, open a console and run your bc2.sh script, passing the same two parameters shown in the debug info popup in Eclipse. As noted above, you might have to change the drive letter from s: to z: or something else so that WINE can find the files you passed it. If all worked, you can remove the Show Debugging Info? checkbox in the Preferences panel.

Happy comparing!

0 comments: