Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update SageTeX spkg to 2.2.3.p0 to fix spkg-check script #8255

Closed
dandrake opened this issue Feb 13, 2010 · 18 comments
Closed

update SageTeX spkg to 2.2.3.p0 to fix spkg-check script #8255

dandrake opened this issue Feb 13, 2010 · 18 comments

Comments

@dandrake
Copy link
Contributor

The SageTeX spkg shipped in 4.3.2 has a slightly broken spkg-check: if LaTeX is present, but the tkz-berge.sty file isn't, the example file included with SageTeX cannot be typeset and spkg-check fails. Since I don't assume the user has LaTeX installed, I shouldn't assume that tkz-berge.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 BY-SA; 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.

Component: spkg-check

Author: Dan Drake

Reviewer: John Palmieri

Merged: sage-4.3.4.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/8255

@dandrake
Copy link
Contributor Author

Author: Dan Drake

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Feb 15, 2010

Work Issues: portability issues in spkg-check

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Feb 15, 2010

comment:2

Could you modify the file spkg-check to conform to the portability issues at #8255? For example, the following line in spkg-check is not recommended:

if [ "$(which latex)" -a "$(kpsewhich tkz-berge.sty)" ]

@dandrake
Copy link
Contributor Author

comment:3

Replying to @sagetrac-mvngu:

Could you modify the file spkg-check to conform to the portability issues at #8255?

I'm guessing you didn't mean to refer to this ticket... :)

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Feb 15, 2010

comment:4

Replying to @dandrake:

I'm guessing you didn't mean to refer to this ticket... :)

Let's pretend I was referring to #7632 :-)

@dandrake
Copy link
Contributor Author

Changed work issues from portability issues in spkg-check to none

@dandrake
Copy link
Contributor Author

comment:5

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.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Feb 20, 2010

comment:6

I had something like this in mind:

diff -r 2d39ee3a7530 -r e739e330a66a spkg-check
--- a/spkg-check
+++ b/spkg-check
@@ -29,8 +29,7 @@
     fi
 }
 
-if [ "$(which latex)" && "$(kpsewhich tkz-berge.sty)" ]
-then
+if [ "$(which latex)" ] && [ "$(kpsewhich tkz-berge.sty)" ]; then
     cd src
 
     typeset example.tex

It would be good if the ticket number is referenced in the hg log.

@dandrake
Copy link
Contributor Author

comment:7

Okay, fixed. New version reflects your suggestions.

BTW, how did you get that diff in your comment?

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Feb 21, 2010

comment:8

Replying to @dandrake:

BTW, how did you get that diff in your comment?

See the Wiki Processors section.

@jhpalmieri
Copy link
Member

comment:9

spkg-check 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, sage-check exits gracefully, but in the unlikely event that latex is found but pdflatex isn't, then I get

Running the test suite.
./spkg-check: 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), tkz-berge.sty and tkz-graph.sty is installed.
*************************************
Error testing package ** sagetex-2.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/gcc-4.4.1-sun-linker/bin /usr/local/bin2 /usr/bin /usr/ccs/bin /usr/local/bin /usr/sfw/bin /bin /usr/sbin

@dandrake
Copy link
Contributor Author

dandrake commented Mar 2, 2010

comment:10

Replying to @jhpalmieri:

spkg-check 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/gcc-4.4.1-sun-linker/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.

@jhpalmieri
Copy link
Member

comment:11

Replying to @dandrake:

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.

@dandrake
Copy link
Contributor Author

dandrake commented Mar 2, 2010

comment:12

New spkg up for review at http://sage.math.washington.edu/home/drake/code/sage/st/sagetex-2.2.3.p0.spkg.

The spkg-check 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".

@jhpalmieri
Copy link
Member

comment:13

Looks good to me. It works on systems on which latex and/or tkz-berge.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.

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Mar 3, 2010

Merged: sage-4.3.4.alpha0

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Mar 3, 2010

comment:14

Merged sagetex-2.2.3.p0.spkg in the standard spkg repository.

@sagetrac-mvngu sagetrac-mvngu mannequin removed the s: positive review label Mar 3, 2010
@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Mar 3, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants