]> git.ozlabs.org Git - patchwork/commitdiff
parser: Get rid of some code duplication in parsemail-batch.sh
authorGuilherme Salgado <guilherme.salgado@linaro.org>
Mon, 28 Feb 2011 01:54:18 +0000 (01:54 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Wed, 30 Mar 2011 06:31:28 +0000 (14:31 +0800)
Change parsemail-bash.sh to uses parsemail.sh (instead of parsemail.py),
as the former sets the required environment variables that were being
set in parsemail-batch.sh.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/bin/parsemail-batch.sh

index d786022c2742ea76716e7a28350ceb068109d273..31ef4f0a7e4f0ef83b7b1cdb8d7fca8383e53b2e 100755 (executable)
@@ -19,7 +19,7 @@
 # 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 1 ]
 then
@@ -41,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/patchwork/bin/parsemail.py" < \
-               "$mail_dir/$line"
+       $PATCHWORK_BINDIR/parsemail.sh < "$mail_dir/$line"
 done
-
-
-