From 0ae161ecb6928f87103921237ce28a54cdfd6061 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Tue, 21 Apr 2020 23:30:48 +0200 Subject: [PATCH] less: add ALTERNATIVES This package can not be installed if you have installed less from busybox. Collected errors: * check_data_file_clashes: Package less wants to install file /bin/less But that file is already provided by package * busybox * opkg_install_cmd: Cannot install package less. To avoid this error, I moved it from /bin/less to /usr/bin/less. If you install it now, it changes symlink from busybox to /usr/bin/less /bin/less -> busybox* /bin/less -> /usr/bin/less* When you remove it, it changes symlink back to busybox. That's why postint and postrm scripts are no longer needed. Signed-off-by: Josef Schlehofer --- utils/less/Makefile | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/utils/less/Makefile b/utils/less/Makefile index 26a08ab688..6d4095073e 100644 --- a/utils/less/Makefile +++ b/utils/less/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=less PKG_VERSION:=530 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.greenwoodsoftware.com/less @@ -30,6 +30,7 @@ define Package/less/Default CATEGORY:=Utilities TITLE:=Pager program similar to more URL:=http://www.greenwoodsoftware.com/less/ + ALTERNATIVES:=200:/bin/less:/usr/bin/less endef define Package/less/Default/description @@ -69,20 +70,8 @@ ifeq ($(BUILD_VARIANT),wide) endif define Package/less/install - $(INSTALL_DIR) $(1)/bin - $(CP) $(PKG_INSTALL_DIR)/usr/bin/less $(1)/bin/less -endef - -define Package/less/postinst -#!/bin/sh -[ -L "$${IPKG_INSTROOT}/usr/bin/less" ] && rm -f "$${IPKG_INSTROOT}/usr/bin/less" -exit 0 -endef - -define Package/less/postrm -#!/bin/sh -/bin/busybox less -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/bin/less -exit 0 + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/less $(1)/usr/bin/less endef Package/less-wide/install = $(Package/less/install) -- 2.30.2