mirror of
https://github.com/openwrt/packages.git
synced 2026-12-05 06:45:34 +04:00
owut: remove comments and empty lines from the built package
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 <agave@dracaena.it> Co-authored-by: Eric Fahlgren <ericfahlgren@gmail.com>
This commit is contained in:
1 parent
d5c4e00d9c
commit
1c2ce769a8
1 file changed
+9
-3
+9
-3
@@ -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))
|
||||
Reference in new issue
Block a user