From ff2acd1b92842c094517445d7e19ce73d98d9528 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 10 Dec 2020 19:11:49 +0100 Subject: [PATCH] Let setup.py install hg as hg again --- 0001-setup-hg3.patch | 38 -------------------------------------- mercurial.spec | 7 +------ 2 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 0001-setup-hg3.patch diff --git a/0001-setup-hg3.patch b/0001-setup-hg3.patch deleted file mode 100644 index d15c098..0000000 --- a/0001-setup-hg3.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 65b6aac48e167645a1aa75d6a724811fb7e5c775 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Tue, 26 Nov 2019 11:10:12 +0100 -Subject: [PATCH] Create hg2/hg3 bin/scripts to keep Py2 & Py3 mercurial - co-installable - -This can be removed completely once the mercurial for Python 2 is removed. - -Co-Authored-By: Petr Stodulka ---- - setup.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/setup.py b/setup.py -index 932608b..8663e01 100644 ---- a/setup.py -+++ b/setup.py -@@ -196,7 +196,7 @@ def write_if_changed(path, content): - fh.write(content) - - --scripts = ['hg'] -+scripts = ['hg' + str(sys.version_info[0])] - if os.name == 'nt': - # We remove hg.bat if we are able to build hg.exe. - scripts.append('contrib/win32/hg.bat') -@@ -317,7 +317,7 @@ def findhg(): - # and disable localization for the same reasons. - hgenv['HGPLAIN'] = '1' - hgenv['LANGUAGE'] = 'C' -- hgcmd = ['hg'] -+ hgcmd = ['hg' + str(sys.version_info[0])] - # Run a simple "hg log" command just to see if using hg from the user's - # path works and can successfully interact with this repository. Windows - # gives precedence to hg.exe in the current directory, so fall back to the --- -2.23.0 - diff --git a/mercurial.spec b/mercurial.spec index a439313..23548d1 100644 --- a/mercurial.spec +++ b/mercurial.spec @@ -12,7 +12,6 @@ License: GPLv2+ URL: https://mercurial-scm.org/ Source0: https://www.mercurial-scm.org/release/%{name}-%{upstreamversion}.tar.gz Source1: mercurial-site-start.el -Patch2: 0001-setup-hg3.patch BuildRequires: bash-completion BuildRequires: emacs-el BuildRequires: emacs-nox @@ -102,12 +101,7 @@ Locales for mercurial. %prep %setup -q -n %{name}-%{upstreamversion} -%patch2 -p1 -b .create_hg3 - %build -# copy hg to hg2/hg3 to be able to create /usr/bin/hg(2|3) script -cp -a hg hg3 -rm hg PYTHON=%{python3} make all # chg will invoke the 'hg' command - no direct Python dependency @@ -132,6 +126,7 @@ grep 'hgk.py*' < %{name}.files > %{name}-hgk.files install -D -m 755 contrib/hgk %{buildroot}%{_libexecdir}/mercurial/hgk install -m 755 contrib/hg-ssh %{buildroot}%{_bindir} +mv %{buildroot}%{_bindir}/hg %{buildroot}%{_bindir}/hg3 bash_completion_dir=%{buildroot}$(pkg-config --variable=completionsdir bash-completion) mkdir -p $bash_completion_dir