#9434: Stop greping for a non-existent sage-banner
------------------------+---------------------------------------------------
   Reporter:  drkirkby  |       Owner:  GeorgSWeber
       Type:  defect    |      Status:  new        
   Priority:  minor     |   Milestone:  sage-5.0   
  Component:  build     |    Keywords:             
     Author:            |    Upstream:  N/A        
   Reviewer:            |      Merged:             
Work_issues:            |  
------------------------+---------------------------------------------------
 In install.log, we often see:

 {{{
 drkir...@hawk:~/f/sage-4.5.alpha3$ grep sage-banner install.log
 grep: can't open /export/home/drkirkby/f/sage-4.5.alpha3/local/bin/sage-
 banner
 grep: can't open /export/home/drkirkby/f/sage-4.5.alpha3/local/bin/sage-
 banner
 grep: can't open /export/home/drkirkby/f/sage-4.5.alpha3/local/bin/sage-
 banner
 grep: can't open /export/home/drkirkby/f/sage-4.5.alpha3/local/bin/sage-
 banner
 sage_scripts-4.5.alpha3/.hg/store/data/sage-banner.i
 sage_scripts-4.5.alpha3/sage-banner
 drkir...@hawk:~/f/sage-4.5.alpha3$
 }}}

 I think this is probably due to some code in sage-sage

 {{{
 if [ "$1" = '-v' -o "$1" = '-version' -o "$1" = '--version' ]; then
     cat "$SAGE_LOCAL/bin/sage-banner" | grep -i "version" | sed "s/\| //"
 | sed "s/ *\|//"
     exit $?
 fi
 }}}

 This will obviously fail if sage-banner does not exist.

 Also
  * There is an useless use of 'cat'. Perhaps the author was hoping to get
 a [http://partmaps.org/era/unix/award.html Useless Use of Cat Award] (Well
 worth a read - it's both funny and educational.)
  * There is an an unnecessary use of double-quotes around 'version'.

 The following will save a few bytes of disk space and a few CPU cycles, as
 it will invoke one less process.

 {{{
     grep -i version "$SAGE_LOCAL/bin/sage-banner" | sed "s/\| //" | sed
 "s/ *\|//"
 }}}

 More importantly, we should check that sage-banner exists before doing
 this, so it does not produce potentially confusing error messages.

 Dave

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9434>
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