diff mbox series

[2/2] base-files: replace PKG_RELEASE with findrev

Message ID 20210102002213.3604413-2-mail@aparcar.org
State Superseded
Delegated to: Paul Spooren
Headers show
Series [1/2] rules: add findrev function from LuCI | expand

Commit Message

Paul Spooren Jan. 2, 2021, 12:22 a.m. UTC
The newly added `findrev` function does automatic versioning based on
Git commits of the package. Replace tedious to bump and merge conflict
causing `PKG_RELEASE` and replace it with `findrev`.

CC: Adrian Schmutzler <freifunk@adrianschmutzler.de>

Signed-off-by: Paul Spooren <mail@aparcar.org>
---
 package/base-files/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Hannu Nyman Jan. 2, 2021, 10:46 a.m. UTC | #1
Paul Spooren kirjoitti 2.1.2021 klo 2.22:
> The newly added `findrev` function does automatic versioning based on
> Git commits of the package. Replace tedious to bump and merge conflict
> causing `PKG_RELEASE` and replace it with `findrev`.


Sounds reasonable for me.

The PKG_RELEASE in base-files has too often been forgotten to be changed. In 
years 2019-2020 the base-files package was changed by 150 commits, while the 
PKG_RELEASE version was bumped only 45 times (from 196 to 244). There is a 
REVISION suffix added, which provides some versioning, but it is still bad 
practice that the main release number is usually forgotten. Better to replace 
version with automatics, as the base-files release number is not meaningful 
in any case.

The automatic commit date based versioning has worked well in LuCI, where 
this 'findrev' function is being copied from.


> CC: Adrian Schmutzler <freifunk@adrianschmutzler.de>
>
> Signed-off-by: Paul Spooren <mail@aparcar.org>
> ---
>   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 da3976424f..8342dd2f20 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:=244
>   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 findrev)
>   endef
>   
>   define Package/base-files/conffiles
diff mbox series

Patch

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index da3976424f..8342dd2f20 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:=244
 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 findrev)
 endef
 
 define Package/base-files/conffiles