Magellan Linux

Diff of /trunk/mage/usr/lib/mage/mage4.functions.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2224 by niro, Wed Oct 16 07:46:58 2013 UTC revision 2225 by niro, Wed Oct 16 07:49:19 2013 UTC
# Line 46  mchecksum() Line 46  mchecksum()
46   local method   local method
47   local cmd   local cmd
48   local retval   local retval
49     local sum
50     local dest
51    
52   # very basic getops   # very basic getops
53   for i in $*   for i in $*
# Line 72  mchecksum() Line 74  mchecksum()
74   if [[ -d ${rundir} ]]   if [[ -d ${rundir} ]]
75   then   then
76   pushd ${rundir} &> /dev/null   pushd ${rundir} &> /dev/null
77   # be verbose here  
78   ${cmd} -c ${file} #&> /dev/null   # all file must be non-zero
79   retval="$?"   retval=0
80     while read sum dest
81     do
82     if [ -s ${dest} ]
83     then
84     echo "${dest}: file-size OK"
85     else
86     echo "${dest}: file is empty ;("
87     retval=127
88     fi
89     done < ${file}
90     if [[ ${retval} != 127 ]]
91     then
92     # insert an empty line for cosmetic
93     echo
94    
95     # be verbose here
96     ${cmd} -c ${file} #&> /dev/null
97     retval="$?"
98     fi
99    
100   popd &> /dev/null   popd &> /dev/null
101   else   else
102   retval=1   retval=1

Legend:
Removed from v.2224  
changed lines
  Added in v.2225