From: Hannu Nyman Date: Sat, 23 Aug 2025 11:28:12 +0000 (+0300) Subject: nano: set nano as default EDITOR for nano-plus/full X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=d4f6c9c322e491dbf881774ac8e33487872dd00c;p=openwrt-packages.git nano: set nano as default EDITOR for nano-plus/full Set nano as the default EDITOR via /etc/profile.d for those apps that respect the variable. Only for nano-plus and nano-full variants. Suggested-by: Anthony Sepa Signed-off-by: Hannu Nyman --- diff --git a/utils/nano/Makefile b/utils/nano/Makefile index 77f8a2204..79500e5b1 100644 --- a/utils/nano/Makefile +++ b/utils/nano/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nano PKG_VERSION:=8.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/nano @@ -65,6 +65,7 @@ endef define Package/nano-plus/description nano-plus - Additional features enabled, larger size than default nano. (multibuffer, Unicode/UTF-8, help, justify, nanorc, some key bindings) + Nano set as the default EDITOR in the shell profile. $(call Package/nano/description) endef @@ -73,6 +74,7 @@ define Package/nano-full/description nano-full - all features, including syntax highlighting (also uci), multibuffer, Unicode/UTF-8, nanorc, some key bindings. (libmagic-based file type detection is disabled) + Nano set as the default EDITOR in the shell profile. Example /etc/nanorc is included. nanorc documentation at https://www.nano-editor.org/dist/latest/nanorc.5.html @@ -133,10 +135,12 @@ endef define Package/nano-plus/install $(call Package/nano/install,$1) + $(INSTALL_DIR) $(1)/etc/profile.d + $(INSTALL_DATA) ./files/nano-default-editor.sh $(1)/etc/profile.d endef define Package/nano-full/install - $(call Package/nano/install,$1) + $(call Package/nano-plus/install,$1) $(INSTALL_DIR) $(1)/etc $(1)/usr/share/nano $(INSTALL_DATA) ./files/nanorc $(1)/etc/nanorc $(INSTALL_DATA) ./files/uci.nanorc $(1)/usr/share/nano diff --git a/utils/nano/files/nano-default-editor.sh b/utils/nano/files/nano-default-editor.sh new file mode 100644 index 000000000..3a23154e5 --- /dev/null +++ b/utils/nano/files/nano-default-editor.sh @@ -0,0 +1,2 @@ +export EDITOR=/usr/bin/nano +