TeX-Live / tlcockpit

GUI for tlmgr written in Scala
GNU General Public License v3.0
27 stars 2 forks source link

tlcockpit doesn't detect Cygwin #15

Closed kbrow1i closed 6 years ago

kbrow1i commented 6 years ago

tlcockpit doesn't detect Cygwin, because it runs the native Windows java, so System.getProperty("os.name") reports that the os is Windows. As a result, it tries to run tlmgr.bat, which doesn't exist in the Cygwin TeX-Live installation.

Maybe tlcockpit could somehow pass to java the fact that it's running under Cygwin, and tlmgr could then be called by '/path/to/bash -l -c tlmgr'. The path to Cygwin's bash can be determined by 'cygpath -w /bin/bash' or 'cygpath -m /bin/bash'. The former produces a path with backslashes, while the latter changes them to forward slashes. It shouldn't matter as long as all paths are properly quoted when necessary.

kberry commented 6 years ago

whatever is done for tlcockpit should in principle be done for all java programs, and there are a number of them. the less done in the wrapper script, the better. else maybe we'd have to write a generic wrapper. yuck ... or maybe just give up on using java programs under cygwin ...

kbrow1i commented 6 years ago

With the changes as of commit a20f69a (after a typo fix noted below), tlcockpit starts on Cygwin, and all the commands in the Tools menu work. I then tried Options->General and got errors; log attached.

I'd like to try to do some debugging myself before I ask you (Norbert) to work on this, unless the problem is obvious to you. I have sbt running on my system. Can you tell me in detail how to generate a jar file using sbt? I saw something in README.md about this, but it didn't make sense to me given that I know nothing about sbt.

Here's the typo fix I mentioned above:

index efead06..726d1e3 100755 --- a/scripts/tlcockpit.sh +++ b/scripts/tlcockpit.sh @@ -7,6 +7,7 @@ jarpath=kpsewhich --progname="$scriptname" --format=texmfscripts "$jar"

kernel=uname -s 2>/dev/null if test "${kernel#*CYGWIN}" != "$kernel" +then CYGWIN_ROOT=cygpath -w / export CYGWIN_ROOT jarpath=cygpath -w "$jarpath" tlcockpit.log

kberry commented 6 years ago

our usual sh style is if ; then .... fi

kberry commented 6 years ago

the grep command i originally wrote is more portable than relying on the shell pseudo-grep.

if echo "$kernel" | grep CYGWIN >/dev/null; then

norbusan commented 6 years ago

@kbrow1i Thanks for the script fix, stupid me @kberry I switched to the grep statement, thanks

@kbrow1i Concerning the log: I think I found the bug. I called

  bash -l -c tlmgr -v --machine-readable shell

instead of

  bash -l -c "tlmgr -v --machine-readable shell"

which I guess is necessary. Please try the new .jar that I pushed.

Concerning sbt, simply run assembly from the sbt prompt should be enough.

kbrow1i commented 6 years ago

Everything seems to work fine now. I've tried every menu command and a few other things. I'll keep playing with it over the next few days and report back if I find any problems.

Thanks for working on this, Norbert.

norbusan commented 6 years ago

Thanks for testing!!

norbusan commented 6 years ago

Merged the branch into master, so I am closing this issue. Thanks