#8523: Optional package  p_group_cohomology-1.2 fails to install on Solaris 10
SPARC, as well as Debian Linux x86/x86_64 and MacOSX 10.5 (PPC)
---------------------------------+------------------------------------------
   Reporter:  drkirkby           |       Owner:  SimonKing 
       Type:  defect             |      Status:  needs_info
   Priority:  major              |   Milestone:  sage-4.4  
  Component:  optional packages  |    Keywords:            
     Author:                     |    Upstream:  N/A       
   Reviewer:                     |      Merged:            
Work_issues:                     |  
---------------------------------+------------------------------------------

Comment(by jhpalmieri):

 Replying to [comment:25 SimonKing]:
 > Hi John!
 >
 > I don't know how it works what you suggested. First of all, $INSTALLED
 has no value in the sage shell:

 > Could it be that it is only defined inside {{{SAGE_ROOT/local/bin/sage-
 spkg}}}?

 That's right.

 > And one problem with this method is that (if I understand correctly) one
 has to provide the exact version of the package whose existence is being
 tested.

 I think that's right, too.  I don't know much about writing shell scripts,
 but this seems to work:
 {{{
 #!/usr/bin/env bash

 INSTALLED="$SAGE_PACKAGES/installed/"
 PKG_NAME=`echo "$1" | sed -e "s/\.spkg$//"`
 PKG_NAME=`basename "$PKG_NAME"`
 PKG_BASE=`echo "$PKG_NAME" | sed -e "s/-.*//"`

 cd "$SAGE_PACKAGES/installed"

 if [ `echo $PKG_BASE*` ]; then
     echo "sage: $PKG_BASE is already installed"
     exit 0
 fi
 }}}
 ($SAGE_PACKAGES is defined by running "sage -sh".)  This script defines
 PKG_BASE to be the name of the package without the version number:
 everything up to the first hyphen or period, whichever comes first.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8523#comment:28>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to