It was broken because it was using 'ls -l' as the input for the while loop,
which means the file modes, owner and times ended up together with the file
names themselves.

I also changed it to use 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 <[email protected]>
---
 apps/patchwork/bin/parsemail-batch.sh |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/apps/patchwork/bin/parsemail-batch.sh 
b/apps/patchwork/bin/parsemail-batch.sh
index d786022..903bf95 100755
--- a/apps/patchwork/bin/parsemail-batch.sh
+++ b/apps/patchwork/bin/parsemail-batch.sh
@@ -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"
+HERE=`dirname $0`
 
 if [ $# -ne 1 ]
 then
@@ -37,15 +37,9 @@ then
        exit 1
 fi
 
-ls -1rt "$mail_dir" |
+ls -rt "$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"
+       $HERE/parsemail.sh < "$mail_dir/$line"
 done
-
-
-
-- 
1.7.1

_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork

Reply via email to