Opened 9 years ago
Closed 9 years ago
#8255 closed defect (fixed)
update SageTeX spkg to 2.2.3.p0 to fix spkgcheck script
Reported by:  ddrake  Owned by:  tbd 

Priority:  major  Milestone:  sage4.3.4 
Component:  spkgcheck  Keywords:  
Cc:  Merged in:  sage4.3.4.alpha0  
Authors:  Dan Drake  Reviewers:  John Palmieri 
Report Upstream:  N/A  Work issues:  
Branch:  Commit:  
Dependencies:  Stopgaps: 
Description
The SageTeX spkg shipped in 4.3.2 has a slightly broken spkgcheck: if LaTeX is present, but the tkzberge.sty file isn't, the example file included with SageTeX cannot be typeset and spkgcheck fails. Since I don't assume the user has LaTeX installed, I shouldn't assume that tkzberge.sty is either.
There are also some documentation fixes, including notably an "egrep" which should be "egrep v"!
Finally, the license for the documentation is now CC BYSA; I've dropped the noncommercial clause.
The new spkg is version 2.2.3.p0 in http://sage.math.washington.edu/home/drake/code/sage/st/ . The last version of the spkg is available in the same place, for ease of reviewing.
Change History (14)
comment:1 Changed 9 years ago by
 Status changed from new to needs_review
comment:2 followup: ↓ 3 Changed 9 years ago by
 Status changed from needs_review to needs_work
 Work issues set to portability issues in spkgcheck
comment:3 in reply to: ↑ 2 ; followup: ↓ 4 Changed 9 years ago by
comment:4 in reply to: ↑ 3 Changed 9 years ago by
comment:5 Changed 9 years ago by
 Status changed from needs_work to needs_review
 Work issues portability issues in spkgcheck deleted
Thanks for the link. Ironically, I put in "a" in an effort to be more portable...thanks for setting me straight. I've replaced the spkg with an updated one. Please review.
comment:6 Changed 9 years ago by
I had something like this in mind:

spkgcheck
diff r 2d39ee3a7530 r e739e330a66a spkgcheck
a b 29 29 fi 30 30 } 31 31 32 if [ "$(which latex)" && "$(kpsewhich tkzberge.sty)" ] 33 then 32 if [ "$(which latex)" ] && [ "$(kpsewhich tkzberge.sty)" ]; then 34 33 cd src 35 34 36 35 typeset example.tex
It would be good if the ticket number is referenced in the hg log.
comment:7 followup: ↓ 8 Changed 9 years ago by
Okay, fixed. New version reflects your suggestions.
BTW, how did you get that diff in your comment?
comment:8 in reply to: ↑ 7 Changed 9 years ago by
Replying to ddrake:
BTW, how did you get that diff in your comment?
See the Wiki Processors section.
comment:9 followup: ↓ 10 Changed 9 years ago by
 Status changed from needs_review to needs_work
spkgcheck tests whether latex is present, and then it actually runs pdflatex. I suppose that anyone who has latex will have pdflatex also, but I think this should be fixed anyway: if latex is not found, sagecheck exits gracefully, but in the unlikely event that latex is found but pdflatex isn't, then I get
Running the test suite. ./spkgcheck: line 10: pdflatex: command not found Error typesetting example.tex! To fully test SageTeX, make sure LaTeX can find sagetex.sty, and that TikZ (version 2.00 or newer), tkzberge.sty and tkzgraph.sty is installed. ************************************* Error testing package ** sagetex2.2.3.p0 ** *************************************
Can we run latex instead of pdflatex? Otherwise, change "which latex" to "which pdflatex", and maybe change the error message from "LaTeX isn't installed" to "PDFLaTeX isn't installed"?
Also, something is wrong with the shell script on Solaris but I don't know what. If I log into t2.math.washington.edu and try installing with SAGE_CHECK equal to 1, then I get the bad error message even though latex is not found. Maybe this is because on many systems, 'which latex' produces nothing if latex isn't found, but on t2, 'which latex' does this:
$ which latex no latex in /usr/local/gcc4.4.1sunlinker/bin /usr/local/bin2 /usr/bin /usr/ccs/bin /usr/local/bin /usr/sfw/bin /bin /usr/sbin
comment:10 in reply to: ↑ 9 ; followup: ↓ 11 Changed 9 years ago by
Replying to jhpalmieri:
spkgcheck tests whether latex is present, and then it actually runs pdflatex. I suppose that anyone who has latex will have pdflatex also, but I think this should be fixed anyway:
In TeXLive (and teTeX), "latex" and "pdflatex" are just symlinks to pdftex (or pdfetex), so it seems really unlikely that someone would have "latex" but not "pdflatex". But your idea is correct; I'll change it.
By the way, is that a real example? Do you have a system with latex but not pdflatex? I'm curious to know about it.
Also, something is wrong with the shell script on Solaris but I don't know what. If I log into t2.math.washington.edu and try installing with SAGE_CHECK equal to 1, then I get the bad error message even though latex is not found. Maybe this is because on many systems, 'which latex' produces nothing if latex isn't found, but on t2, 'which latex' does this:
$ which latex no latex in /usr/local/gcc4.4.1sunlinker/bin /usr/local/bin2 /usr/bin /usr/ccs/bin /usr/local/bin /usr/sfw/bin /bin /usr/sbin
This is a more serious problem. I'll look into it. Hopefully it gives a useful return code or something.
comment:11 in reply to: ↑ 10 Changed 9 years ago by
Replying to ddrake:
By the way, is that a real example? Do you have a system with latex but not pdflatex? I'm curious to know about it.
It was a contrived example: I renamed pdflatex temporarily but kept latex around.
comment:12 Changed 9 years ago by
 Status changed from needs_work to needs_review
New spkg up for review at http://sage.math.washington.edu/home/drake/code/sage/st/sagetex2.2.3.p0.spkg.
The spkgcheck script now simply tries running latex and kpsewhich, and checks the return code to see if it worked. I think this is more portable, as returning 0 for success is pretty standard. It also uses "latex" throughout, and doesn't use "pdflatex".
comment:13 Changed 9 years ago by
 Reviewers set to John Palmieri
 Status changed from needs_review to positive_review
Looks good to me. It works on systems on which latex and/or tkzberge.sty is not installed. I also created a bug in the file example.tex and rebuilt the spkg, and indeed, it didn't pass tests.
Tested on sage.math, a Mac running OS X 10.6, and t2.math.
comment:14 Changed 9 years ago by
 Merged in set to sage4.3.4.alpha0
 Resolution set to fixed
 Status changed from positive_review to closed
Merged sagetex2.2.3.p0.spkg in the standard spkg repository.
Could you modify the file
spkgcheck
to conform to the portability issues at #8255? For example, the following line inspkgcheck
is not recommended: