[hypre] 08/09: refresh test.patch

Drew Parsons dparsons at moszumanska.debian.org
Fri Sep 29 06:41:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

dparsons pushed a commit to tag experimental/2.11.2-1
in repository hypre.

commit 6d5cc6aa036d40a005b81c34a49d869b023b6ed4
Author: Drew Parsons <dparsons at debian.org>
Date:   Fri Sep 29 12:51:20 2017 +0800

    refresh test.patch
    
    - src/test/runtest.sh works without converting `` to $()
      and the patches for those conversions are rejected, so drop them.
    
    - bashisms in checktest.sh and cleantest.sh: shopts
---
 debian/changelog          |   2 +
 debian/patches/series     |   2 +-
 debian/patches/test.patch | 163 +++++++++++-----------------------------------
 3 files changed, 41 insertions(+), 126 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7964aef..86807d4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ hypre (2.11.2-1) UNRELEASED; urgency=medium
     - "hypre_lapack.h" now included where needed
     - blas.patch: for multiarch blas, BLASLIBDIRS is returned empty
       instead of "null". Thanks Adrian Bunk. Closes: #877054.
+    - declare src/test/{check,clean}test.sh as bash scripts (they use
+      shopts), simplify patch for runtest.sh
 
  -- Drew Parsons <dparsons at debian.org>  Fri, 29 Sep 2017 12:18:26 +0800
 
diff --git a/debian/patches/series b/debian/patches/series
index 5c30408..de57e73 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,7 +6,7 @@ install.patch
 blas.patch
 complex.patch
 shlibs-interlink-libHYPRE.so.patch
-#test.patch
+test.patch
 lapack.patch
 superlu_internal.patch
 shlibs-interlink-sublibs.patch
diff --git a/debian/patches/test.patch b/debian/patches/test.patch
index 29b3348..25e832f 100644
--- a/debian/patches/test.patch
+++ b/debian/patches/test.patch
@@ -8,40 +8,9 @@ Index: hypre/src/test/runtest.sh
  
  # global variables
  BatchMode=0
-@@ -9,10 +9,10 @@ RunString=""
- RunEcho=""
- ExecFileNames=""           #string of executable file names used
- TestDirNames=""            #string of names of TEST_* directories used
--HOST=`hostname`
-+HOST=$(hostname)
- NumThreads=0               #number of OpenMP threads to use if > 0
- 
--function usage
-+usage()
- {
-    printf "\n"
-    printf "$0 [options] {test_path}/{test_name}.sh\n"
-@@ -49,14 +49,14 @@ function usage
- }
- 
- # generate default command based on the first 4 characters of the platform name
--function MpirunString
-+MpirunString()
- {
-    case $HOST in
-       *bgl*) shift
-          BatchMode=1
-          MY_NUM_TASKS=$1  
--         MY_EXECUTE_DIR=`pwd`
--         MY_EXECUTE_JOB=`pwd`/$EXECFILE
-+         MY_EXECUTE_DIR=$(pwd)
-+         MY_EXECUTE_JOB=$MY_EXECUTE_DIR/$EXECFILE
-          shift
-          shift
-          MY_ARGS="$*"
-@@ -65,8 +65,8 @@ function MpirunString
-          ;;
-       up*) CPUS_PER_NODE=8
+@@ -73,8 +73,8 @@ function MpirunString
+       up*)
+          CPUS_PER_NODE=8
           POE_NUM_PROCS=$2
 -         POE_NUM_NODES=`expr $POE_NUM_PROCS + $CPUS_PER_NODE - 1`
 -         POE_NUM_NODES=`expr $POE_NUM_NODES / $CPUS_PER_NODE`
@@ -50,31 +19,7 @@ Index: hypre/src/test/runtest.sh
           shift
           shift
           MY_ARGS="$*"
-@@ -77,8 +77,8 @@ function MpirunString
-       *dawn*) shift
-          BatchMode=1
-          MY_NUM_TASKS=$1  
--         MY_EXECUTE_DIR=`pwd`
--         MY_EXECUTE_JOB=`pwd`/$EXECFILE
-+         MY_EXECUTE_DIR=$(pwd)
-+         MY_EXECUTE_JOB=$MY_EXECUTE_DIR/$EXECFILE
-          shift
-          shift
-          MY_ARGS="$*"
-@@ -101,10 +101,10 @@ function MpirunString
-          if [ ! -f $MACHINES_FILE ] ; then
-             hostname > $MACHINES_FILE
-          fi
--         MPIRUN=`type mpirun|sed -e 's/^.* //'`
-+         MPIRUN=$(type mpirun|sed -e 's/^.* //')
-          RunString="$MPIRUN -machinefile $MACHINES_FILE $*"
-          ;;
--      *) MPIRUN=`type mpirun|sed -e 's/^.* //'`
-+      *) MPIRUN=$(type mpirun|sed -e 's/^.* //')
-          RunString="$MPIRUN $*"
-          ;;
-    esac
-@@ -113,7 +113,7 @@ function MpirunString
+@@ -106,7 +106,7 @@ function MpirunString
  # determine the "number of nodes" desired by dividing the "number of processes"
  # by the "number of CPU's per node" which can't be determined dynamically (real
  # ugly hack)
