[OS X TeX] Installing unstable packages
ross.moore at mq.edu.au
Thu Feb 17 16:24:20 EST 2011
Hi Pete, and others.
Sent from my iPad
On 18/02/2011, at 5:01 AM, Peter Dyballa <Peter_Dyballa at Web.DE> wrote:
> Am 17.02.2011 um 17:38 schrieb Theo Moore:
>>  Is there a (painless) way to install both and use one or the other
>> when the situation demands? I have lots of documents that use
>> pgfplots, so it wouldn't be nice if installing the newer, unstable
>> version somehow begins producing errors in the older documents.
> You have to install it outside the area tlmgr manages. The possibly best option (I did not read the other suggestions) is to install in /usr/local/texlive/texmf-local. You need "elevated privileges", and again to switch it off and on. And therefore, for this ability and simplicity, I recommend system-wide.
> How does the switch work?
> By presenting TeX the proper /usr/local/texlive/texmf-local/ls-R file.
> How to build the switch?
> After installation of the package *and* before you run "sudo texhash /usr/local/texlive/texmf-local" you need to save the old /usr/local/texlive/texmf-local/ls-R file: "sudo mv /usr/local/texlive/texmf-local/ls-R /usr/local/texlive/texmf-local/ls-R-off". Now run texhash/mktexlsr.
> How to switch on/off?
> After you've run texhash the unstable package is "on": TeX will find its components in the ls-R file. To switch it off execute this: "sudo mv /usr/local/texlive/texmf-local/ls-R /usr/local/texlive/texmf-local/ls-R-on ; sudo mv /usr/local/texlive/texmf-local/ls-R-off /usr/local/texlive/texmf-local/ls-R", to switch it on: "sudo mv /usr/local/texlive/texmf-local/ls-R /usr/local/texlive/texmf-local/ls-R-off ; sudo mv /usr/local/texlive/texmf-local/ls-R-on /usr/local/texlive/texmf-local/ls-R"!
Ugh. But if you put these commands into a script, then it becomes more elegant.
I handle large package updates in a way that is conceptually easier, using the access privileges of the folders. First ensure that the directory has a unique name.
e.g. .../texmf/tex/latex/hyperref might become .../texmf/tex/latex/hyperref-v68f
so you can update with a newer .../texmf/tex/latex/hyperref-v73a.
(fill in the ... as appropriate, and sudo mv to change a folder name using a command-line)
Now to disable the older version, again use the command-line:
sudo chmod a-rx hyperref-v68f
Now the contents of the disabled directory will not be listed in the ls-R file.
Thus TeX-based programs find the later version, not the earlier one.
To reenable a version, use chmod a+rx on the directory, and disable the currently active one, then follow with another sudo texhash .
This becomes cumbersome when the files for a package reside in folders at different parts of the texmf/ tree (e.g. beamer styles) but mostly not many of those files change at all, so in practice it is not a big deal. You just need to be aware of what you are doing, and why.
> Will it work?
> Not always, I presume... The problem comes from tlmgr: after installation of some software it will run texhash/mktexlsr. Without arguments:
> -rw-r--r-- 1 root wheel 146656 17. Feb 18:44 /usr/local/texlive/texmf-local/ls-R
> -rw-r--r-- 1 root wheel 104 17. Feb 18:44 /usr/local/texlive/2010/texmf-config/ls-R
> -rw-r--r-- 1 root wheel 1071017 17. Feb 18:45 /usr/local/texlive/2010/texmf-dist/ls-R
> -rw-r--r-- 1 root wheel 1679 17. Feb 18:45 /usr/local/texlive/2010/texmf-var/ls-R
> -rw-r--r-- 1 root wheel 27933 17. Feb 18:44 /usr/local/texlive/2010/texmf/ls-R
> So the file /usr/local/texlive/texmf-local/ls-R will be overwritten with the on-contents. To prevent this from happening you can build the switch this way:
> Save the off state as before and after "sudo texhash /usr/local/texlive/texmf-local" was run save the ls-R file (on state) as: "sudo cp /usr/local/texlive/texmf-local/ls-R /usr/local/texlive/texmf-local/ls-R-on". To operate the switch don't mv (rename) the files but copy the appropriate one:
> To switch on: sudo cp /usr/local/texlive/texmf-local/ls-R-on /usr/local/texlive/texmf-local/ls-R
> To switch off: sudo cp /usr/local/texlive/texmf-local/ls-R-off /usr/local/texlive/texmf-local/ls-R
> So tlmgr will update only a copy and no original. Before using the original PGFplot you should actively switch off the unstable installation.
Hope this helps,
> Encryption, n.:
> A powerful algorithmic encoding technique employed in the creation of computer manuals.
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
More information about the MacOSX-TeX