Patchwork [v2] Get rid of some code duplication in parsemail-batch.sh.

login
register
mail settings
Submitter Guilherme Salgado
Date Feb. 18, 2011, 7:27 p.m.
Message ID <20110218192739.7482.67541.stgit@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/83640/
State Superseded
Headers show

Comments

Guilherme Salgado - Feb. 18, 2011, 7:27 p.m.
It now uses parsemail.sh instead of parsemail.py as the former sets the
required environment variables that were being set in parsemail-batch.sh.
---
 apps/patchwork/bin/parsemail-batch.sh |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
Jeremy Kerr - Feb. 28, 2011, 5:01 a.m.
Hi Guilherme,

> It now uses parsemail.sh instead of parsemail.py as the former sets the
> required environment variables that were being set in parsemail-batch.sh.

Could I have a signoff for this one too? Also, all of your other patches seem 
to be missing the Signed-off-by line too.

Otherwise, this looks good.

Cheers,


Jeremy
Guilherme Salgado - Feb. 28, 2011, 11:55 a.m.
On Mon, 2011-02-28 at 13:01 +0800, Jeremy Kerr wrote:
> Hi Guilherme,
> 
> > It now uses parsemail.sh instead of parsemail.py as the former sets the
> > required environment variables that were being set in parsemail-batch.sh.
> 
> Could I have a signoff for this one too? Also, all of your other patches seem 
> to be missing the Signed-off-by line too.
> 

I've resent it, this time signed.  Sorry for the missing signatures, but
I think I lost them when I started using stgit. I'll make sure to resend
the ones that are not signed.

Cheers,

Patch

diff --git a/apps/patchwork/bin/parsemail-batch.sh b/apps/patchwork/bin/parsemail-batch.sh
index d786022..31ef4f0 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"
+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
-
-
-