From patchwork Wed Feb 16 13:32:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guilherme Salgado X-Patchwork-Id: 83364 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 5EAD5B712A for ; Thu, 17 Feb 2011 00:32:13 +1100 (EST) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by ozlabs.org (Postfix) with ESMTP id 710FDB6EDF for ; Thu, 17 Feb 2011 00:32:12 +1100 (EST) Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1PphUI-0007gt-0R; Wed, 16 Feb 2011 13:32:10 +0000 Received: from [187.126.171.60] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PphUH-0007hl-Fi; Wed, 16 Feb 2011 13:32:09 +0000 From: Guilherme Salgado To: patchwork@lists.ozlabs.org Subject: [PATCH] Fix parsemail-batch.sh Date: Wed, 16 Feb 2011 11:32:04 -0200 Message-Id: <1297863124-9023-1-git-send-email-guilherme.salgado@linaro.org> X-Mailer: git-send-email 1.7.1 Cc: patches@linaro.org X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org 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 --- 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 - - -