@@ -83,7 +28,7 @@ Index: hypre/src/test/runtest.sh
  {
     NUM_PROCS=1
     NUM_NODES=1
-@@ -145,8 +145,8 @@ function CalcNodes
+@@ -138,8 +138,8 @@ function CalcNodes
     do
        case $1 in
           -n*) NUM_PROCS=$2
@@ -94,7 +39,7 @@ Index: hypre/src/test/runtest.sh
              return $NUM_NODES
              ;;
           *) shift
-@@ -157,7 +157,7 @@ function CalcNodes
+@@ -150,7 +150,7 @@ function CalcNodes
  }
  
  # extract the "number of processes/task"
@@ -103,16 +48,7 @@ Index: hypre/src/test/runtest.sh
  {
     while [ "$1" ]
     do
-@@ -173,7 +173,7 @@ function CalcProcs
- 
- # determine if HOST machine can process batch queues
- #    set to run in debug pool unless batch MUST be used.
--function CheckBatch
-+CheckBatch()
- {
-    case $HOST in
-       alc*) BATCH_MODE=0
-@@ -202,7 +202,7 @@ function CheckBatch
+@@ -166,7 +166,7 @@ function CalcProcs
  
  # check the path to the executable if the executable exists; save the name to
  # ExecFileNames
@@ -121,7 +57,7 @@ Index: hypre/src/test/runtest.sh
  {
     while [ "$1" ]
     do
-@@ -230,7 +230,7 @@ function CheckPath
+@@ -194,7 +194,7 @@ function CheckPath
  #
  # on ubgl, as of 8/2006, only allowable number of nodes are 32, 128 and 
  # multiples of 512
@@ -130,7 +66,7 @@ Index: hypre/src/test/runtest.sh
  {
     CalcNodes "$@"
     NumNodes=$?
-@@ -263,7 +263,7 @@ function PsubCmdStub
+@@ -227,7 +227,7 @@ function PsubCmdStub
  }
  
  # read job file line by line saving arguments
@@ -139,7 +75,7 @@ Index: hypre/src/test/runtest.sh
  {
     StartDir=$1
     WorkingDir=$2
-@@ -272,7 +272,7 @@ function ExecuteJobs
+@@ -236,7 +236,7 @@ function ExecuteJobs
     BatchFlag=0               # #BATCH option detected flag 
     BatchCount=0              # different numbering for #Batch option
     PrevPid=0
@@ -148,7 +84,7 @@ Index: hypre/src/test/runtest.sh
  ##
  ##     move to specified directory
     cd $WorkingDir
-@@ -287,12 +287,12 @@ function ExecuteJobs
+@@ -251,12 +251,12 @@ function ExecuteJobs
  
           "#END"*) BatchFlag=0
              chmod +x $BatchFile
@@ -165,26 +101,7 @@ Index: hypre/src/test/runtest.sh
              do
                 sleep $JobCheckInterval
              done
-@@ -303,12 +303,12 @@ function ExecuteJobs
-             ;; 
- 
-          *mpirun*)
--            RunCmd=`echo $InputLine| sed -e 's/^[ \t]*mpirun[ \t]*//'` 
--            RunCmd=`echo $RunCmd | sed -e 's/[ \t]*>.*$//'`
--            OutFile=`echo $InputLine | sed -e 's/^.*>//'`
--            OutFile=`echo $OutFile | sed -e 's/ //g'`
--            ErrFile=`echo $OutFile | sed -e 's/\.out\./.err./'`
--            RunName=`echo $OutFile | sed -e 's/\.out.*$//'`
-+            RunCmd=$(echo $InputLine| sed -e 's/^[ \t]*mpirun[ \t]*//')
-+            RunCmd=$(echo $RunCmd | sed -e 's/[ \t]*>.*$//')
-+            OutFile=$(echo $InputLine | sed -e 's/^.*>//')
-+            OutFile=$(echo $OutFile | sed -e 's/ //g')
-+            ErrFile=$(echo $OutFile | sed -e 's/\.out\./.err./')
-+            RunName=$(echo $OutFile | sed -e 's/\.out.*$//')
-             CheckPath $RunCmd               # check path to executable
-             if [ "$?" -gt 0 ] ; then
-                cat >> $RunName.err <<- EOF
-@@ -320,35 +320,35 @@ EOF
+@@ -284,35 +284,35 @@ EOF
              fi
              MpirunString $RunCmd            # construct "RunString"
              case $HOST in
@@ -230,7 +147,7 @@ Index: hypre/src/test/runtest.sh
                    do
                       sleep $JobCheckInterval
                    done
-@@ -357,7 +357,7 @@ EOF
+@@ -321,7 +321,7 @@ EOF
                       BatchFile=$InputFile.batch.$BatchCount
                       BatchCount=BatchCount+1
                       cat > $BatchFile <<- EOF
@@ -239,7 +156,7 @@ Index: hypre/src/test/runtest.sh
  ${RunString}
  EOF
                    else
-@@ -371,7 +371,7 @@ EOF
+@@ -335,7 +335,7 @@ EOF
              ;;
  
           *)
