/[MITgcm]/mitgcm.org/front_content/parse_emails
ViewVC logotype

Diff of /mitgcm.org/front_content/parse_emails

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

revision 1.26 by jmc, Fri Jan 11 20:49:13 2013 UTC revision 1.27 by jmc, Sat Mar 11 23:04:33 2017 UTC
# Line 130  fi Line 130  fi
130  #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
131    
132  all_msg=`ls -1 $INDIR`  all_msg=`ls -1 $INDIR`
133  nb_files=`echo "$all_msg" | grep -c '^msg\.'`  nb_msg=`echo "$all_msg" | grep -c '^msg\.'`
134    nb_tar=`echo "$all_msg" | grep -c '\.tar\.gz$'`
135    nb_files=`expr $nb_msg + $nb_tar`
136    
137  if test $PRT = 2 ; then  if test $PRT = 2 ; then
138    echo "Using OUTDIR=\"$OUTDIR\""    echo "Using OUTDIR=\"$OUTDIR\""
139    echo "Using INDIR=\"$INDIR\""    echo "Using INDIR=\"$INDIR\""
140    echo -n "Unpacking $nb_files emails ("`date`    echo -n "Unpacking $nb_msg msg + $nb_tar tar-file ("`date`
141    if test "x$ADDRERR" != x ; then    if test "x$ADDRERR" != x ; then
142       echo -n ", err-msg: '$ADDRERR'"       echo -n ", err: $ADDRERR"
143    fi    fi
144    echo ")"    echo ")"
145  elif test $nb_files != 0 ; then  elif test $nb_files != 0 ; then
146    echo -n "Unpacking $nb_files emails ("`date`    echo -n "Unpacking $nb_msg msg + $nb_tar tar-file ("`date`
147    if test "x$ADDRERR" != x ; then    if test "x$ADDRERR" != x ; then
148       echo -n ", err-msg: '$ADDRERR'"       echo -n ", err: $ADDRERR"
149    fi    fi
150    echo ")"    echo ")"
151    echo " from '$INDIR' to '$OUTDIR'"    echo " from '$INDIR' to '$OUTDIR'"
# Line 160  for xx in $all_msg Line 162  for xx in $all_msg
162  do  do
163    in=`grep -c $xx $TR_LIST`    in=`grep -c $xx $TR_LIST`
164    if test $in = 0 ; then    if test $in = 0 ; then
165      np=`grep -c 'Content-Type: message/partial' $INDIR/$xx`      it=`echo $xx | grep -c '\.tar\.gz$'`
166      if test $np = 0 ; then      if test $it = 1 ; then
167        echo $xx >> $TR_LIST          echo $xx >> $TR_LIST
168      else      else
169        l=`sed -n '/Content-Type: message\/partial/=' $INDIR/$xx`        np=`grep -c 'Content-Type: message/partial' $INDIR/$xx`
170        lp=`expr $l + 1`        if test $np = 0 ; then
171        id=`sed -n "$lp p" $INDIR/$xx`          echo $xx >> $TR_LIST
172        partM=`( cd $INDIR ; grep -c "$id" msg.* | grep -v ':0$' | sed 's/:1$//' )`        else
173        echo $partM >> $TR_LIST          l=`sed -n '/Content-Type: message\/partial/=' $INDIR/$xx`
174        if test "x$ADDRERR" != x ; then flag=1          lp=`expr $l + 1`
175          echo "multi-parts message:" $partM >> $ERRMSG          id=`sed -n "$lp p" $INDIR/$xx`
176          ( cd $INDIR ; ls -l $partM ) >> $ERRMSG          partM=`( cd $INDIR ; grep -c "$id" msg.* | grep -v ':0$' | sed 's/:1$//' )`
177            echo $partM >> $TR_LIST
178            if test "x$ADDRERR" != x ; then flag=1
179              echo "multi-parts message:" $partM >> $ERRMSG
180              ( cd $INDIR ; ls -l $partM ) >> $ERRMSG
181            fi
182        fi        fi
183      fi      fi
184    fi    fi
# Line 213  while [ $n -lt $Nbl ] ; do Line 220  while [ $n -lt $Nbl ] ; do
220        continue        continue
221      fi      fi
222    
223    #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
224      it=`echo $grpM | grep -c '\.tar\.gz$'`
225      if test $it = 1 ; then
226        #- nothing to do: already a tar file!
227        trOutp=$grpM ; prcM=$grpM
228      else
229    
230      #-check that we have all the parts      #-check that we have all the parts
231      if [ $PRT -ge 1 -a $nm -gt 1 ] ; then      if [ $PRT -ge 1 -a $nm -gt 1 ] ; then
232        echo " group (nm=$nm) of multi-parts msg: '$grpM'"        echo " group (nm=$nm) of multi-parts msg: '$grpM'"
# Line 361  while [ $n -lt $Nbl ] ; do Line 375  while [ $n -lt $Nbl ] ; do
375            if test -f $TEMPDIR/$trOutp ; then ls -l $TEMPDIR/$trOutp ; fi            if test -f $TEMPDIR/$trOutp ; then ls -l $TEMPDIR/$trOutp ; fi
376      fi      fi
377    
378      fi
379  #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
380    
381      #-- un-tar      #-- un-tar

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.22