From 537a0f1843db93ddfed6200672d221939d7da9a4 Mon Sep 17 00:00:00 2001 From: Yasuhiro Kimura Date: Tue, 19 Oct 2021 12:56:36 +0900 Subject: [PATCH] Mk/Uses/emacs.mk: Remove Emacs major version from EMACS_PKGNAMESUFFIX When major version of editors/emacs-devel was bumped to 29, I experienced the problem that `pkg upgrade` can't properly upgrade ports depending on Emacs. For example, before major version was bumped to 29, package name of 'devel_nox' flavor of 'devel/magit' was 'magit-emacs28_nox-3.2.1' and it changed to 'magit-emacs29_nox-3.2.1' after major version bump. Unfortunately `pkg upgrade` can't handle change of PKGNAMESUFFIX properly and regards installed 'magit-emacs28_nox-3.2.1' as orphaned. By applying this commit the package name becomes 'magit-emacs-devel-nox-3.2.1' and it doesn't change even if major version of editor/emacs-devel is bumped. So `pkg upgrade` can properly upgrade ports depending on Emacs. This is primary purpose that I propose to remove Emacs major version from EMACS_PKGNAMESUFFIX. But there is also the reason that I think Emacs major version should not be included in EMACS_PKGNAMESUFFIX. And I'd like to explain it by comparing Emacs ports with Python ones. Right now there are following 6 Python ports. * lang/python27 * lang/python36 * lang/python37 * lang/python38 * lang/python39 * lang/python310 They are latest release of Python 2.7, 3.6, 3.7, 3.8, 3.9 and 3.10 respectively. Every time new minor version X.Y.0 is released new port lang/pythonXY is created. Each time new point release (X.Y.1, X.Y.2, ...) is released lang/pythonXY is updated to latest one. When Python X.Y reached its EoL lang/pythonXY is removed from ports tree. It never upgrades to X.(Y+1).0. Like this Python ports are tightly coupled with its minor version. Then how flavor is used? In Python ports world Python ports (lang/pythonXY) themselves don't have any flavors. They are ports depending on Python that have flavors. And flavors are used to distinguish which version of Python the specified flavor of port works with. In this case it is quite reasonable that flavors name include Python version and PKGNAMEPREFIX such as 'py27-', 'py36-', etc. are used with ports depending on Python. Now let's go back Emacs ports world. Currently, and as far as I know, there are 2 Emacs ports. That is, editors/emacs and editors/emacs-devel. The former is always latest release version, and the latter is latest snapshot from master branch of upstream repository. Different from Python ports, new port isn't created even if new version is released or version of latest snapshot is changed. There is always 2 Emacs ports. Usage of flavor is also different from that of Python ports. At first Emacs ports themselves have flavors and they are used to provide variations of Emacs ports that have different option settings. As a result names such as 'full', 'nox', 'canna' are used to represent such difference. And flavors are also used with ports depending on Emacs ports to distinguish which flavor of Emacs they work with. Under such situation I don't think it is reasonable for PKGNAMESUFFIX of ports depending on Emacs ports to include Emacs major version. --- Mk/Uses/emacs.mk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Mk/Uses/emacs.mk b/Mk/Uses/emacs.mk index 31f9935351ec..17f97d1fe398 100644 --- a/Mk/Uses/emacs.mk +++ b/Mk/Uses/emacs.mk @@ -113,12 +113,14 @@ EMACS_LIBDIR= share/emacs EMACS_LIBDIR_WITH_VER= share/emacs/${EMACS_VER} EMACS_PORT_NAME= emacs${EMACS_MAJOR_VER} -.if ${FLAVOR:M*nox} -EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME}_nox -.elif ${FLAVOR:Mcanna} -EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME}_canna +.if ${EMACS_FLAVOR} == "devel_full" +EMACS_PKGNAMESUFFIX= -emacs-devel +.elif ${EMACS_FLAVOR} == "devel_nox" +EMACS_PKGNAMESUFFIX= -emacs-devel-nox +.elif ${EMACS_FLAVOR} == "full" +EMACS_PKGNAMESUFFIX= "" .else -EMACS_PKGNAMESUFFIX= -${EMACS_PORT_NAME} +EMACS_PKGNAMESUFFIX= -emacs-${EMACS_FLAVOR} .endif EMACS_CMD= ${PREFIX}/bin/emacs-${EMACS_VER} -- 2.33.1