Update to 668
* Fix crash when using --header on command line * Fix possible crash when scrolling left/right or toggling -S * Fix bug when using #stop in a lesskey file * Fix bug when using --shift or --match-shift on command line with a parameter starting with '.' * Fix bug in R command when file size changes * Fix bug using --header when file does not fill screen * Fix ^X bug when output is not a terminal * Fix bug where ^Z is not handled immediately * Fix bug where first byte from a LESSOPEN filter is deleted if it is greater than 0x7F * Fix uninitialized variable in edit_ifile * Fix incorrect handling of UTF-8 chars in prompts - Add reproducible.patch to override build date (boo#1047218) OBS-URL: https://build.opensuse.org/package/show/Base:System/less?expand=0&rev=111
This commit is contained in:
commit
188936d16d
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
18
README.SUSE
Normal file
18
README.SUSE
Normal file
@ -0,0 +1,18 @@
|
||||
Dear user,
|
||||
|
||||
the 'less' application, thanks to its preprocessor, is able to show even binary
|
||||
formats using calls to external commands. Since not every user finds this
|
||||
feature plausible, you have the opportunity to customize behavior of 'less'
|
||||
using the environment variable LESS_ADVANCED_PREPROCESSOR. By default, it's set
|
||||
to "no" in /etc/profile -- thus if you require less to handle binary formats,
|
||||
set this in your startup scripts:
|
||||
|
||||
export LESS_ADVANCED_PREPROCESSOR="yes"
|
||||
|
||||
Remark for experienced users:
|
||||
If you had already set this switch and want to temporarily override it, you can
|
||||
force 'less' to read a file from its standard input instead, e.g.:
|
||||
|
||||
less < dumb.ps
|
||||
|
||||
will show the source PostScript, and not the "rendered" result.
|
15
less-429-more.patch
Normal file
15
less-429-more.patch
Normal file
@ -0,0 +1,15 @@
|
||||
Index: less-643/option.c
|
||||
===================================================================
|
||||
--- less-643.orig/option.c
|
||||
+++ less-643/option.c
|
||||
@@ -165,6 +165,10 @@ public void scan_option(char *s)
|
||||
s--;
|
||||
optc = 'z';
|
||||
break;
|
||||
+ case 'l':
|
||||
+ if (less_is_more)
|
||||
+ continue;
|
||||
+ break;
|
||||
case 'n':
|
||||
if (less_is_more)
|
||||
optc = 'z';
|
68
less-429-shell.patch
Normal file
68
less-429-shell.patch
Normal file
@ -0,0 +1,68 @@
|
||||
Index: less-656/filename.c
|
||||
===================================================================
|
||||
--- less-656.orig/filename.c
|
||||
+++ less-656/filename.c
|
||||
@@ -553,7 +553,7 @@ static FILE * shellcmd(constant char *cm
|
||||
#if HAVE_SHELL
|
||||
constant char *shell;
|
||||
|
||||
- shell = lgetenv("SHELL");
|
||||
+ shell = lgetenv("LESSSHELL");
|
||||
if (!isnullenv(shell))
|
||||
{
|
||||
char *scmd;
|
||||
Index: less-656/less.hlp
|
||||
===================================================================
|
||||
--- less-656.orig/less.hlp
|
||||
+++ less-656/less.hlp
|
||||
@@ -109,7 +109,7 @@
|
||||
___<_n_a_m_e_> Display the setting of an option, by name.
|
||||
+_c_m_d Execute the less cmd each time a new file is examined.
|
||||
|
||||
- !_c_o_m_m_a_n_d Execute the shell command with $SHELL.
|
||||
+ !_c_o_m_m_a_n_d Execute the shell command with $LESSSHELL.
|
||||
#_c_o_m_m_a_n_d Execute the shell command, expanded like a prompt.
|
||||
|XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command.
|
||||
s _f_i_l_e Save input to a file.
|
||||
Index: less-656/less.nro
|
||||
===================================================================
|
||||
--- less-656.orig/less.nro
|
||||
+++ less-656/less.nro
|
||||
@@ -468,7 +468,7 @@ A pound sign (#) is replaced by the name
|
||||
"!" with no shell command simply invokes a shell.
|
||||
If a \(haP (CONTROL-P) is entered immediately after the !,
|
||||
no "done" message is printed after the shell command is executed.
|
||||
-On Unix systems, the shell is taken from the environment variable SHELL,
|
||||
+On Unix systems, the shell is taken from the environment variable LESSSHELL,
|
||||
or defaults to "sh".
|
||||
On MS-DOS, Windows, and OS/2 systems, the shell is the normal command processor.
|
||||
.IP "# shell-command"
|
||||
@@ -2493,7 +2493,7 @@ automatically when running in
|
||||
.IP PATH
|
||||
User's search path (used to find a lesskey file
|
||||
on MS-DOS, Windows, and OS/2 systems).
|
||||
-.IP SHELL
|
||||
+.IP LESSSHELL
|
||||
The shell used to execute the !\& command, as well as to expand filenames.
|
||||
.IP TERM
|
||||
The type of terminal on which
|
||||
Index: less-656/lsystem.c
|
||||
===================================================================
|
||||
--- less-656.orig/lsystem.c
|
||||
+++ less-656/lsystem.c
|
||||
@@ -120,13 +120,13 @@ public void lsystem(constant char *cmd,
|
||||
|
||||
/*
|
||||
* Pass the command to the system to be executed.
|
||||
- * If we have a SHELL environment variable, use
|
||||
+ * If we have a LESSSHELL environment variable, use
|
||||
* <$SHELL -c "command"> instead of just <command>.
|
||||
* If the command is empty, just invoke a shell.
|
||||
*/
|
||||
#if HAVE_SHELL
|
||||
p = NULL;
|
||||
- if ((shell = lgetenv("SHELL")) != NULL && *shell != '\0')
|
||||
+ if ((shell = lgetenv("LESSSHELL")) != NULL && *shell != '\0')
|
||||
{
|
||||
if (*cmd == '\0')
|
||||
p = save(shell);
|
3
less-656-beta.tar.gz
Normal file
3
less-656-beta.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f7a5dc031f605a4d6af14d9461745206f205f7611fbe031858eb3fabb5554daa
|
||||
size 648076
|
BIN
less-656.sig
Normal file
BIN
less-656.sig
Normal file
Binary file not shown.
BIN
less-661.sig
Normal file
BIN
less-661.sig
Normal file
Binary file not shown.
3
less-661.tar.gz
Normal file
3
less-661.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2b5f0167216e3ef0ffcb0c31c374e287eb035e4e223d5dae315c2783b6e738ed
|
||||
size 648198
|
BIN
less-668.sig
Normal file
BIN
less-668.sig
Normal file
Binary file not shown.
3
less-668.tar.gz
Normal file
3
less-668.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2819f55564d86d542abbecafd82ff61e819a3eec967faa36cd3e68f1596a44b8
|
||||
size 649770
|
1260
less.changes
Normal file
1260
less.changes
Normal file
File diff suppressed because it is too large
Load Diff
30
less.keyring
Normal file
30
less.keyring
Normal file
@ -0,0 +1,30 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Version: GnuPG v1.4.2 (MingW32)
|
||||
|
||||
mQGiBEGxJ/oRBADqyDKgNZNZSBVjYa++6I53TEbRc/ySPE8O5xnl+tJdW9Vr8Lr/
|
||||
vUd+xLSW10Ej48ISY/Vnw1N1Z3CqypLSVy3EJn5Kt9FE+yED5doRl3xLQ4f2zpLV
|
||||
+6r7+62D5CkuNIO1SHVfqjHYQdMIa+pIj8tfWHODUM63iDOHjy2QQalSWwCg/zN3
|
||||
A5hZoo+7FwmmyndtIZzNfu8EANGohWj4wjrGP+qz12eQGctD76jlX9m9GSUWSDfz
|
||||
iflox9xSElOoa0kGlNe3iB4JbfgeWsDc8u1pKvWaOu7SVT1ob0X6ZSGDF+sZ178B
|
||||
YDbQEZ8wNK7vh7PvYmNTAdx8TjdeZH7BP0CqFXAefUIcf7IjxsCyoJKc0N/bBW5/
|
||||
wcXXBACRzkz2plYFRHuQJuma+vv1TZEnqUdU3xsDstiQzSUMltzHDNbGtDhZ+9XA
|
||||
ZfhkM3sSimyljUbdjnUf/F/ulFGJfFp+C0+CIDqtOeLwtq1oNRFzsPAXMJGTh0IY
|
||||
vss6/cpAGVBWhCt4nIL/o40xwte1YhcT3vEZ//CHKhlVhD+ozrQrTWFyayBOdWRl
|
||||
bG1hbiA8bWFya25AZ3JlZW53b29kc29mdHdhcmUuY29tPohgBBARAgAgAhkBBQJD
|
||||
AkHCBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ8VOnyDMjUlmy0wCfXc0HXCRm
|
||||
kcAmNIhzuk2luW0sx7gAoJHwtEAf/54QboxUlXfJ//IvsFhBuQINBEGxJ/oQCAD2
|
||||
Qle3CH8IF3KiutapQvMF6PlTETlPtvFuuUs4INoBp1ajFOmPQFXz0AfGy0OplK33
|
||||
TGSGSfgMg71l6RfUodNQ+PVZX9x2Uk89PY3bzpnhV5JZzf24rnRPxfx2vIPFRzBh
|
||||
znzJZv8V+bv9kV7HAarTW56NoKVyOtQa8L9GAFgr5fSI/VhOSdvNILSd5JEHNmsz
|
||||
bDgNRR0PfIizHHxbLY7288kjwEPwpVsYjY67VYy4XTjTNP18F1dDox0YbN4zISy1
|
||||
Kv884bEpQBgRjXyEpwpy1obEAxnIByl6ypUM2Zafq9AKUJsCRtMIPWakXUGfnHy9
|
||||
iUsiGSa6q6Jew1XpMgs7AAICB/95h7/V29mwuVP/uP55I6NmEyYwI2gLUNdRPmNj
|
||||
V+u/5gdh9DF9LQWj3Ko5vRmxVz3iAI3Nf2x7de+ULjEQruWsAvQgqjL1/NGQYupM
|
||||
k5gPLdYrd8pjJfcLOjOM5ykArSHLtnPvg8OgiwBBb2YezLed3U0Li6fpV/sI4vD/
|
||||
rE55LNP3vijgXtLEdA2BTVJk7cJnjAOseWD8ZesJIbWPMfgD5CrM5jDFOnFqTBNX
|
||||
YbrlEkI5faFL8y6HUTk5o9C1oHehgPtaDfYKmLVUWFQWVr1RzCILb8TiBjmlVvrH
|
||||
q01dBUrsXOHiuAdYc4mSVAzGEjZdy2OrbgQyHMxSYFWCHRCkiEYEGBECAAYFAkGx
|
||||
J/oACgkQ8VOnyDMjUlmPgACfZiXhixWbCD/W6D9dm7+isKy6D2oAn38AYHzvs+2L
|
||||
Uz6yQ9xi5xz636J9
|
||||
=QjER
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
95
less.spec
Normal file
95
less.spec
Normal file
@ -0,0 +1,95 @@
|
||||
#
|
||||
# spec file for package less
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2024 Andreas Stieger <Andreas.Stieger@gmx.de>
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%if ! %{defined _distconfdir}
|
||||
%define _distconfdir %{_sysconfdir}
|
||||
%else
|
||||
%define use_usretc 1
|
||||
%endif
|
||||
Name: less
|
||||
Version: 668
|
||||
Release: 0
|
||||
Summary: Text File Browser and Pager Similar to more
|
||||
License: BSD-2-Clause OR GPL-3.0-or-later
|
||||
Group: Productivity/Text/Utilities
|
||||
URL: https://www.greenwoodsoftware.com/less/
|
||||
Source: https://www.greenwoodsoftware.com/less/less-%{version}.tar.gz
|
||||
Source1: README.SUSE
|
||||
Source2: lessopen.sh
|
||||
Source3: lessclose.sh
|
||||
Source4: lesskey.src
|
||||
Source5: https://www.greenwoodsoftware.com/less/less-%{version}.sig
|
||||
Source6: https://www.greenwoodsoftware.com/less/pubkey.asc#/%{name}.keyring
|
||||
Patch0: less-429-shell.patch
|
||||
Patch2: less-429-more.patch
|
||||
Patch3: reproducible.patch
|
||||
BuildRequires: automake
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: pkgconfig
|
||||
# weak dependencies required only by preprocessor, which is disabled by default
|
||||
Recommends: file
|
||||
Recommends: /usr/bin/which
|
||||
|
||||
%description
|
||||
less is a text file browser and pager similar to more. It allows
|
||||
backward as well as forward movement within a file. Also, less does not
|
||||
have to read the entire input file before starting. It is possible to
|
||||
start an editor at any time from within less.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
#
|
||||
# the ./configure script is not writable for the normal user
|
||||
# rather fix permissions for all files
|
||||
chmod u+w *
|
||||
#
|
||||
cp %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} .
|
||||
|
||||
%build
|
||||
autoreconf -fiv
|
||||
export CFLAGS="%{optflags} -fPIE"
|
||||
export LDFLAGS="-pie"
|
||||
%configure
|
||||
#
|
||||
# regenerate help.c because less.hlp was patched
|
||||
./mkhelp.pl <less.hlp >help.c
|
||||
#
|
||||
# build less
|
||||
%make_build
|
||||
|
||||
%install
|
||||
%make_install
|
||||
#
|
||||
# lesskey
|
||||
install -m 755 -d %{buildroot}/%{_distconfdir}
|
||||
install -m 644 lesskey.src %{buildroot}/%{_distconfdir}/lesskey
|
||||
%{buildroot}%{_bindir}/lesskey -o %{buildroot}%{_distconfdir}/lesskey.bin %{buildroot}%{_distconfdir}/lesskey
|
||||
#
|
||||
# preprocessor
|
||||
install -m 755 lessopen.sh lessclose.sh %{buildroot}/%{_bindir}
|
||||
chmod -x LICENSE COPYING NEWS README.SUSE
|
||||
|
||||
%files
|
||||
%license LICENSE COPYING
|
||||
%doc NEWS README.SUSE
|
||||
%{_mandir}/*/*
|
||||
%{_distconfdir}/*
|
||||
%{_bindir}/*
|
||||
|
||||
%changelog
|
12
lessclose.sh
Normal file
12
lessclose.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2001 SUSE GmbH, Nuernberg, Germany
|
||||
# Copyright (c) 2002 SUSE Linux AG, Nuernberg, Germany
|
||||
#
|
||||
# Author: Vladimír Linek <vinil@suse.cz>
|
||||
#
|
||||
# Postprocessor for 'less'.
|
||||
# Use with environment variable: LESSCLOSE="lessclose.sh %s %s"
|
||||
#
|
||||
|
||||
test "$1" = "$2" || rm -f "$2"
|
101
lesskey.src
Normal file
101
lesskey.src
Normal file
@ -0,0 +1,101 @@
|
||||
#command
|
||||
\e[A back-line
|
||||
\e[B forw-line
|
||||
\eO5A back-line
|
||||
\eO5B forw-line
|
||||
\eO5C right-scroll
|
||||
\eO5D left-scroll
|
||||
\e[6~ forw-scroll
|
||||
\e[5~ back-scroll
|
||||
\217A back-line
|
||||
\217B forw-line
|
||||
\217C right-scroll
|
||||
\217D left-scroll
|
||||
\2336~ forw-scroll
|
||||
\2335~ back-scroll
|
||||
\177 back-screen
|
||||
^H back-screen
|
||||
\e[3~ back-screen
|
||||
\e[3;5~ back-screen
|
||||
\2333~ back-screen
|
||||
\e[2~ visual
|
||||
\e[2;5~ visual
|
||||
\2332~ visual
|
||||
\e[1~ goto-line
|
||||
\eOH goto-line
|
||||
\eO5H goto-line
|
||||
\e[4~ goto-end
|
||||
\eOF goto-end
|
||||
\eO5F goto-end
|
||||
\eOM forw-line
|
||||
#line-edit
|
||||
\eO5A up
|
||||
\eO5B down
|
||||
\eO5C right
|
||||
\eO5D left
|
||||
\217A up
|
||||
\217B down
|
||||
\217C right
|
||||
\217D left
|
||||
\177 backspace
|
||||
^H backspace
|
||||
\e[3~ delete
|
||||
\e[3;5~ delete
|
||||
\2333~ delete
|
||||
\e[1~ home
|
||||
\eOH home
|
||||
\eO5H home
|
||||
\217H home
|
||||
\e[4~ end
|
||||
\eOF end
|
||||
\eO5F end
|
||||
\217F end
|
||||
\e[5~ up
|
||||
\e[6~ down
|
||||
\e[5;5~ up
|
||||
\e[6;5~ down
|
||||
\2335~ up
|
||||
\2336~ down
|
||||
\e[2~ insert
|
||||
\e[2;5~ insert
|
||||
\2332~ insert
|
||||
\e[E insert
|
||||
\e[G insert
|
||||
\eOE insert
|
||||
\eOo insert :
|
||||
\eOj insert *
|
||||
\eOm insert -
|
||||
\eOk insert +
|
||||
\eOl insert ,
|
||||
\eOM insert
|
||||
\eOw insert 7
|
||||
\eOx insert 8
|
||||
\eOy insert 9
|
||||
\eOt insert 4
|
||||
\eOu insert 5
|
||||
\eOv insert 6
|
||||
\eOq insert 1
|
||||
\eOr insert 2
|
||||
\eOs insert 3
|
||||
\eOp insert 0
|
||||
\eOn insert .
|
||||
\217E insert
|
||||
\217o insert :
|
||||
\217j insert *
|
||||
\217m insert -
|
||||
\217k insert +
|
||||
\217l insert ,
|
||||
\217M insert
|
||||
\217w insert 7
|
||||
\217x insert 8
|
||||
\217y insert 9
|
||||
\217t insert 4
|
||||
\217u insert 5
|
||||
\217v insert 6
|
||||
\217q insert 1
|
||||
\217r insert 2
|
||||
\217s insert 3
|
||||
\217p insert 0
|
||||
\217n insert .
|
||||
#env
|
||||
LESSBINFMT=*s\%o
|
190
lessopen.sh
Normal file
190
lessopen.sh
Normal file
@ -0,0 +1,190 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2001 SUSE GmbH, Nuernberg, Germany
|
||||
# Copyright (c) 2002 SUSE Linux AG, Nuernberg, Germany
|
||||
#
|
||||
# Author: Vladimir Linek <vinil@suse.cz>
|
||||
# Support for directory listing by Dimitar Pashov <d.pashov@gmail.com>
|
||||
#
|
||||
# Preprocessor for 'less'.
|
||||
# Use with environment variable: LESSOPEN="lessopen.sh %s"
|
||||
|
||||
# the following hack does not break anything but helps to view file whose name
|
||||
# begins with a "-" or "+" with names
|
||||
if echo "$1" | grep -q ^/; then
|
||||
# absolute path
|
||||
SRC="$1"
|
||||
else
|
||||
# relative path
|
||||
SRC="./$1"
|
||||
fi
|
||||
|
||||
NAME="${SRC##*/}"
|
||||
|
||||
[ ! -r "$SRC" ] && exit 1
|
||||
|
||||
cleaner() {
|
||||
test "$TMPF_pre" = "$SRC" -o "$TMPF_pre" = "$TMPF" && return
|
||||
rm -f "$TMPF_pre"
|
||||
}
|
||||
trap 'cleaner' EXIT SIGHUP
|
||||
TMPF=$(mktemp /tmp/less.XXXXXXXXX) || exit 1
|
||||
TMPF_pre=$(mktemp /tmp/less.XXXXXXXXX) || exit 1
|
||||
|
||||
lang=$LANG
|
||||
test -n "$LC_CTYPE" && lang="$LC_CTYPE"
|
||||
case "$lang" in
|
||||
*.UTF-8|*.UTF8)
|
||||
GROFF_DEVICE=utf8
|
||||
;;
|
||||
ja*)
|
||||
GROFF_DEVICE=nippon
|
||||
;;
|
||||
*)
|
||||
GROFF_DEVICE=latin1
|
||||
;;
|
||||
esac
|
||||
|
||||
CMD=
|
||||
type=`/usr/bin/file -L "$SRC"`
|
||||
case ${type#"$SRC": } in
|
||||
*"gzip compressed data"*|\
|
||||
*"compress'd data"*|\
|
||||
*"packed data"*)
|
||||
CMD="gzip -dc" ;;
|
||||
*"Zip archive data"*)
|
||||
CMD="unzip -v" ;;
|
||||
*"bzip"*" compressed data"*)
|
||||
CMD="bzip2 -dc" ;;
|
||||
*"xz compressed data"*|\
|
||||
*"XZ compressed data"*)
|
||||
CMD="xz -dc" ;;
|
||||
*"Zstandard compressed data"*)
|
||||
CMD="zstd -dc" ;;
|
||||
*)
|
||||
rm -f "$TMPF_pre"
|
||||
TMPF_pre="$SRC" ;;
|
||||
esac
|
||||
|
||||
test -n "$CMD" && $CMD "$SRC" >"$TMPF_pre" 2>/dev/null
|
||||
|
||||
type=`/usr/bin/file -L "$TMPF_pre"`
|
||||
case ${type#"$TMPF_pre": } in
|
||||
*tar\ archive*)
|
||||
if [ -x "`/usr/bin/which tar 2>/dev/null`" ]; then
|
||||
tar tvvf "$TMPF_pre" >"$TMPF" 2>/dev/null
|
||||
else echo "tar is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*Microsoft\ Cabinet\ *\ data*)
|
||||
if [ -x "`/usr/bin/which cabextract 2>/dev/null`" ]; then
|
||||
cabextract -l "$TMPF_pre" >"$TMPF" 2>/dev/null
|
||||
else echo "cabextract is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*RPM*)
|
||||
if [ -x "`/usr/bin/which rpm 2>/dev/null`" ]; then
|
||||
(echo -e "=============================== Information ====================================\n";
|
||||
rpm -qip "\"$TMPF_pre\"";
|
||||
echo -e "\n\n================================= Changelog (head) =============================\n";
|
||||
rpm -qp --changelog "\"$TMPF_pre\"" | head -n 16
|
||||
echo -e "\n\n================================= Content ======================================\n";
|
||||
rpm -qlp "\"$TMPF_pre\""
|
||||
) >"$TMPF" 2>/dev/null
|
||||
else echo "rpm is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*DVI*)
|
||||
if [ -x "`/usr/bin/which dvi2tty 2>/dev/null`" ]; then
|
||||
if [ "${TMPF_pre%.dvi}" != "$TMPF_pre" ] ; then
|
||||
dvi2tty -q "$TMPF_pre" >"$TMPF" 2>/dev/null
|
||||
else echo "dvi2tty requires an input file name with the suffix .dvi" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre" ; fi
|
||||
else echo "dvi2tty is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*PDF*)
|
||||
if [ -x "`/usr/bin/which pdftotext 2>/dev/null`" ]; then
|
||||
pdftotext "$TMPF_pre" "$TMPF" 2>/dev/null
|
||||
else echo "pdftotext is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*Debian\ binary\ package*)
|
||||
if [ -x "`/usr/bin/which dpkg-deb 2>/dev/null`" ]; then
|
||||
dpkg-deb -c "$TMPF_pre" >"$TMPF" 2>/dev/null
|
||||
else echo "dpkg-deb is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*\ ar\ archive*)
|
||||
if [ -x "`/usr/bin/which nm 2>/dev/null`" ]; then
|
||||
nm "$TMPF_pre" >"$TMPF" 2>/dev/null
|
||||
else echo "nm is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*directory*)
|
||||
# assuming ls is always available
|
||||
ls -lh "$TMPF_pre" >"$TMPF" 2>/dev/null
|
||||
;;
|
||||
*diff\ output*)
|
||||
# I haven't found way, to set less -R from this script
|
||||
# so check, if '-R' or '--RAW-CONTROL-CHARS' is set in environment
|
||||
R_NOT_SET=true
|
||||
for i in $LESS; do
|
||||
if [ "${i:0:1}" = "-" ]; then
|
||||
if [ "${i:1:1}" = "-" ]; then
|
||||
if [ "$i" = --RAW-CONTROL-CHARS ]; then
|
||||
R_NOT_SET=false
|
||||
break
|
||||
else
|
||||
continue
|
||||
fi
|
||||
else
|
||||
for j in `seq 1 $((${#i} - 1 ))`; do
|
||||
if [ "${i:j:1}" = R ]; then
|
||||
R_NOT_SET=false
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# if we have -R and colordiff, we can continue
|
||||
if [ $R_NOT_SET = false ] && \
|
||||
[ -x "`/usr/bin/which colordiff 2>/dev/null`" ]; then
|
||||
colordiff < "$TMPF_pre" | cat > "$TMPF" 2>/dev/null
|
||||
else rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*)
|
||||
if [ "$LESS_ADVANCED_PREPROCESSOR" = "yes" ]; then
|
||||
case ${type#"$TMPF_pre": } in
|
||||
*troff*)
|
||||
if [ -x "`/usr/bin/which groff 2>/dev/null`" ]; then
|
||||
case "$NAME" in
|
||||
*.[1-9nxp]*|*.man|*.[1-9nxp]*.*|*.man.*)
|
||||
groff -s -p -t -e -T$GROFF_DEVICE -mandoc "$TMPF_pre" >"$TMPF" 2>/dev/null ;;
|
||||
*.ms|*.ms.*)
|
||||
groff -T$GROFF_DEVICE -ms "$TMPF_pre" >"$TMPF" 2>/dev/null ;;
|
||||
*.me|*.me.*)
|
||||
groff -T$GROFF_DEVICE -me "$TMPF_pre" >"$TMPF" 2>/dev/null ;;
|
||||
*)
|
||||
groff -T$GROFF_DEVICE "$TMPF_pre" >"$TMPF" 2>/dev/null ;;
|
||||
esac
|
||||
else echo "groff is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*PostScript*)
|
||||
if [ -x "`/usr/bin/which ps2ascii 2>/dev/null`" ]; then
|
||||
ps2ascii "$TMPF_pre" >"$TMPF" 2>/dev/null
|
||||
else echo "ps2ascii is not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*HTML*)
|
||||
if [ -x "`/usr/bin/which w3m 2>/dev/null`" ]; then
|
||||
w3m -dump -T text/html "$TMPF_pre" >"$TMPF" 2>/dev/null
|
||||
elif [ -x "`/usr/bin/which lynx 2>/dev/null`" ]; then
|
||||
lynx -dump -force_html "$TMPF_pre" >"$TMPF" 2>/dev/null
|
||||
else echo "lynx/w3m not available for preprocessing" 1>&2; rm -f "$TMPF"; TMPF="$TMPF_pre"; fi
|
||||
;;
|
||||
*)
|
||||
rm -f "$TMPF"
|
||||
TMPF="$TMPF_pre"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
rm -f "$TMPF"
|
||||
TMPF="$TMPF_pre"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
test "$TMPF" = "$SRC" || echo "$TMPF"
|
22
reproducible.patch
Normal file
22
reproducible.patch
Normal file
@ -0,0 +1,22 @@
|
||||
https://github.com/gwsw/less/pull/567
|
||||
From c02f7554a1e5685e4332fb6857e95761953c8db4 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Nudelman <markn@greenwoodsoftware.com>
|
||||
Date: Mon, 9 Sep 2024 14:48:10 -0700
|
||||
Subject: [PATCH] Allow SOURCE_DATE_EPOCH to override timestamps in generated
|
||||
files.
|
||||
|
||||
Related to #567.
|
||||
|
||||
diff --git a/mkhelp.pl b/mkhelp.pl
|
||||
index e93535b..452d9a0 100755
|
||||
--- a/mkhelp.pl
|
||||
+++ b/mkhelp.pl
|
||||
@@ -7,7 +7,7 @@ use strict;
|
||||
# whose content is the input to this script.
|
||||
|
||||
{
|
||||
- my ($sec,$min,$hour,$mday,$mon,$year) = gmtime();
|
||||
+ my ($sec,$min,$hour,$mday,$mon,$year) = gmtime($ENV{SOURCE_DATE_EPOCH} // time());
|
||||
printf "/* This file was generated by mkhelp.pl from less.hlp at %d:%02d on %d/%d/%d */\n",
|
||||
$hour, $min, $year+1900, $mon+1, $mday;
|
||||
print "#include \"less.h\"\n";
|
Loading…
x
Reference in New Issue
Block a user