]> git.99rst.org Git - openwrt-packages.git/commitdiff
owut: remove comments and empty lines from the built package
authorSamuele Longhi <redacted>
Tue, 25 Aug 2026 11:14:53 +0000 (13:14 +0200)
committerGeorge Sapkin <redacted>
Sun, 30 Aug 2026 18:20:02 +0000 (21:20 +0300)
This allows to save some bytes, while preserving the scripts's
copyright and license information.

In owut at current ref db17536ec5cbcc6a76a51e65f3d192b6a2184abb
the reduction in the size applied to the source code is (e.g. without
the computed "s/%%VERSION%%/$(PKG_VERSION)-r$(PKG_RELEASE)/"):

from:
74330 /usr/bin/owut
10541 /usr/share/ucode/utils/argparse.uc

to:
58640 /usr/bin/owut
8630 /usr/share/ucode/utils/argparse.uc

Signed-off-by: Samuele Longhi <redacted>
Co-authored-by: Eric Fahlgren <redacted>
utils/owut/Makefile

index 2ef7a09788559b1d5b4de2a57766f2f3a806ba07..db5ae8c064bcfab35e62b390700478a472a47f2d 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=owut
 PKG_SOURCE_DATE:=2026-07-08
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=db17536ec5cbcc6a76a51e65f3d192b6a2184abb
@@ -65,8 +65,14 @@ define Package/owut/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/owut $(1)/usr/bin
 
-       sed -i -e "s/%%VERSION%%/$(PKG_VERSION)-r$(PKG_RELEASE)/" $(1)/usr/bin/owut
-       sed -i -e "s/%%VERSION%%/$(PKG_VERSION)-r$(PKG_RELEASE)/" $(1)/usr/share/ucode/utils/argparse.uc
+       # Hardcode the package version/release
+       # Remove comments and empty lines preserving package's title, copyright and license
+       sed -i \
+               -e "s/%%VERSION%%/$(PKG_VERSION)-r$(PKG_RELEASE)/" \
+               -e '5,$$$${/^[ \t]*\/\//d}' \
+               -e '/^$$$$/d' \
+               $(1)/usr/bin/owut \
+               $(1)/usr/share/ucode/utils/argparse.uc
 endef
 
 $(eval $(call BuildPackage,owut))
git clone https://git.99rst.org/PROJECT