]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/bin/parsemail-batch.sh
Use generic email confirmation object
[patchwork] / apps / patchwork / bin / parsemail-batch.sh
old mode 100644 (file)
new mode 100755 (executable)
index dbf81cc..31ef4f0
@@ -19,9 +19,9 @@
 # along with Patchwork; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-PATCHWORK_BASE="/srv/patchwork"
+PATCHWORK_BINDIR=`dirname $0`
 
-if $# -ne 2
+if [ $# -ne 1 ]
 then
        echo "usage: $0 <dir>" >&2
        exit 1
@@ -29,9 +29,11 @@ fi
 
 mail_dir="$1"
 
-if ! -d "$mail_dir"
+echo "dir: $mail_dir"
+
+if [ ! -d "$mail_dir" ]
 then
-       echo "$mail_dir should be a directory"?&2
+       echo "$mail_dir should be a directory"? >&2
        exit 1
 fi
 
@@ -39,11 +41,5 @@ ls -1rt "$mail_dir" |
 while read line;
 do
        echo $line
-       PYTHONPATH="$PATCHWORK_BASE/apps":"$PATCHWORK_BASE/lib/python" \
-               DJANGO_SETTINGS_MODULE=settings \
-               "$PATCHWORK_BASE/apps/patchworkbin/parsemail.py" <
-               "$mail_dir/$line"
+       $PATCHWORK_BINDIR/parsemail.sh < "$mail_dir/$line"
 done
-
-
-