@@ -248,22 +165,7 @@ Index: hypre/src/test/runtest.sh
              if [ "$NOTBLANK" ] ; then
                 echo "Found something unexpected in $WorkingDir/$InputFile.jobs"
                 echo "--> $InputLine"
-@@ -385,12 +385,12 @@ EOF
- }
- 
- #   compare output files as defined in *.sh files
--function ExecuteTest
-+ExecuteTest()
- {
-    StartDir=$1
-    WorkingDir=$2
-    InputFile=$3
--   SavePWD=`pwd`
-+   SavePWD=$(pwd)
-    cd $WorkingDir
-    (cat $InputFile.err.* > $InputFile.err)
-    (./$InputFile.sh     >> $InputFile.err 2>> $InputFile.err)
-@@ -398,12 +398,12 @@ function ExecuteTest
+@@ -363,12 +363,12 @@ function ExecuteTest
  }
  
  #  report errors from PURIFY and/or INSURE if run 
@@ -278,16 +180,7 @@ Index: hypre/src/test/runtest.sh
     cd $WorkingDir
     if [ "$BatchMode" -eq 0 ] ; then
        if [ -f purify.log ] ; then
-@@ -423,7 +423,7 @@ function PostProcess
- 
-                
- # removes executable and hostname files from all TEST_* directories
--function CleanUp
-+CleanUp()
- {
-    if [ "$BatchMode" -eq 0 ] ; then
-       for i in $TestDirNames
-@@ -448,8 +448,8 @@ function CleanUp
+@@ -408,8 +408,8 @@ function CleanUp
     fi
  }
  
@@ -298,7 +191,7 @@ Index: hypre/src/test/runtest.sh
  {
     rm -f ~/insure.log*
  
-@@ -488,15 +488,15 @@ do
+@@ -461,15 +461,15 @@ do
           ;;
        -D)
           shift
@@ -318,7 +211,7 @@ Index: hypre/src/test/runtest.sh
                 TestDirNames="$TestDirNames $DirPart"
                 case $DirPart in
                    TEST_examples)
-@@ -552,7 +552,7 @@ do
+@@ -532,7 +532,7 @@ do
    for errfile in $( find $dir -name "*.err" )
    do
      if (egrep -f runtest.filters $errfile > /dev/null) ; then
@@ -360,3 +253,23 @@ Index: hypre/src/test/Makefile
   -lHYPRE\
   ${MPILIBFLAGS}\
   ${LAPACKLIBFLAGS}\
+Index: hypre/src/test/checktest.sh
+===================================================================
+--- hypre.orig/src/test/checktest.sh
++++ hypre/src/test/checktest.sh
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #BHEADER**********************************************************************
+ # Copyright (c) 2008,  Lawrence Livermore National Security, LLC.
+ # Produced at the Lawrence Livermore National Laboratory.
+Index: hypre/src/test/cleantest.sh
+===================================================================
+--- hypre.orig/src/test/cleantest.sh
++++ hypre/src/test/cleantest.sh
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #BHEADER**********************************************************************
+ # Copyright (c) 2008,  Lawrence Livermore National Security, LLC.
+ # Produced at the Lawrence Livermore National Laboratory.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/hypre.git



More information about the debian-science-commits mailing list