X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=apps%2Fpatchwork%2Fbin%2Fparsemail-batch.sh;h=31ef4f0a7e4f0ef83b7b1cdb8d7fca8383e53b2e;hb=c237b832d7bfa9bad2ba76e89888dcbfa4c924dc;hp=dbf81cc81d5fa36f2bc2d80af60c4d20ae50ed66;hpb=c561ebe710d6e6a43aa4afc6c2036a215378ce87;p=patchwork diff --git a/apps/patchwork/bin/parsemail-batch.sh b/apps/patchwork/bin/parsemail-batch.sh old mode 100644 new mode 100755 index dbf81cc..31ef4f0 --- a/apps/patchwork/bin/parsemail-batch.sh +++ b/apps/patchwork/bin/parsemail-batch.sh @@ -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 " >&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 - - -