From caeb488b475bae6fe7fb261aec8c6ec85d64382b Mon Sep 17 00:00:00 2001 From: Lars Wendler Date: Fri, 27 Mar 2020 09:22:34 +0100 Subject: app-editors/nano: Revbump to fix justify keystroke crash Package-Manager: Portage-2.3.96, Repoman-2.3.22 Signed-off-by: Lars Wendler --- .../nano-4.8-justify_keystroke_crash_fix.patch | 34 +++++++++ app-editors/nano/nano-4.6-r1.ebuild | 81 ++++++++++++++++++++++ app-editors/nano/nano-4.6.ebuild | 80 --------------------- 3 files changed, 115 insertions(+), 80 deletions(-) create mode 100644 app-editors/nano/files/nano-4.8-justify_keystroke_crash_fix.patch create mode 100644 app-editors/nano/nano-4.6-r1.ebuild delete mode 100644 app-editors/nano/nano-4.6.ebuild diff --git a/app-editors/nano/files/nano-4.8-justify_keystroke_crash_fix.patch b/app-editors/nano/files/nano-4.8-justify_keystroke_crash_fix.patch new file mode 100644 index 000000000000..e18425a6b802 --- /dev/null +++ b/app-editors/nano/files/nano-4.8-justify_keystroke_crash_fix.patch @@ -0,0 +1,34 @@ +From 2d05ce37c60a157760f386badc387e2d53b2fa75 Mon Sep 17 00:00:00 2001 +From: Benno Schulenberg +Date: Thu, 5 Mar 2020 16:57:16 +0100 +Subject: [PATCH] justify: do not crash when the user attempts to justify an + empty region + +This fixes https://savannah.gnu.org/bugs/?57959. + +Bug existed since version 4.0, since the justifying +of a marked region was introduced. +--- + src/text.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/text.c b/src/text.c +index 957938f4..4fe7eb96 100644 +--- a/src/text.c ++++ b/src/text.c +@@ -1930,6 +1930,12 @@ void do_justify(bool full_justify) + get_region((const linestruct **)&first_par_line, &top_x, + (const linestruct **)&last_par_line, &bot_x, &right_side_up); + ++ /* When the marked region is empty, do nothing. */ ++ if (first_par_line == last_par_line && top_x == bot_x) { ++ statusline(NOTICE, _("Nothing changed")); ++ return; ++ } ++ + /* Save the starting point of the marked region. */ + was_top_lineno = first_par_line->lineno; + was_top_x = top_x; +-- +2.25.2 + diff --git a/app-editors/nano/nano-4.6-r1.ebuild b/app-editors/nano/nano-4.6-r1.ebuild new file mode 100644 index 000000000000..0f93288e883f --- /dev/null +++ b/app-editors/nano/nano-4.6-r1.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="git://git.sv.gnu.org/nano.git" + inherit git-r3 autotools +else + MY_P="${PN}-${PV/_}" + SRC_URI="https://www.nano-editor.org/dist/v${PV:0:1}/${MY_P}.tar.gz" + KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +fi + +DESCRIPTION="GNU GPL'd Pico clone with more functionality" +HOMEPAGE="https://www.nano-editor.org/ https://wiki.gentoo.org/wiki/Nano/Basics_Guide" + +LICENSE="GPL-3" +SLOT="0" +IUSE="debug justify +magic minimal ncurses nls slang +spell +split-usr static unicode" + +LIB_DEPEND=">=sys-libs/ncurses-5.9-r1:0=[unicode?] + sys-libs/ncurses:0=[static-libs(+)] + magic? ( sys-apps/file[static-libs(+)] ) + nls? ( virtual/libintl ) + !ncurses? ( slang? ( sys-libs/slang[static-libs(+)] ) )" +RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )" +DEPEND="${RDEPEND} + static? ( ${LIB_DEPEND} )" +BDEPEND=" + nls? ( sys-devel/gettext ) + virtual/pkgconfig +" +PATCHES=( "${FILESDIR}/${PN}-4.8-justify_keystroke_crash_fix.patch" ) +src_prepare() { + default + if [[ ${PV} == "9999" ]] ; then + eautoreconf + fi +} + +src_configure() { + use static && append-ldflags -static + local myconf=( + --bindir="${EPREFIX}"/bin + --htmldir=/trash + $(use_enable !minimal color) + $(use_enable !minimal multibuffer) + $(use_enable !minimal nanorc) + $(use_enable magic libmagic) + $(use_enable spell speller) + $(use_enable justify) + $(use_enable debug) + $(use_enable nls) + $(use_enable unicode utf8) + $(use_enable minimal tiny) + $(usex ncurses --without-slang $(use_with slang)) + ) + econf "${myconf[@]}" +} + +src_install() { + default + # don't use "${ED}" here or things break (#654534) + rm -r "${D}"/trash || die + + dodoc doc/sample.nanorc + docinto html + dodoc doc/faq.html + insinto /etc + newins doc/sample.nanorc nanorc + if ! use minimal ; then + # Enable colorization by default. + sed -i \ + -e '/^# include /s:# *::' \ + "${ED}"/etc/nanorc || die + fi + + use split-usr && dosym ../../bin/nano /usr/bin/nano +} diff --git a/app-editors/nano/nano-4.6.ebuild b/app-editors/nano/nano-4.6.ebuild deleted file mode 100644 index 18a962cba394..000000000000 --- a/app-editors/nano/nano-4.6.ebuild +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit flag-o-matic -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="git://git.sv.gnu.org/nano.git" - inherit git-r3 autotools -else - MY_P="${PN}-${PV/_}" - SRC_URI="https://www.nano-editor.org/dist/v${PV:0:1}/${MY_P}.tar.gz" - KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -fi - -DESCRIPTION="GNU GPL'd Pico clone with more functionality" -HOMEPAGE="https://www.nano-editor.org/ https://wiki.gentoo.org/wiki/Nano/Basics_Guide" - -LICENSE="GPL-3" -SLOT="0" -IUSE="debug justify +magic minimal ncurses nls slang +spell +split-usr static unicode" - -LIB_DEPEND=">=sys-libs/ncurses-5.9-r1:0=[unicode?] - sys-libs/ncurses:0=[static-libs(+)] - magic? ( sys-apps/file[static-libs(+)] ) - nls? ( virtual/libintl ) - !ncurses? ( slang? ( sys-libs/slang[static-libs(+)] ) )" -RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )" -DEPEND="${RDEPEND} - static? ( ${LIB_DEPEND} )" -BDEPEND=" - nls? ( sys-devel/gettext ) - virtual/pkgconfig -" -src_prepare() { - default - if [[ ${PV} == "9999" ]] ; then - eautoreconf - fi -} - -src_configure() { - use static && append-ldflags -static - local myconf=( - --bindir="${EPREFIX}"/bin - --htmldir=/trash - $(use_enable !minimal color) - $(use_enable !minimal multibuffer) - $(use_enable !minimal nanorc) - $(use_enable magic libmagic) - $(use_enable spell speller) - $(use_enable justify) - $(use_enable debug) - $(use_enable nls) - $(use_enable unicode utf8) - $(use_enable minimal tiny) - $(usex ncurses --without-slang $(use_with slang)) - ) - econf "${myconf[@]}" -} - -src_install() { - default - # don't use "${ED}" here or things break (#654534) - rm -r "${D}"/trash || die - - dodoc doc/sample.nanorc - docinto html - dodoc doc/faq.html - insinto /etc - newins doc/sample.nanorc nanorc - if ! use minimal ; then - # Enable colorization by default. - sed -i \ - -e '/^# include /s:# *::' \ - "${ED}"/etc/nanorc || die - fi - - use split-usr && dosym ../../bin/nano /usr/bin/nano -} -- cgit v1.2.3-18-g5258