From patchwork Thu Jan 7 08:59:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Spooren X-Patchwork-Id: 1423195 X-Patchwork-Delegate: mail@aparcar.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aparcar.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=GA3RGzAE; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DBKyR0pwWz9sVm for ; Thu, 7 Jan 2021 20:03:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=yNkQcZr9Y+LBnnsyvCJ9zogiyWBMyj79IuCL0GxyIL8=; b=GA3RGzAEgnDMXtONzGi/+BA/Ge THKbtoraYiosEkKtJOpxYMnYxiAjf3Bua3oRBlkvzM592SSF819kL2RdLnGoBYMpqLLXFn440dcHG ai8sQETir9wfgnwT/1YlydkvJoOTBnw7qjNL2rujESSJHR/sdUGYntalybEdxd5dwKefTG/NNSony +W7Js6GOJWKEwnF/z+0GjYxyP+VfUZAtNtPFM824KKQpjqiq74Z9u8ruSH0OQkfRefQG6SB3N0DRl LfB+QUNRSj2nkMausF0r1izgy6Hi+0q7L92zXoQdBI0CVpc21JyWuN7a9l9y8Pb0ZFjOm6BegFdI4 GzFYDwWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxR9m-0003F4-Gj; Thu, 07 Jan 2021 09:00:34 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxR9i-0003E2-SC for openwrt-devel@lists.openwrt.org; Thu, 07 Jan 2021 09:00:31 +0000 X-Originating-IP: 72.235.129.18 Received: from dawn.lan (udp100268uds.hawaiiantel.net [72.235.129.18]) (Authenticated sender: mail@aparcar.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id F1C77E0005; Thu, 7 Jan 2021 09:00:25 +0000 (UTC) From: Paul Spooren To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/3] rules: add commitcount function Date: Wed, 6 Jan 2021 22:59:46 -1000 Message-Id: <20210107085947.1355642-1-mail@aparcar.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210107_040031_012778_4EEC5612 X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.196 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [217.70.183.196 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Spooren Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org `commitcount` returns the number of commits affecting the current folder. The newly added function can be used for packages that do not follow a traditional versioning schema, most prominent `base-files` which requires tedious `PKG_RELEASE` bumps. Below a naming example: base-files_1399-r15385+75-c5d033a34d_x86_64.ipk In cases where no Git system is used, a folder timestamp is used in combination with the hardcoded $(REVISION) variable (set in releases). base-files_210107.30634-r1538581-c5d033a34d_x86_64.ipk Signed-off-by: Paul Spooren --- rules.mk | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/rules.mk b/rules.mk index f79340b124..8ccecb89d5 100644 --- a/rules.mk +++ b/rules.mk @@ -408,6 +408,28 @@ endef # file extension ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1))) +define commitcount + $(shell \ + if git log -1 >/dev/null 2>/dev/null; then \ + set -- $$(git rev-list --count HEAD .); \ + if [ -n "$$1" ]; then + echo "$$1"; \ + else \ + echo "unknown"; \ + fi; \ + else \ + ts=$$(find . -type f -printf '%T@\n' 2>/dev/null | sort -rn | head -n1 | cut -d. -f1); \ + if [ -n "$$ts" ]; then \ + secs="$$(($$ts % 86400))"; \ + date="$$(date --utc --date="@$$ts" "+%y%m%d")"; \ + printf '%s.%05d' "$$date" "$$secs"; \ + else \ + echo "unknown"; \ + fi; \ + fi \ + ) +endef + all: FORCE: ; .PHONY: FORCE From patchwork Thu Jan 7 08:59:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Spooren X-Patchwork-Id: 1423194 X-Patchwork-Delegate: mail@aparcar.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aparcar.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=jQAjrz3/; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DBKyP01S9z9sS8 for ; Thu, 7 Jan 2021 20:03:08 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jookOsBdaHs4NKJWsYAX7gT9PHskwAaAS3MtlSb24qs=; b=jQAjrz3/8gdkJYCf/PZzUeK6e Z8dwFdjDmv8mlt9bdhQ25WYj9kKWMAvG+GO2fFDLu+5swsIaMnrkfn5hRS1QQwb2oPWYm/jfpta2q L7FSn+qz/YukZFMCrq7XNKSxvf/Mt4aTG4Vc8aPNdtTBDQfteL0DO4naHuZB8xjO8e3jqCISksMFM g9qBFhqQgrLNF1TqmtlnD6tklsmVK3V3JN8xqN1UgJuNY6aMIcMwbJ1SUIg1Y099cgELbZgjZiw1e LfGWvOlZ3rPVx4x0Ycik6AMZ+UbCFdnc+G2pyFpQrW/NBSnJqG3jhXagw0u7WLeYHK5dyVg6rw0O0 ao1gcZ27g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxR9s-0003Hr-0b; Thu, 07 Jan 2021 09:00:40 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxR9j-0003EK-BM for openwrt-devel@lists.openwrt.org; Thu, 07 Jan 2021 09:00:32 +0000 X-Originating-IP: 72.235.129.18 Received: from dawn.lan (udp100268uds.hawaiiantel.net [72.235.129.18]) (Authenticated sender: mail@aparcar.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id 58CAAE0019; Thu, 7 Jan 2021 09:00:27 +0000 (UTC) From: Paul Spooren To: openwrt-devel@lists.openwrt.org Subject: [PATCH 2/3] base-files: replace PKG_RELEASE with commitcount Date: Wed, 6 Jan 2021 22:59:47 -1000 Message-Id: <20210107085947.1355642-2-mail@aparcar.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210107085947.1355642-1-mail@aparcar.org> References: <20210107085947.1355642-1-mail@aparcar.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210107_040031_511249_55EA765C X-CRM114-Status: GOOD ( 10.27 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.196 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [217.70.183.196 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Spooren Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The newly added `commitcount` function does automatic versioning based on the number of Git commits of a package. Replace *tedious to bump* and *merge conflict causing* `PKG_RELEASE` and replace it with `commitcount`. Signed-off-by: Paul Spooren --- package/base-files/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 8d40eb0e49..52cf8a2b7b 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,6 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=245 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ @@ -40,7 +39,7 @@ define Package/base-files DEPENDS:=+netifd +libc +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:openwrt-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool TITLE:=Base filesystem for OpenWrt URL:=http://openwrt.org/ - VERSION:=$(PKG_RELEASE)-$(REVISION) + VERSION:=$(call commitcount)-$(REVISION) endef define Package/base-files/conffiles From patchwork Thu Jan 7 08:59:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Spooren X-Patchwork-Id: 1423196 X-Patchwork-Delegate: mail@aparcar.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aparcar.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=wpsDtFvA; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DBKyS15hfz9sS8 for ; Thu, 7 Jan 2021 20:03:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p+BdqCT8+Zs0YNZ4C0d1hTKrjoEhUjj/IEipFxrO2dY=; b=wpsDtFvAy0Uk+I8tzKpbICN8h kGRSAadl+ps1tJBJP7XRbo7SLNkgvwY7V2KzzmfLLyZRmHLeyWUIALwxpq7vteAHxgrWUy8Jz/AyN 8Qv23+yZHYph93flWNBC96LuD76L5tSgePwa4ueMzLnRpBL4fUQw8V+bjQQacLTVWAZlVnHUKG/Lp zkM5HyM9RMoHf79ooe/sNlShPOgzUU1RWtXMcPu2TdcwuXJgDd1yRu1Mqpeyn1wL7wy5b8CpWA0Hx PkNgHrvp7t9pohJsIyXglw+jmqcotFJVZuCbKHeuiFY/9d9SfxuiBEgKOsKGGpM9ltZ41unKr87bv p604048Pw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxR9z-0003Kq-0H; Thu, 07 Jan 2021 09:00:47 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxR9m-0003Fp-0S for openwrt-devel@lists.openwrt.org; Thu, 07 Jan 2021 09:00:37 +0000 X-Originating-IP: 72.235.129.18 Received: from dawn.lan (udp100268uds.hawaiiantel.net [72.235.129.18]) (Authenticated sender: mail@aparcar.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPA id 7E26CE0018; Thu, 7 Jan 2021 09:00:30 +0000 (UTC) From: Paul Spooren To: openwrt-devel@lists.openwrt.org Subject: [PATCH 3/3] uboot-envtools: use `commitcount` for release Date: Wed, 6 Jan 2021 22:59:48 -1000 Message-Id: <20210107085947.1355642-3-mail@aparcar.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210107085947.1355642-1-mail@aparcar.org> References: <20210107085947.1355642-1-mail@aparcar.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210107_040034_299892_78B5F974 X-CRM114-Status: GOOD ( 10.11 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.196 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [217.70.183.196 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paul Spooren Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Use `commitcount` function rather than manually setting a PKG_RELEASE. Signed-off-by: Paul Spooren --- package/boot/uboot-envtools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 8bc2c00ba5..fef3008f3b 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,6 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2020.04 -PKG_RELEASE:=17 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -38,6 +37,7 @@ define Package/uboot-envtools SUBMENU:=Boot Loaders TITLE:=read/modify U-Boot bootloader environment URL:=http://www.denx.de/wiki/U-Boot + VERSION:=$(PKG_VERSION)-$(strip $(call commitcount)) endef define Package/uboot-envtools/description