Versions mishandled while installing packages

45 views
Skip to first unread message

Andrey Novoseltsev

unread,
Sep 13, 2015, 8:22:50 PM9/13/15
to sage-devel
Doing with sage-6.9.beta6

./sage -i threejs

results in

sage-logger 'sage-spkg -f threejs-r70' '/home/sc_serv/sage/logs/pkgs/threejs-r70.log'
Attempting to download package threejs-r70
Error: could not find a package matching threejs-r70
       Try 'sage --package list' to see the available packages
       Did you mean: threejs?

Same problem with pycrypto that gets turned into pycryptoplus.

Volker Braun

unread,
Sep 14, 2015, 4:26:25 AM9/14/15
to sage-devel
I'm guessing this is because the version starts with a letter, breaking some regex. The package name is threejs and not threejs-r70.

As a note for script authors: The only way to translate between package and tarball name is 

$ sage --package tarball threejs
threejs-r70.tar.gz

$ sage --package name threejs-r70.tar.gz
threejs

All attempts to use regexes will fail. There are various corner cases in optional packages if you don't believe me.

Andrey Novoseltsev

unread,
Sep 14, 2015, 4:05:45 PM9/14/15
to sage-devel
Well, the fix that works for threejs is to replace

PKG_BASE=`echo "$PKG_NAME" | sed 's/-[0-9].*//'`

at https://github.com/sagemath/sage/blob/6.9.beta6/build/bin/sage-spkg#L238 with

PKG_BASE=`echo "$PKG_NAME" | sed 's/-.*//'`

Does this sound like a good idea? Should work as long as we do not allow dashes in package names...

Volker Braun

unread,
Sep 14, 2015, 4:17:40 PM9/14/15
to sage-devel
On Monday, September 14, 2015 at 10:05:45 PM UTC+2, Andrey Novoseltsev wrote:
PKG_BASE=`echo "$PKG_NAME" | sed 's/-.*//'`
Does this sound like a good idea? Should work as long as we do not allow dashes in package names...

Why not? Who is validating the naming convention? Also misshandles case, e.g.:

$ sage --package tarball cython
Cython-0.23.1.tar.gz



Andrey Novoseltsev

unread,
Sep 14, 2015, 5:06:45 PM9/14/15
to sage-devel
Reply all
Reply to author
Forward
0 new messages