cooperative-computing-lab/cctools — pull request #488 by reneme (2014-06-26 12:04:01+00:00)
Title: Feature: Multi Repository Support for CVMFS Parrot Module

This adapts the Parrot CernVM-FS module to work with a newer version of [libcvmfs](https://github.com/reneme/cvmfs/tree/feature-multi_repo_libcvmfs) that is going to come in a future version of CVMFS. Its main advantage is the support for multiple CVMFS repositories through a single instance of libcvmfs. Please see [this branch](https://github.com/reneme/cvmfs/tree/feature-multi_repo_libcvmfs) in the CVMFS git repository.

The parrot module detects the version of libcvmfs at compile time and enables the enhancements accordingly. Please note, that I needed to change the configuration scheme of libcvmfs, thus current installations need to be adapted. Mainly I separated *global* configuration (like cache directory, logging, ...) from *repository* configuration (repo name, URL, proxy, ...).

When using multiple repositories, they share one common cache. However, this comes with the cost of dropping cache quota management for the moment. The quota management is done globally in CVMFS thus repositories would step on each others feet. Therefore I decided to disable it entirely resulting in an ever growing cache.

Unfortunately, I don't have the possibility to verify the proper functionality. I ran some basic tests (like compiling the linux kernel through parrot - installed in the **sft.cern.ch** repository). Maybe you have better means to test it?

Main things done:
* detect libcvmfs version through the macro `LIBCVMFS_VERSION` (the new libcvmfs defines it to `2`, the old one doesn't define it at all)
* add `--cvmfs-config=` switch to parrot_run
* replace custom linked list of `struct cvmfs_filesystem` by `std::list`
* wrap calls to libcvmfs into thin compatibility functions (`#ifdef` into libcvmfs 1 or 2 library calls)
* adapt initialization code in `cvmfs_activate_filesystem()`, `cvmfs_filesystem_create()` and `cvmfs_filesystem::createMatch()` to new libcvmfs semantics
* remove trailing whitespace (Sublime did that for me ;-) )

I am very happy with any kind of feedback, please tell me if you find any problems with my adaptions.