From patchwork Fri Jan 2 20:14:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sedat Dilek X-Patchwork-Id: 5560711 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 6E86FBF6C3 for ; Fri, 2 Jan 2015 20:14:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A4E0201FE for ; Fri, 2 Jan 2015 20:14:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F5DC20165 for ; Fri, 2 Jan 2015 20:14:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751818AbbABUOz (ORCPT ); Fri, 2 Jan 2015 15:14:55 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:35025 "EHLO mail-we0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751779AbbABUOz (ORCPT ); Fri, 2 Jan 2015 15:14:55 -0500 Received: by mail-we0-f169.google.com with SMTP id m14so4965390wev.0 for ; Fri, 02 Jan 2015 12:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=hXeG5VkyjGKxaGH1K6PKPEfypw4VlEXFJrQWfLgZX8s=; b=LVUquqGghGg8yqnRwfqOtXnEuPKrMljHRTNz1EJ8sKSErZwICAq15qTtDVp93f1Jit sfpZ3a84PMGHSwvyNCRnOUcnHSXlvTyqlK0HN2MCHhawIEq1tvAv16++19Ijgm4L7aHH /yTD/uZwoLOSgCpBt23vBQN4LgmXFCs8k+GXIfGdJTt8GYdLa7F2DwkbiOLA5rmbxe1X xXyam/S3Vu6WxIkDmBPWJscX5SoMrPNlp0yArqV2yBcrmRi9NTm9y2jYSvI9oF/fzB8G 4fpgXWEoWlby4YmGiz82lalOzf9J6gEBZ5MAuavUxTyyz4L7PTssf5v2voxrprhQe/P1 cjbw== X-Received: by 10.180.205.163 with SMTP id lh3mr686436wic.63.1420229693843; Fri, 02 Jan 2015 12:14:53 -0800 (PST) Received: from fambox.fambox-domain ([46.114.142.33]) by mx.google.com with ESMTPSA id kn5sm65715654wjb.48.2015.01.02.12.14.47 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 Jan 2015 12:14:53 -0800 (PST) From: Sedat Dilek Cc: Sedat Dilek , Ben Hutchings , maximilian attems , Thorsten Glaser , Alexander Wirt , Michal Marek , linux-kbuild@vger.kernel.org Subject: [RFC] builddeb: Try to determine distribution Date: Fri, 2 Jan 2015 21:14:29 +0100 Message-Id: <1420229669-5550-1-git-send-email-sedat.dilek@gmail.com> X-Mailer: git-send-email 2.2.1 To: unlisted-recipients:; (no To-header on input) 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 This is based on ideas of me and Ben. Thanks goes to Thorsten and Alexander for the vital help in 2012. Like in my initial patch [1] lsb_release is used to determine the short codename as distribution name for debian/changelog. Ben gave some helpful and detailed information in [2]. There he also suggested to have an option to explicitly set the distribution (see $KDEB_CHANGELOG_DIST variable). I have hardcoded the script-name when the default distribution is used. This is a bit ugly. This patch is based on the snippet of Ben in [2] and tested against Linux v3.19-rc2. [1] https://lkml.org/lkml/2012/4/23/516 [2] http://marc.info/?l=linux-kbuild&m=142022188322321&w=2 CC: Ben Hutchings CC: maximilian attems CC: Thorsten Glaser CC: Alexander Wirt CC: Michal Marek CC: linux-kbuild@vger.kernel.org Suggested-by: Ben Hutchings Signed-off-by: Sedat Dilek --- scripts/package/builddeb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 5972624..be1f4d7 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -217,9 +217,21 @@ else fi maintainer="$name <$email>" +# Try to determine distribution +codename=$(lsb_release --codename --short) +if [ -n "$KDEB_CHANGELOG_DIST" ]; then + distribution=$KDEB_CHANGELOG_DIST +elif [ -n "$codename" ]; then + distribution=$codename +else + distribution="unstable" + echo "builddeb: Using default distribution of 'unstable' in the changelog" + echo "builddeb: Install lsb-release or set \$KDEB_CHANGELOG_DIST to change this" +fi + # Generate a simple changelog template cat < debian/changelog -linux-upstream ($packageversion) unstable; urgency=low +linux-upstream ($packageversion) $distribution; urgency=low * Custom built Linux kernel.