From patchwork Thu Oct 1 14:49:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Voss, Samuel M Collins via buildroot" X-Patchwork-Id: 1375122 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=busybox.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=distech-controls.com header.i=@distech-controls.com header.a=rsa-sha256 header.s=pps-02182019 header.b=p23ZAgRh; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=distech-controls.com header.i=@distech-controls.com header.a=rsa-sha256 header.s=selector1 header.b=mYHgSY9V; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C2GGs57bXz9sPB for ; Fri, 2 Oct 2020 00:49:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4BB24862FC; Thu, 1 Oct 2020 14:49:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ivNIbDUVJvh0; Thu, 1 Oct 2020 14:49:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7052085039; Thu, 1 Oct 2020 14:49:06 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 71D091BF2BA for ; Thu, 1 Oct 2020 14:49:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6E2BC86918 for ; Thu, 1 Oct 2020 14:49:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g4N0ATeJdSEg for ; Thu, 1 Oct 2020 14:49:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx0a-002ab301.pphosted.com (mx0a-002ab301.pphosted.com [148.163.150.161]) by whitealder.osuosl.org (Postfix) with ESMTPS id BBBCF84540 for ; Thu, 1 Oct 2020 14:49:04 +0000 (UTC) Received: from pps.filterd (m0118792.ppops.net [127.0.0.1]) by mx0a-002ab301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 091Ejvtx005880 for ; Thu, 1 Oct 2020 10:49:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=distech-controls.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps-02182019; bh=HXZXmh+i1QRTVK5fnpS9bcrZ7UMLAxJ04hS6gXda4TI=; b=p23ZAgRhMzhJWEkX6WMu8s250AfLOQlsHnW3hxWMyFX1iMb7jpKLJjcKA52MVEfhKA8M /xgb+SUAeeE9+xswdEUQQAn8WHQ98XxVkaWoE+vJ+a0pkjjGdK30YW6HyG/gSe6mxweT x+7B8XbAgV4l6bungyEwu6IfbLG5F02bPrpvw2mWf5l9vB8ZVc4RZxHqPWoI/69ePJNo CphDte2XphWrr5rljgj/77NKR0gEOIgHKrDPpmotTXAu99H9RY4OOfrSv/JYiFAgLFIJ 6rdDmEXxUH6/F5MIg1ZfpSwKbwJ4OLCGFb+qOcLQFX8arsWi8W/JDUWwGZ5GfkdK6WD6 IQ== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2106.outbound.protection.outlook.com [104.47.58.106]) by mx0a-002ab301.pphosted.com with ESMTP id 33t1c74h1s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 01 Oct 2020 10:49:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kp70vANd3CaW1x3O91CVPLs40ZvXPI2EmeRa734e0GTrm5mQVe8Cg9jo4ajizAC86KabgjA+hLLBTvxSjPv0H25gs1EPLR3i+F4L9XmNnn58B0t799I+IYY/507IKgASqfihB/1ZaEl4kvT47z8D8O6qdYJRMBQPc1+ONhr3+mP9ap1D4J4XLmYCJvXYKTLxGGImqIeWdODbLEyhQqY93jb8X7xk1qGadsnkhDGc/QSkdA+oMfDrgzNEBC5EuSl4XndJMNtw7FfL8rAPuTGr080sJ/gf4UlsOkqfyoH8DERHrVuil/HFDbpVbWL94L0/oKwYc2DaulwfgDFVmppVSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HXZXmh+i1QRTVK5fnpS9bcrZ7UMLAxJ04hS6gXda4TI=; b=Ft44OPKfI1BpzsM9d/OlQ6qeFm3dhKzhM1iZBskv2tQNimi0JreFnpaCYV6oz6jSFi+8Bl0dPQ8c8Gba6/BN0+cDY56LT1GTR34lG5T4GSh+1STp+kwiJ8eRhkJ9ZvbhIyGbV8uxyCyB04jHYLxz7pnHleC4NCwnrmA5ROjuuNEV4MQDDhWyn/zKiZ0LYosYpduO9E4UA5zyur3+aHLBNFIxJ7ccQBxWWzwCLM1WGdSBes9yeKbnPt9wcNkRsiRXl/I3f8740Ne0SFGwa8miWlLoA+wB5Hj8l+qG7LXdGhhedt/GcpaIJ0TRLIMQr3d3rDsRbN5zwN0DUHCXy9qL0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=distech-controls.com; dmarc=pass action=none header.from=distech-controls.com; dkim=pass header.d=distech-controls.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=distech-controls.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HXZXmh+i1QRTVK5fnpS9bcrZ7UMLAxJ04hS6gXda4TI=; b=mYHgSY9VAqE104uGkqNElQy5O/+/+889v0rj6ULbQiX0hUS8E+p/g+pQGMwis/E1Z5WmCDoFkXxNddLcDUnXmNGA62dsT7Pj0QnDoA/LgeUHGa5VAfWGpjhk7D8PRAB9P9dIBPaWDX2uK6zGDWYkVL7CpJT2/zZz+R30/9ohOl8= Received: from DM6PR01MB4137.prod.exchangelabs.com (2603:10b6:5:2a::30) by DM6PR01MB5370.prod.exchangelabs.com (2603:10b6:5:151::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.23; Thu, 1 Oct 2020 14:49:02 +0000 Received: from DM6PR01MB4137.prod.exchangelabs.com ([fe80::1cba:c332:100d:2efb]) by DM6PR01MB4137.prod.exchangelabs.com ([fe80::1cba:c332:100d:2efb%2]) with mapi id 15.20.3433.038; Thu, 1 Oct 2020 14:49:02 +0000 To: "buildroot@buildroot.org" Thread-Topic: [PATCH 1/1] Set external version into os-release Thread-Index: AQHWjQfotP9GddYugUSGIFBZGr4zZ6mC6bFA Date: Thu, 1 Oct 2020 14:49:02 +0000 Message-ID: References: <20200917153243.8745-1-etouhtarian@distech-controls.com> In-Reply-To: <20200917153243.8745-1-etouhtarian@distech-controls.com> Accept-Language: fr-FR, en-US Content-Language: fr-FR X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mib-plugin: true authentication-results: buildroot.org; dkim=none (message not signed) header.d=none;buildroot.org; dmarc=none action=none header.from=distech-controls.com; x-originating-ip: [92.137.19.212] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 141c9d29-2c17-4e30-17f9-08d866192312 x-ms-traffictypediagnostic: DM6PR01MB5370: x-microsoft-antispam-prvs: x-pp-identifier: acuityo365 x-ms-oob-tlc-oobclassifiers: OLM:125; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P6hh6BXGTLb78YsJ+2pOdKYSU0op9uztqMuihNbTPRMtkDHpRShJ+heC6Yw4N4wRL9TbSYAiQDTZyj/N+lrCqvocS3UhRQzdMqzZ1AJraHzMK7LZ5L0QjPar2gHwoKcOlkNah+kJK5bumM9PtBDILx3Rv0mqQCh4JQiF2jD/hybY7eRlqil7jchGsWgFb/PsQVErx2Rf9zIoKYIdZ3R9MtPvx5CBpsVz76NMqvHyckA0f4pZRsOhzkwv8qLa7sYp1Nj/byow3bx6Zbrjp5LTqvE7DiD7BQGI8v6XyM0IIl10w4AHo3dRwgXUTtIeuYT+gh4CrFj7glM8eGFaiCRTHSuPxaW6TYBIvw3tpWyl+ENdAtl5op3nn++luO5n9lKt x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR01MB4137.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(136003)(366004)(376002)(346002)(8676002)(9686003)(6916009)(8936002)(52536014)(76116006)(478600001)(66946007)(5660300002)(26005)(86362001)(71200400001)(33656002)(7696005)(186003)(55016002)(66446008)(6506007)(66556008)(64756008)(66476007)(83380400001)(2906002)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: ntrbricgwQ16VD7W73zzz6cib+dR/Rfuqfn0vQm1buQhZk7vYSfKxqyyWp8XYf/JuKH86/ECWrMb8+iq4BgeE3t3SD/6vg+uDVH1cfTFcjoqgNKR7jOGHwL3LqDV2erXGTBGnMO8wGUKrvox2yRPNMoDEEx04KXtMiSRYqJ+H0XKINzFiHs20fJi7AyITrGAEtdv3KvA1BtN3tEzb477lpr8BfkDWGSUWFoFAgc8zP9jopZgsMeGM6yqIqxc347yajNncmWmQbVtYi7dhmHzY57OXUTIhX5tnPCYmNHwgO3wBerfWn/acKykzjIYrDFSABOuqM/BYR8fWTLNds0Bybc5q8cS/knM+B5/w7+21qm1FphUVUW8Kom/RiaONib/7L2LcoLJyTax1NTzvNUXROW/y/VoT2e9aMRVwh/ZiuDCY6kc56FZ7V3Nw0wOEqtBFVYisyNg2oYstbdEufAlf7Vs0GsuXwwso+Z2lH3vcJ9/nQdMtD5lrLxYTWJaBdTwobLjVGvJyQo4nXQvgrZGCoL1gLiXJlF52cRVmgEXZL4WLCihQMXsU8YAcFE33QZgcAAk6FRMs7+Uq92odCrYECEvzfgwbJzAKqG7FvLoxVqSRW9X9C4kTw/U+zXLtjtzCro4iwsTIZgFHle/sKzLwA== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: distech-controls.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB4137.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 141c9d29-2c17-4e30-17f9-08d866192312 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2020 14:49:02.0815 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: caadbe96-024e-4f67-82ec-fb28ff53d16d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jHDeyvHax9Q8A1bOMtC1Xr3dvZOmWAO1b0jGfAQoiz0EIqiaLJiachV76M4qnXgDEgAUisBr4UvZ3OqAXaIDlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB5370 X-Proofpoint-Processed: True X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 clxscore=1015 spamscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 phishscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010010127 Subject: [Buildroot] TR: [PATCH 1/1] Set external version into os-release X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "Touhtarian, Eric via buildroot" Reply-To: "Touhtarian, Eric" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Eric Touhtarian --- Makefile | 16 ++++++++++++++-- support/scripts/setlocalversion | 15 ++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index b2afe5bcfb..e6693d2f45 100644 --- a/Makefile +++ b/Makefile @@ -111,9 +111,12 @@ CONFIG_CONFIG_IN = Config.in CONFIG = support/kconfig DATE := $(shell date +%Y%m%d) +define setlocalversion +$(shell $(TOPDIR)/support/scripts/setlocalversion $(1) $(2)) endef # Compute the full local version string so packages can use it as-is # Need to export it, so it can be got from environment in children (eg. mconf) -export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion) +export BR2_VERSION_FULL := $(BR2_VERSION)$(call setlocalversion) # List of targets and target patterns for which .config doesn't need to be read in noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \ @@ -740,6 +743,14 @@ host-finalize: $(PACKAGES) $(HOST_DIR) $(HOST_DIR_SYMLINK) .PHONY: staging-finalize staging-finalize: $(STAGING_DIR_SYMLINK) +define set-external-info +index=1; \ +$(foreach ext, $(BR2_EXTERNAL_DIRS), \ + echo "EXTERNAL_$${index}_PATH=$(ext)"; \ + echo "EXTERNAL_$${index}_VERSION=\"$(call setlocalversion,"--unmodify-version", $(ext))\""; \ + index=$$(expr $$index + 1); ) +endef + .PHONY: target-finalize target-finalize: $(PACKAGES) $(TARGET_DIR) host-finalize @$(call MESSAGE,"Finalizing target directory") @@ -779,7 +790,8 @@ endif echo "VERSION=$(BR2_VERSION_FULL)"; \ echo "ID=buildroot"; \ echo "VERSION_ID=$(BR2_VERSION)"; \ - echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\"" \ + echo "PRETTY_NAME=\"Buildroot $(BR2_VERSION)\""; \ + $(call set-external-info) \ ) > $(TARGET_DIR)/usr/lib/os-release ln -sf ../usr/lib/os-release $(TARGET_DIR)/etc diff --git a/support/scripts/setlocalversion b/support/scripts/setlocalversion index b39b751f03..459b4765fa 100755 --- a/support/scripts/setlocalversion +++ b/support/scripts/setlocalversion @@ -10,10 +10,16 @@ # usage() { - echo "Usage: $0 [srctree]" >&2 + echo "Usage: $0 [--unmodify-version] [srctree]" >&2 exit 1 } +original_ver=false +if test "$1" = "--unmodify-version"; then + original_ver=true + shift +fi + cd "${1:-.}" || usage # Check for git and a git repo. @@ -26,8 +32,11 @@ if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then # If we are past a tagged commit (like "v2.6.30-rc5-302-g72357d5"), # we pretty print it. if atag="`git describe 2>/dev/null`"; then - echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' - + if $original_ver; then + printf $atag + else + echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' + fi # If we don't have a tag at all we print -g{commitish}. else printf '%s%s' -g $head