From patchwork Fri Apr 10 13:15:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 6195561 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50D5ABF4A6 for ; Fri, 10 Apr 2015 13:15:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DF882037E for ; Fri, 10 Apr 2015 13:15:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41CDF20220 for ; Fri, 10 Apr 2015 13:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932928AbbDJNPb (ORCPT ); Fri, 10 Apr 2015 09:15:31 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:34778 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932545AbbDJNPb (ORCPT ); Fri, 10 Apr 2015 09:15:31 -0400 Received: by lbcga7 with SMTP id ga7so13411728lbc.1 for ; Fri, 10 Apr 2015 06:15:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=E2U20C8uDyx6wByK5+AhTQ5d62C/4oi/1znTpmfHwe4=; b=ZAJIzx9/6GqOUHQiPFrHmdpph3xfadsmvYaaWDce8Kfj+KbdL18Qw4KDFi9+Fzg3Ql hsNXGRKbV4paqCIcw2clL0V2iex05TFldeWNdhwce83ZJVftBiNKb/KxCdAzu98GSFVJ ekRxKWMmggf2VCsULCFfQtvdPl6iXPgtbCsurWE6kimTIj3mKC0nIyJbShk/VtgcQIE2 8oJm80UMq2mDK3oyA7q0WlLdNmYwDjQ5G/Vem4caTlzR3kNuuR/t49TuyG/Ia4Or/yFK Qr7LJ4Wh/NHgyuASkVudIgVREVXsqCIwdsIn/AJNWWunue7kpG1I5Aaz49G0EnqZq1h/ B1bA== X-Gm-Message-State: ALoCoQl/aWjqLLzvJ0hgfpYknkvJBelY30XW2GYKBMW7QkOvn2HuCkCcohN3bEEZmGh+rSEL3MuP X-Received: by 10.112.72.2 with SMTP id z2mr1386607lbu.39.1428671729637; Fri, 10 Apr 2015 06:15:29 -0700 (PDT) Received: from localhost.localdomain (91-157-196-38.elisa-laajakaista.fi. [91.157.196.38]) by mx.google.com with ESMTPSA id jp18sm453817lab.34.2015.04.10.06.15.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Apr 2015 06:15:28 -0700 (PDT) From: riku.voipio@linaro.org To: linux-kbuild@vger.kernel.org, mmarek@suse.cz, debian-kernel@lists.debian.org Cc: Riku Voipio Subject: [PATCH 1/2] deb-pkg: move setting debarch for a separate function Date: Fri, 10 Apr 2015 16:15:13 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Riku Voipio create_package() function tries to resolve used architecture for everry package. Split the setting the architecture to a new function, set_debarch(), called once on startup. This allows using debarch from other parts of script as needed. --- scripts/package/builddeb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/package/builddeb b/scripts/package/builddeb index a9858a4..e397815 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -27,8 +27,15 @@ create_package() { chown -R root:root "$pdir" chmod -R go-w "$pdir" + # Create the package + dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir" + dpkg --build "$pdir" .. +} + +set_debarch() { # Attempt to find the correct Debian architecture - local forcearch="" debarch="" + forcearch="" + debarch="" case "$UTS_MACHINE" in i386|ia64|alpha) debarch="$UTS_MACHINE" ;; @@ -73,10 +80,8 @@ create_package() { if [ -n "$debarch" ] ; then forcearch="-DArchitecture=$debarch" fi + export forcearch debarch - # Create the package - dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch:-$(dpkg --print-architecture)}" -p$pname -P"$pdir" - dpkg --build "$pdir" .. } # Some variables and settings used throughout the script @@ -99,6 +104,7 @@ kernel_headers_packagename=linux-headers-$version libc_headers_packagename=linux-libc-dev dbg_packagename=$packagename-dbg tools_packagename=linux-tools-$version +set_debarch if [ "$ARCH" = "um" ] ; then packagename=user-mode-linux-$version