#11246: flint-1.5.0.p5's extraneous #includes break typedef ulong in sys/types.h
-----------------------------------+----------------------------------------
   Reporter:  dimpase              |          Owner:  tbd            
       Type:  defect               |         Status:  positive_review
   Priority:  major                |      Milestone:  sage-4.7.2     
  Component:  packages             |       Keywords:  cygwin         
Work_issues:                       |       Upstream:  N/A            
   Reviewer:  Karl-Dieter Crisman  |         Author:  Dima Pasechnik 
     Merged:                       |   Dependencies:                 
-----------------------------------+----------------------------------------

Comment(by leif):

 Replying to [comment:19 kcrisman]:
 > Do we ever do error checking for these?  Most spkg-install files seem to
 have just "cp" or "patch".   What should be added?

 (`cp` will almost always succeed, so that's more or less irrelevant,
 meaning a different situation.)

 From the "proof-of-concept" spkg (Sphinx):
 {{{
 #!sh
 # Apply patches
 cd "$CUR/src"
 echo "Patching Sphinx..."
 for p in ../patches/*.patch; do
         patch -p1 <$p
         success "Error applying patch $p"
 done
 }}}

 (The `success` function exits `spkg-install` whenever `$? != 0`.)

 It would IMHO also be valid to just accumulate errors and do one check
 after the loop, e.g.:
 {{{
 #!sh
 patched_ok=true

 for p in patches/*.patch; do
   patch -p0 < "$p" || patched_ok=false  # -p0 is also superfluous btw.
 done

 if ! $patched_ok; then
   echo >&2 "Error applying the patches to upstream source" # or whatever
   exit 1
 fi
 }}}

 (Note that doing `ls patches/*.patch` is superfluous and not even robust.)

 You can of course at your taste "invert" the logic, i.e. start with
 `patch_error=false` and set it to `true` in case `patch` returns a non-
 zero value, then test `if $patch_error; then ...`.

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