OddThinking

A blog for odd things and odd thoughts.

Installing in Unison

I installed Unison a few days ago. It is a very useful application – it keeps folders on different machines synchronised. I have been using it to edit files locally, and have them hosted by my web-server when I am ready.

It is built on rsync technology, and it minimises the traffic between the two machines. I was very impressed the first time I saw it detect that a new file destined for the web-server was already present in another subdirectory on the same server, and did a local disk-copy rather than transfer files across to the other side of the world.

Mainly, it processes all the files I changed, rather than merely the ones I remember changing, which is reducing my debug time.

Installing it was a trial. I’ve heard people claiming that installing software on Linux is easy now. I’m thinking not so much. The amount of background knowledge that was required to install Unison was immense. I tried, after the fact, to list some of it.

All I needed to understand to install and configure Unison was:

  • How to run make the gnu way.
  • How to run make the almost gnu way.
  • How to run make the old-style (non-gnu) way.
  • The difference between End-Of-Line markers between Windows and Unix.
  • The definition of comments in OCAML make files.
  • How the different between End-Of-Line markers can turn an innocuous comment into Makefile killer.
  • That Unison build needs OCAML’s optional components.
  • What the hell a GTK is. (I never did get the GUI version running.)
  • Impact of spaces in directory names in Bash.
  • How to cut-and-paste in DOS Command Box.
  • How to cut-and-paste in a Cygwin shell.
  • How installs work on Linux.
  • How installs work on Linux when you are not root.
  • How paths work in DOS.
  • How paths work in Linux.
  • Quoting in DOS.
  • Quoting in Bash.
  • Quoting when calling a Bash shell from DOS.
  • How to write a Batch file.
  • How to write a Bash shell command.
  • Which of my three installed ssh implementations to use.
  • That PuTTY’s command-line is plink.
  • That plink is like ssh except takes different parameters.
  • The difference between native and non-native Ocaml executeables.
  • Cygwin’s installation process.
  • Which of Cygwin’s download servers is closest to me.
  • Where the MSVC build of Unison maps the Unix home directory.
  • Where the Cygwin build of Unison maps the Unix home directory.
  • Impact of case-sensitivity of file names when synching.
  • How to create Windows shortcuts.
  • How to uncompress and untar, on Windows and Linux.
  • That IE sometimes confuses .tar.gz files with .tar.tar file.
  • The format of an SSH URI. (Never did work out why my first few attempts failed.)
  • Unison’s elaborate command-line syntax.
  • Unison’s even more elaborate profile file format, and its rules of precedence.
  • Yet another regular expression syntax (Still not completely sorted out.).
  • What “standard input” is, and why I can ignore the error message about it.
  • How to use Pageant, and what happens if you neglect to restart it after a reboot.

    That’s a lot of expertise required to run a simple tool. It seemed a bit over the top that I was racking my brain trying to remember a lecture I did almost 20 years ago about the order of evaluation of quotes in bash.

    I think my hours of effort will have paid for itself in only a couple of years!


Comments

  1. If this is a joke, I don’t get it.

    I’ve heard people claiming that installing software on Linux is easy now. I’m thinking not so much. The amount of background knowledge that was required to install Unison was immense.

    So knowledge of Windows shortcuts (and many other Windows- and Cygwin-specific things) is “needed” in order to install Unison on Linux? WTF?

    Please explain.

  2. Yeah, those open source shoestring cobblers are ridiculous. The other day I installed a cross-platform Microsoft application on a Linux server and the Windows counterpart on my laptop and then got them talking to each other without any effort. *cough*

    FWIW, rsync has always Just Worked for me and it’s just one apt-get install rsync away. (Or whatever your package manager of choice.) The MacOS X base system comes with rsync included, I hear.

    If you want to stick to Windows, though, that’s your prerogative.

  3. And the cygwin unison binary package didn’t work for you? Or the Windows binaries?

    However, I agree that working with these environments is more complex than you’d want. Ocaml make files? shudder

    How is IE involved here? Is that just an ugly replacement for “telnet [addr] [testport]”?

    A quick note on the cygwin homedir setting: this all depends on how you’ve set up your /etc/passwd file. Before you import your windows userlist, everyone automatically gets a homedir of C:\Documents and Settings\[name]. After import, that dir switches to C:\cygwin\home\[name]. For convenience and some consistency with other Unix tools ported to windows (I’m looking at you, XEmacs) I’ve remapped the cygwin home dir back to that documents and settings dir. Extremely well behaved windows apps (at least those that follow the XP installation style) will call %APPDATA% or a subdir under there home.

  4. apt-get install unison.

    At least you CAN install unison from source on a linux box. Try doing the same in Windows – you’ll just find a whole bunch of software you don’t have installed. Compiling stuff is not your responsibility as a user. If you didn’t have packages then it was officially “not supported on your platform”.

  5. I’m sorry. I would like to repudiate my anti-Linux comment. I was merely sniping because I was frustrated. I should have seen it for that, and removed it. It wasn’t my intention to suggest that the Windows was somehow less mired in this swamp. I am just whinging here, not amassing troops at the border of an OS war.

    Aristotle,

    rsync has always Just Worked for me

    My understanding is that rsync is uni-directional, where unison is bi-directional. I do edit in both places when I am hacking on my home software. Perhaps I should look at my workflow; it is not something I would do on a “real” production system.

    apt-get install rsync

    On my web-host, apt-get gives a “command not found” error. I don’t know that my “package manager of choice” would/could/should be. I am a Unix/Linux user, not an administrator. (I have no idea whether apt-get would work as someone without root access.

    Richard,

    Unison is very version-sensitive.

    The Cygwin binaries you reference are for 2.17.

    The Windows binaries which I originally found were for 2.10. The ones you found are for 2.26 and 2.27; if I had found them myself that would have saved at least half of the effort! I might install those soon, just to check out the GUI version.

    The Linux version I installed was 2.26 (because I didn’t find the 2.27 source until later!)

    How is IE involved here? Is that just an ugly replacement for “telnet [addr] [testport]”?

    No, it was just to download the .tar.gz source files.

  6. Someone asked me, out of the blue, as they are wont: Mark, what is Unison? I know the answer, I always know the answer, well google helps me a little, but the answer will be forthcoming.

    Anyway, google did help, it sent me here. Funny how I move to the UK and the answer to a question asked of me is provided by someone I know in Sydney 😛

  7. It seems the difficulty mainly comes from Unison developpers, not from Linux. It’s equally hard to install it on Windows. The Windows installer requires to install a library and add it to the Path!? WTF. I know where the Path is configured in Linux but I have no idea where it is in Windows. The developpers probably do want users to use it…

Leave a comment

You must be logged in to post a comment.

Web Mentions

  1. OddThinking » Recent Down-Times, An Exploration