mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 01:44:32 +04:00
btop: add migration for alias command
Files in `/etc/profile.d/` are marked as user configs and won't be replaced to new version when update the package, so add a migration script for this. Fixes: #26709 Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
committed by
Tianling Shen
parent
fa01e8adfc
commit
ae33358c4f
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=btop
|
PKG_NAME:=btop
|
||||||
PKG_VERSION:=1.4.3
|
PKG_VERSION:=1.4.3
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL=https://codeload.github.com/aristocratos/btop/tar.gz/v$(PKG_VERSION)?
|
PKG_SOURCE_URL=https://codeload.github.com/aristocratos/btop/tar.gz/v$(PKG_VERSION)?
|
||||||
@@ -47,6 +47,8 @@ define Package/btop/install
|
|||||||
|
|
||||||
$(INSTALL_DIR) $(1)/etc/profile.d
|
$(INSTALL_DIR) $(1)/etc/profile.d
|
||||||
$(CP) $(CURDIR)/files/btop.sh $(1)/etc/profile.d/
|
$(CP) $(CURDIR)/files/btop.sh $(1)/etc/profile.d/
|
||||||
|
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||||
|
$(CP) $(CURDIR)/files/btop.uci $(1)/etc/uci-defaults/90-btop-migrate-alias
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,btop))
|
$(eval $(call BuildPackage,btop))
|
||||||
|
|||||||
5
admin/btop/files/btop.uci
Normal file
5
admin/btop/files/btop.uci
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
grep -q "utf-force" "/etc/profile.d/btop.sh" && sed -i "s,utf-force,force-utf,g" "/etc/profile.d/btop.sh"
|
||||||
|
|
||||||
|
exit 0
|
||||||
Reference in New Issue
Block a user