From patchwork Tue Mar 27 07:06:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 148867 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id F2D1BB6EE7 for ; Tue, 27 Mar 2012 18:06:57 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 564708B4A7; Tue, 27 Mar 2012 07:06:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X+f3Qlkc6+9S; Tue, 27 Mar 2012 07:06:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6D47F8BE78; Tue, 27 Mar 2012 07:06:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 2C52D8F753 for ; Tue, 27 Mar 2012 07:06:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1ECBB8B274 for ; Tue, 27 Mar 2012 07:06:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pRZ2hHhEWwGR for ; Tue, 27 Mar 2012 07:06:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by whitealder.osuosl.org (Postfix) with ESMTP id 943F78B1DC for ; Tue, 27 Mar 2012 07:06:34 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 7F60A14B; Tue, 27 Mar 2012 09:06:14 +0200 (CEST) Received: from localhost (abo-88-24-68.rns.modulonet.fr [85.68.24.88]) by mail.free-electrons.com (Postfix) with ESMTPSA id 574E7166 for ; Tue, 27 Mar 2012 09:06:01 +0200 (CEST) From: Thomas Petazzoni To: buildroot@busybox.net Date: Tue, 27 Mar 2012 09:06:17 +0200 Message-Id: <38a56718290b5bc37564e53fa9a6c06271024ce4.1332831974.git.thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: References: In-Reply-To: References: Subject: [Buildroot] [PATCH 1/2] microperl: fix MICROPERL_INSTALL_TARGET_CMDS X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net The MICROPERL_INSTALL_TARGET_CMDS used the following construct in a for loop: [ -d $(@D)/lib/$$j ] && cp -af $(@D)/lib/$$j \ $(TARGET_DIR)/$(MICROPERL_MODS_DIR) ; \ [ -f $(@D)/lib/$$i ] && $(INSTALL) -m 0644 -D $(@D)/lib/$$i \ $(TARGET_DIR)/$(MICROPERL_MODS_DIR)/$$i; \ The problem is that when at the last iteration, the second test (-f) fails, then the whole loop ends with a non-zero error code, and makes aborts the build. This happens for example if the last Perl modules in the list is Time::Local, because such modules are taken care of by the first condition (that copies a complete directory). By moving to full if statements, we ensure that the return code is zero even if the condition was false. Signed-off-by: Thomas Petazzoni --- package/microperl/microperl.mk | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package/microperl/microperl.mk b/package/microperl/microperl.mk index d5b5a7c..5bf4a2e 100644 --- a/package/microperl/microperl.mk +++ b/package/microperl/microperl.mk @@ -132,10 +132,12 @@ define MICROPERL_INSTALL_TARGET_CMDS $(MICROPERL_BUILD_EXTENSIONS) for i in $(MICROPERL_MODS); do \ j=`echo $$i|cut -d : -f 1` ; \ - [ -d $(@D)/lib/$$j ] && cp -af $(@D)/lib/$$j \ - $(TARGET_DIR)/$(MICROPERL_MODS_DIR) ; \ - [ -f $(@D)/lib/$$i ] && $(INSTALL) -m 0644 -D $(@D)/lib/$$i \ - $(TARGET_DIR)/$(MICROPERL_MODS_DIR)/$$i; \ + if [ -d $(@D)/lib/$$j ] ; then \ + cp -af $(@D)/lib/$$j $(TARGET_DIR)/$(MICROPERL_MODS_DIR) ; \ + fi ; \ + if [ -f $(@D)/lib/$$i ] ; then \ + $(INSTALL) -m 0644 -D $(@D)/lib/$$i $(TARGET_DIR)/$(MICROPERL_MODS_DIR)/$$i; \ + fi ; \ done # Remove test files find $(TARGET_DIR)/$(MICROPERL_MODS_DIR) -type f -name *.t \