Chapter 14 Working Disconnected

SRT assumes that all developers can connect to a central repository via which the tools themselves and the base releases are made available. Not all developers find this acceptable, though. Laptop users are for example connected only intermittently, and as laptops become more wide-spread, it is common for a developer to want to suck the packages she is working on onto the local disk, disconnect, and go off working. Another set of users having difficulty with this model are those developers who work on the software but have have bad connectivity to the central site. For these users the release tools allow the creation mirrors that are full or partial replicas of the software on the central site.

All aspects of mirroring are convered in full detail in Appendix A, ``Mirroring''. What this chapter describes is how you can create a simple mirror for yourself for a laptop you are working on. More complete examples and the extensive discussions should be followed in the appendix. We assume here that you will have a reasonable network link to the central site when connected, and that you only want to mirror a single architecture and a limited set of packages.

The first step is to initialise the mirror by installing the release tools into it. For the sake of simplicitly we assume here also that you are working on a Linux laptop. The commands you would execute on a laptop running say Windows would be similar except that the directory layouts would very likely be quite different. At any rate, you do the initialising by running the mirror tool with the -i option. However, before you do that, make sure that you have your environment set up correctly as explained in Section 7.1, ``Setting Up Environment''.[1] You would then issue a command like this:
$ srt mirror -i -r /home/me/dev -d

This command creates the mirror in /home/me/dev and initialises to include official releases (the -d option). The directory given as the argument will get three subdirectories: bin, lib, and dist. The bin directory will contain the srt script that you will run when you work against your mirror. The lib directory will contain subdirectory srt that will contain the release tools themselves. The dist subdirectory will contain the releases you mirror.

The next step is to mirror a frozen official release. You must execute one mirror command for each release you want to copy. Here we assume you want only the release 1.3.8. We also assume that you will not want the entire releases, but only whatever is required to develop the packages MagneticField and Simulation/Tracking (if these are hierarchical packages implies you want all the contents as well). You would issue a command such as this:
$ srt mirror -c -r /home/me/dev 1.3.8 $SRT_TARGET -- MagneticField Simulation/Tracking

When you execute the command, it will first perform a selection pass and tell you the full set of packages that was selected and how much disk space that will approximately take. It then pauses for a few seconds to let you interrupt it should the results look undesirable. If you do not stop it, it will go on to mirror the files and the directories, telling you somewhat verbosely what it is doing.

You can mirror the same release several times; the command will just wipe out the previous copy and start from scratch again. For instance, should you want to copy also Graphics package, you would just rerun the above command but add the new package at the end of the command line.

Finally, to use your mirror copy you should execute three steps. First, remove from your $PATH the directory where the central srt script is--as the examples in this manual have gone, you would remove /afs/cern.ch/atlas/software/bin. Second, add the program directory from your mirror to your path. The third and final step is to unset all SRT environment variables and to rerun the setup tool from the mirror. User of a shell derived from the Bourne shell would carry out these two steps like this:
$ PATH=$PATH:/home/me/dev/bin
$ unset `env | grep '^SRT_' | sed 's/=.*//'`
$ . `srt setup`
while user a shell derived from the C-shell would write:
$ setenv PATH ${PATH}:/home/me/dev/bin
$ unset `env | grep '^SRT_' | sed 's/=.*//'`
$ source `srt setup -s csh`

You are now using the mirror. To switch your development working release in /home/me/work to the mirrored base release 1.3.8, you would issue these commands:
$ cd /home/me/work
$ srt base 1.3.8

Finally, remember to unset your SRT environment variables and to switch back to the central repository before attempting to run mirror tool again--or any other SRT tool that you expect to work against the central repository. It would not be a bad idea to write little shell alises that let you switch between the mirror environment and the central development environment if you are going to do it often.

Notes

[1]

For all mirroring operations you must execute the commands such that you are set up for the central site, not for your mirror.