8

I want to use the vc bundle to add version information to my files. I'd like to go the "write18" route, rather than the makefile route, for now at least. I believe to make it work, I need to allow the vc script to run. TeXlive has a restricted write18 list, of commands that can be run. (I believe I've understood this correctly...) So my question is: how do I the vc script to this list?

I'm on ubuntu 10.10 with the packaged version of TeXlive 2009. I think I found the right file, in /etc/texmf/texmf.d/95NonPath.cnf but it is write only. So before I sudo emacs it, I wanted to check I am doing the right thing. Is there a way I could keep my configuration files I've changed in my ~/texmf tree?

I could just emacs-fu my way to automatically have vc run, but I'd rather have a write18 solution...

So here's the relevant part of my preamble:

\immediate\write18{sh ./vc}
\input{vc}

I have tried adding vc to the shell_escape_commands list in /etc/texmf/texmf.d/95NonPath.cnf but this didn't work. kpsewhich -expand-var '$shell_escape_commands' still doesn't list it. So I add vc directly into /usr/share/texmf/web2c/texmf.cnf but this doesn't work either. I don't think I can add sh ./vc to the shell escape list, since I'm not allowed spaces in that list right? Would adding sh to the list work? Is that a good idea? I'm pretty sure that would be dangerous...

4
  • Thank you for letting me know about the vc bundle. Looks very useful. I had been using svninfo but it puts stuff on the page by default. Commented Dec 17, 2010 at 20:24
  • Yeah I like it. I've just been doing M-! then sh ./vc in emacs, which is not ideal. But it's a neat, simple appraoch...
    – Seamus
    Commented Dec 17, 2010 at 22:19
  • Adding sh would be a very bad idea.
    – TH.
    Commented Dec 18, 2010 at 23:58
  • I thought so...
    – Seamus
    Commented Dec 19, 2010 at 12:28

1 Answer 1

6

TeX Live 2009 had a restricted write18, but it was apparently not safe and so disabled by default. It is enabled in TeX Live 2010.

I cannot help with Ubuntu's packed version specifically because I always install TeX Live myself. Using TeX Live installed by the standard install script, the file that should be changed is .../texlive/2010/texmf.cnf. You would add it to the shell_escape_commands list.

I'm not a kpathsea expert, so I'm not sure if there's a way to just add to the list without overriding. The obvious thing to try

shell_escape_commands = ./vc, ${shell_escape_commands}

does not work:

$ kpsewhich -expand-var '$shell_escape_commands'
warning: kpathsea: variable `shell_escape_commands' references itself (eventually).

But you can just duplicate the original list and then add in ./vc.

9
  • In the ubuntu version of tl09 it seems to be enabled: shell_escape=p. I've updated my question. Maybe I'm trying to add the wrong thing to the list?
    – Seamus
    Commented Dec 18, 2010 at 18:35
  • @Seamus: What happens if you add ./vc to the list?
    – TH.
    Commented Dec 19, 2010 at 3:53
  • It doesn't work. Also if I open a terminal in emacs and type ./vc I get Permission Denied. I need to type sh ./vc in the terminal... I'm beginning to think this might not be a LaTeX question?
    – Seamus
    Commented Dec 19, 2010 at 12:13
  • 1
    @Seamus: Sounds like you need to change the mode on vc. Namely, chmod +x vc.
    – TH.
    Commented Dec 19, 2010 at 12:59
  • 1
    For the record, what needs doing is adding ./vc to the texmf.cnf file, and adding permissions as suggested in an earlier comment. then the line in the tex file: \immediate\write18{./vc}
    – Seamus
    Commented Jan 21, 2011 at 18:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .