From patchwork Wed May 2 20:01:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Malaterre X-Patchwork-Id: 10376403 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B43F9603B4 for ; Wed, 2 May 2018 20:03:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9295E2900F for ; Wed, 2 May 2018 20:03:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E54D28FCF; Wed, 2 May 2018 20:03:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD96628FCF for ; Wed, 2 May 2018 20:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751558AbeEBUBz (ORCPT ); Wed, 2 May 2018 16:01:55 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:35047 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751551AbeEBUBw (ORCPT ); Wed, 2 May 2018 16:01:52 -0400 Received: by mail-wr0-f195.google.com with SMTP id i14-v6so12105490wre.2; Wed, 02 May 2018 13:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=g5EM2kYMRle2nsvokU3tVk7KnTrtpg6Z/UkqGKR7KSA=; b=QnxsBrQJTgLXjekttVNVlNQMXwJRf/ztdB7uM0ilN0SsawaAekN0ZwyrB9cZZKWpJ1 AZ0pxtsBkNWyijZ9S1RUmCYxMFu1ZLlJOfKZioDI39JhldE0T67qWP3ejkZJ7jteQZjd jQzq8nsAbtOIf3Zis+VP5C0m/0h8jFP58Q2ojgQvH0seYVziBEIiboFDQsafvk+/G2vm AoTl5VAjr61Gbh+TcN0ztQ4aTEpFbDug/JWBqYtdV2V24XTrS19ugGwPPLJJ0P/v6Jq3 11QckdNh24r612ll84mH6Hj9MgMWZELtpEHl+Hd9cC2daPEyPtBnFuWIHy43OjDXGbi2 mJqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=g5EM2kYMRle2nsvokU3tVk7KnTrtpg6Z/UkqGKR7KSA=; b=KP+7+zwx7+QU1al3Qcfp3N9bgcSxURKKqm+TC57tc3F1VrOkAtqVOHhIeCnzdZ62O1 5uxps6hZF5+CKGRzkivSdbA0EppoTx0G/RQUlwtTwXcyI2Bp3oDyFtN5SjjRCRFJvq8X zplrPhc6hBzPpJi62bqVa3RccWelkSmi5W/XVhfW9O7bCpRLCP3rZoqR2M0pzPrgVFWD uUiKJnE7m+VnIWjElQibVqliRsUjneaficYDbueA9F3qgPZUsm9Azl3BVaIkeV+oJDXj DGBfeVdORV846wwRGQjJP9THl1Rv17BJp9uv6cAiDn1BEZKTG+CMd8v8/y5eCvL1nnhA XskA== X-Gm-Message-State: ALQs6tD4pP0rjYMXoTDcGZV5w94lyCNAriyk0E1lPWgQGX0ebWB5r5lX usXzq00MFu19IvQ+FnWi7d60RjXM X-Google-Smtp-Source: AB8JxZpGRBci2lwCHnUHYCUeFhcimSUp18GQXtY87soWM4CAc/DpT7Nj5I+6X/h2krvpoJijTcbUZQ== X-Received: by 2002:adf:860d:: with SMTP id 13-v6mr16615459wrv.12.1525291310580; Wed, 02 May 2018 13:01:50 -0700 (PDT) Received: from macbookpro.malat.net (bru31-1-78-225-226-121.fbx.proxad.net. [78.225.226.121]) by smtp.gmail.com with ESMTPSA id a10-v6sm16011940wri.10.2018.05.02.13.01.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 13:01:49 -0700 (PDT) Received: by macbookpro.malat.net (Postfix, from userid 1000) id 8617E10C04D9; Wed, 2 May 2018 22:01:48 +0200 (CEST) From: Mathieu Malaterre To: Masahiro Yamada Cc: malat@debian.org, Riku Voipio , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] kbuild/debian: Use KBUILD_BUILD_* when set Date: Wed, 2 May 2018 22:01:36 +0200 Message-Id: <20180502200137.6870-1-malat@debian.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180423195055.26069-1-malat@debian.org> References: <20180423195055.26069-1-malat@debian.org> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Be nice to the user and check env vars KBUILD_BUILD_USER & KBUILD_BUILD_HOST when those are set. Since DEBEMAIL accept a syntax where the full name is present, be extra nice to user and extract email address only. Cc: Riku Voipio Cc: Masahiro Yamada Signed-off-by: Mathieu Malaterre --- v2: update patch since syntax of DEBEMAIL may contain full name scripts/package/mkdebian | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index 6adb3a16ba3b..3f4e43446db3 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian @@ -73,9 +73,19 @@ fi # Try to determine maintainer and email values if [ -n "$DEBEMAIL" ]; then - email=$DEBEMAIL + case "$DEBEMAIL" in + *\ * ) + email=$(echo $DEBEMAIL | cut -d '<' -f2 | cut -d '>' -f1) + echo >&2 "Extracting email from DEBEMAIL. Use DEBFULLNAME instead." + ;; + *) + email=$DEBEMAIL + ;; + esac elif [ -n "$EMAIL" ]; then email=$EMAIL +elif [ -n "$KBUILD_BUILD_USER" ] && [ -n "$KBUILD_BUILD_HOST" ]; then + email=$KBUILD_BUILD_USER@$KBUILD_BUILD_HOST else email=$(id -nu)@$(hostname -f 2>/dev/null || hostname) fi