#9603: Force iconv to build + install on HP-UX.  Currently it is only installed 
on
Solaris and Cygwin.
----------------------------+-----------------------------------------------
   Reporter:  drkirkby      |       Owner:  drkirkby    
       Type:  defect        |      Status:  needs_review
   Priority:  minor         |   Milestone:  sage-5.0    
  Component:  build         |    Keywords:              
     Author:  David Kirkby  |    Upstream:  N/A         
   Reviewer:  pjeremy       |      Merged:              
Work_issues:                |  
----------------------------+-----------------------------------------------

Comment(by drkirkby):

 Replying to [comment:8 leif]:
 > Style-wise, I would invert the test to something like:
 > {{{
 > #!sh
 > if [ "$UNAME" = SunOS -o "$UNAME" = CYGWIN -o "$UNAME" = HP-UX ]; then
 >
 >     # install spkg/run test suite, check exit code, ...
 >
 > else
 >
 >     # print message that iconv will not be installed/tested
 >     # because *the system's* one is/will be used (rather than
 >     # the one shipped with Sage), exit 0
 >
 > fi
 > }}}
 > (I.e., clarifying the messages a bit, too.)
 >
 >
 > Dave, you're right, I do not have access to an HP-UX system, but I don't
 think that's necessary to give it a positive review.
 >
 >
 > I'll later take a look at the whole...
 >
 >
 > -Leif
 >
 > P.S.: Peter is (already) listed as reviewer, should I than delete him in
 case I give it positive review (and if he hasn't yet)?

 I try to write my scripts as portable as I possibly can. I've tended to
 ask on [http://groups.google.com/group/comp.unix.shell/topics
 comp.unix.shell] where some shell scripting wizards hang out. I've just
 asked
 
[http://groups.google.com/group/comp.unix.shell/browse_thread/thread/4081999fef86b878#
 for comment on -o vs ||]

 It's true that for the bash shell, either {{{-o}}} or {{{||}}} will work,
 but there are a number of older shells which don't behave well in such
 circumstances. {{{||}}} is more portable than {{{-o}}}, and {{{&&}}} is
 more portable than {{{-a}}}. Likewise testing for {{{""}}} causes problems
 with some shells. I think the problems usually occur if there is more than
 one -o or -a on a line, which is what is needed here. I try to write my
 scripts which will work with any shell, though I stick {{{#!/usr/bin/env
 bash}}} at the top to be consistent with the rest of Sage.

 Changing the style introduces risks that I'd rather not introduce. The
 risk of introducing a bug increases the more changes one makes to the
 script. I would not be very popular if I tried to implement something for
 HP-UX that happens to break on some Linux system! At the moment the script
 does work reliably, so I'd prefer to limit the changes that are necessary
 to achieve the aim.

 I've tested this on Solaris, HP-UX and Linux. Peter has checked it on
 FreeBSD. If the style of the script is changed, so that testing needs to
 be repeated.

 The top of spkg-install has a description of what it is doing, and a link
 to the ticket which resulted in the decision to make iconv install only on
 Solaris and Cygwing, so I'm not really sure there is need for further
 explanation.

 If you feel there needs to be some more comments in the code, I will add
 them. But I do not feel changing the style is a good idea. It introduces
 unnecessary risks.

 Perhaps Peter has some comments on this.

 There's no need to delete Peter as a reviewer, as he has provided valuable
 input.

 Dave

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9603#comment:10>
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