Home | History | Annotate | Line # | Download | only in bin
reg-newmid revision 1.1.1.1.8.2
      1 #! /bin/sh
      2 
      3 # The build failed for and identifier in the range bwetween LOW and HIGH.
      4 # Find a new patch id to try within that range.
      5 #
      6 # It's meant to be easy to modify the heuristics used to select the
      7 # next patch to try by adding to or rearranging the patches listed in
      8 # MIDLIST.  Known failures are recorded in ${REG_FAILLIST}.
      9 #
     10 # A nifty improvement would be to record known ranges of failure as
     11 # ranges, and then pick revisions just before and just after the range.
     12 #
     13 # Copyright (C) 2006 Free Software Foundation, Inc.
     14 #
     15 # This file is free software; you can redistribute it and/or modify
     16 # it under the terms of the GNU General Public License as published by
     17 # the Free Software Foundation; either version 3 of the License, or
     18 # (at your option) any later version.
     19 #
     20 # This program is distributed in the hope that it will be useful,
     21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     23 # GNU General Public License for more details.
     24 #
     25 # For a copy of the GNU General Public License, write the the
     26 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     27 # Boston, MA 02111-1301, USA.
     28 
     29 LOW=$1
     30 HIGH=$2
     31 
     32 MIDLIST=""
     33 
     34 let MID01=LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+HIGH
     35 let MID01=MID01/12
     36 let MID02=LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+HIGH+HIGH
     37 let MID02=MID02/12
     38 let MID03=LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+HIGH+HIGH+HIGH
     39 let MID03=MID03/12
     40 let MID04=LOW+LOW+LOW+LOW+LOW+LOW+LOW+LOW+HIGH+HIGH+HIGH+HIGH
     41 let MID04=MID04/12
     42 let MID05=LOW+LOW+LOW+LOW+LOW+LOW+LOW+HIGH+HIGH+HIGH+HIGH+HIGH
     43 let MID05=MID05/12
     44 let MID06=LOW+LOW+LOW+LOW+LOW+LOW+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH
     45 let MID06=MID06/12
     46 let MID07=LOW+LOW+LOW+LOW+LOW+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH
     47 let MID07=MID07/12
     48 let MID08=LOW+LOW+LOW+LOW+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH
     49 let MID08=MID08/12
     50 let MID09=LOW+LOW+LOW+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH
     51 let MID09=MID09/12
     52 let MID10=LOW+LOW+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH
     53 let MID10=MID10/12
     54 let MID11=LOW+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH+HIGH
     55 let MID11=MID11/12
     56 
     57 # Look in this order; MID has already been done:
     58 #
     59 #  LOW--10---7---6---3---2---MID---1---4---5---8---9---HIGH
     60 
     61 MIDLIST="${MIDLIST} ${MID07}"
     62 MIDLIST="${MIDLIST} ${MID05}"
     63 MIDLIST="${MIDLIST} ${MID04}"
     64 MIDLIST="${MIDLIST} ${MID08}"
     65 MIDLIST="${MIDLIST} ${MID09}"
     66 MIDLIST="${MIDLIST} ${MID03}"
     67 MIDLIST="${MIDLIST} ${MID02}"
     68 MIDLIST="${MIDLIST} ${MID10}"
     69 MIDLIST="${MIDLIST} ${MID11}"
     70 MIDLIST="${MIDLIST} ${MID01}"
     71 
     72 for MID in ${MIDLIST}
     73 do
     74   # Skip this if it's the low endpoint.
     75   if [ ${MID} != ${LOW} ]; then
     76     # Is this patch already known to fail?
     77     ${REG_CHECKFAIL} ${MID}
     78     if [ $? -ne 0 ]; then
     79       echo ${MID}
     80       exit 0
     81     fi
     82   fi
     83 done
     84 
     85 echo 0
     86 exit 1
     87