mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-24 23:21:17 +02:00
sys-apps/less: Sync with Gentoo
It's from Gentoo commit faec8c28c79c6f7a494e785883ef49b29d232495.
This commit is contained in:
parent
deb4cd3953
commit
9747b88361
@ -1,52 +0,0 @@
|
||||
https://github.com/gwsw/less/pull/403
|
||||
|
||||
From 23000c286773af153a5743bc923465707b87613b Mon Sep 17 00:00:00 2001
|
||||
From: Sam James <sam@gentoo.org>
|
||||
Date: Mon, 17 Jul 2023 22:58:27 +0100
|
||||
Subject: [PATCH] configure.ac: Check for tinfow before tinfo
|
||||
|
||||
We currently check for ncursesw > ncurses and then tinfo > tinfow. This means
|
||||
we can get a mismatch of ncursesw + tinfo, instead of the correct ncursesw + tinfow.
|
||||
|
||||
Swap the order so we check for ncursesw first (before other ncurses variants)
|
||||
and then tinfow first (before other tinfo variants).
|
||||
|
||||
This is needed anyway for correctness, but also needed for certain terminfos
|
||||
to work correctly with recent ncurses.
|
||||
|
||||
A better fix would be to use pkg-config first which handles this correctly
|
||||
and would include the appropriate -ltinfo* in the libraries list for -lncurses*,
|
||||
but not doing that for now.
|
||||
|
||||
Bug: https://bugs.gentoo.org/910430
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -63,10 +63,10 @@ fi
|
||||
|
||||
if test $curses_broken = 0; then
|
||||
|
||||
-# -- Try tinfo.
|
||||
+# -- Try tinfow.
|
||||
if test "x$TERMLIBS" = x; then
|
||||
- if test $have_tinfo = yes; then
|
||||
- TERMLIBS="-ltinfo"
|
||||
+ if test $have_tinfow = yes; then
|
||||
+ TERMLIBS="-ltinfow"
|
||||
SAVE_LIBS=$LIBS
|
||||
LIBS="$LIBS $TERMLIBS"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[$include_termcap_h]], [[tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);]])],[termok=yes],[termok=no])
|
||||
@@ -75,10 +75,10 @@ if test "x$TERMLIBS" = x; then
|
||||
fi
|
||||
fi
|
||||
|
||||
-# -- Try tinfow.
|
||||
+# -- Try tinfo.
|
||||
if test "x$TERMLIBS" = x; then
|
||||
- if test $have_tinfow = yes; then
|
||||
- TERMLIBS="-ltinfow"
|
||||
+ if test $have_tinfo = yes; then
|
||||
+ TERMLIBS="-ltinfo"
|
||||
SAVE_LIBS=$LIBS
|
||||
LIBS="$LIBS $TERMLIBS"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[$include_termcap_h]], [[tgetent(0,0); tgetflag(0); tgetnum(0); tgetstr(0,0);]])],[termok=yes],[termok=no])
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# Preprocessor for 'less'. Used when this environment variable is set:
|
||||
@ -24,6 +24,42 @@ guesscompress() {
|
||||
esac
|
||||
}
|
||||
|
||||
crl_filter() {
|
||||
if command -v certtool &>/dev/null; then
|
||||
certtool --crl-info --text --infile "$1"
|
||||
else
|
||||
openssl crl -hash -text -noout -in "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
csr_filter() {
|
||||
if command -v certtool &>/dev/null; then
|
||||
certtool --crq-info --text --infile "$1"
|
||||
else
|
||||
openssl req -text -noout -in "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
crt_filter() {
|
||||
if command -v certtool &>/dev/null; then
|
||||
certtool --certificate-info --text --infile "$1"
|
||||
else
|
||||
openssl x509 -hash -text -noout -in "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
jks_filter() {
|
||||
if command -v keytool &>/dev/null; then
|
||||
keytool -list -keystore "$1"
|
||||
else
|
||||
cat "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
p12_filter() {
|
||||
openssl pkcs12 -nokeys -info -in "$1"
|
||||
}
|
||||
|
||||
lesspipe_file() {
|
||||
local out=$(file -L -- "$1")
|
||||
local suffix
|
||||
@ -57,6 +93,16 @@ lesspipe() {
|
||||
~/.lessfilter "$1" && exit 0
|
||||
fi
|
||||
|
||||
# System filters
|
||||
shopt -s nullglob
|
||||
local f
|
||||
for f in "${XDG_CONFIG_HOME:-~/.config}"/lessfilter.d/* /etc/lessfilter.d/* /usr/lib/lessfilter.d/*; do
|
||||
if [[ -x ${f} ]]; then
|
||||
"${f}" "$1" && exit 0
|
||||
fi
|
||||
done
|
||||
shopt -u nullglob
|
||||
|
||||
local ignore
|
||||
for ignore in ${LESSIGNORE} ; do
|
||||
[[ ${match} == *.${ignore} ]] && exit 0
|
||||
@ -199,9 +245,11 @@ lesspipe() {
|
||||
;;
|
||||
|
||||
### Encryption stuff ###
|
||||
*.crl) openssl crl -hash -text -noout -in "$1" ;;
|
||||
*.csr) openssl req -text -noout -in "$1" ;;
|
||||
*.crt|*.pem) openssl x509 -hash -text -noout -in "$1" ;;
|
||||
*.crl) crl_filter "$1" ;;
|
||||
*.csr) csr_filter "$1" ;;
|
||||
*.crt|*.pem) crt_filter "$1" ;;
|
||||
*.jks) jks_filter "$1" ;;
|
||||
*.p12|*.pfx) p12_filter "$1" ;;
|
||||
|
||||
# May not be such a good idea :)
|
||||
# ### Device nodes ###
|
||||
@ -253,7 +301,7 @@ if [[ $# -eq 0 ]] ; then
|
||||
elif [[ $1 == "-V" || $1 == "--version" ]] ; then
|
||||
cat <<-EOF
|
||||
lesspipe (git)
|
||||
Copyright 1999-2019 Gentoo Authors
|
||||
Copyright 1999-2023 Gentoo Authors
|
||||
Mike Frysinger <vapier@gentoo.org>
|
||||
(with plenty of ideas stolen from other projects/distros)
|
||||
|
@ -1,86 +0,0 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
WANT_AUTOMAKE=none
|
||||
WANT_LIBTOOL=none
|
||||
|
||||
if [[ ${PV} == 9999 ]]; then
|
||||
EGIT_REPO_URI="https://github.com/gwsw/less"
|
||||
inherit git-r3
|
||||
fi
|
||||
|
||||
inherit autotools flag-o-matic optfeature
|
||||
|
||||
# Releases are usually first a beta then promoted to stable if no
|
||||
# issues were found. Upstream explicitly ask "to not generally distribute"
|
||||
# the beta versions. It's okay to keyword beta versions if they fix
|
||||
# a serious bug, but otherwise try to avoid it.
|
||||
|
||||
MY_PV=${PV/_beta/-beta}
|
||||
MY_P=${PN}-${MY_PV}
|
||||
DESCRIPTION="Excellent text file viewer"
|
||||
HOMEPAGE="https://www.greenwoodsoftware.com/less/"
|
||||
[[ ${PV} != 9999 ]] && SRC_URI="https://www.greenwoodsoftware.com/less/${MY_P}.tar.gz"
|
||||
S="${WORKDIR}"/${MY_P/?beta}
|
||||
|
||||
LICENSE="|| ( GPL-3 BSD-2 )"
|
||||
SLOT="0"
|
||||
if [[ ${PV} != 9999 && ${PV} != *_beta* ]] ; then
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
|
||||
fi
|
||||
IUSE="pcre"
|
||||
# As of 623_beta, lesstest is not included in dist tarballs
|
||||
# https://github.com/gwsw/less/issues/344
|
||||
RESTRICT="test"
|
||||
|
||||
DEPEND="
|
||||
>=app-misc/editor-wrapper-3
|
||||
>=sys-libs/ncurses-5.2:=
|
||||
pcre? ( dev-libs/libpcre2 )
|
||||
"
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${PN}-633-tinfow.patch
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
# Per upstream README to prepare live build
|
||||
[[ ${PV} == 9999 ]] && emake -f Makefile.aut distfiles
|
||||
# Upstream uses unpatched autoconf-2.69, which breaks with clang-16.
|
||||
# https://bugs.gentoo.org/870412
|
||||
eautoreconf
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
append-lfs-flags # bug #896316
|
||||
|
||||
local myeconfargs=(
|
||||
--with-regex=$(usex pcre pcre2 posix)
|
||||
--with-editor="${EPREFIX}"/usr/libexec/editor
|
||||
)
|
||||
econf "${myeconfargs[@]}"
|
||||
}
|
||||
|
||||
src_test() {
|
||||
emake check VERBOSE=1
|
||||
}
|
||||
|
||||
src_install() {
|
||||
default
|
||||
|
||||
newbin "${FILESDIR}"/lesspipe-r2.sh lesspipe
|
||||
newenvd "${FILESDIR}"/less.envd 70less
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
optfeature "Colorized output supprt" dev-python/pygments
|
||||
|
||||
if has_version "<${CATEGORY}/${PN}-483-r1" ; then
|
||||
elog "The lesspipe.sh symlink has been dropped. If you are still setting"
|
||||
elog "LESSOPEN to that, you will need to update it to '|lesspipe %s'."
|
||||
fi
|
||||
}
|
@ -75,7 +75,10 @@ src_test() {
|
||||
src_install() {
|
||||
default
|
||||
|
||||
newbin "${FILESDIR}"/lesspipe-r2.sh lesspipe
|
||||
keepdir /usr/lib/lessfilter.d
|
||||
keepdir /etc/lessfilter.d
|
||||
|
||||
newbin "${FILESDIR}"/lesspipe-r3.sh lesspipe
|
||||
newenvd "${FILESDIR}"/less.envd 70less
|
||||
}
|
||||
|
@ -75,7 +75,10 @@ src_test() {
|
||||
src_install() {
|
||||
default
|
||||
|
||||
newbin "${FILESDIR}"/lesspipe-r2.sh lesspipe
|
||||
keepdir /usr/lib/lessfilter.d
|
||||
keepdir /etc/lessfilter.d
|
||||
|
||||
newbin "${FILESDIR}"/lesspipe-r3.sh lesspipe
|
||||
newenvd "${FILESDIR}"/less.envd 70less
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user