diff options
author | CoprDistGit <infra@openeuler.org> | 2024-07-14 04:12:04 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-07-14 04:12:04 +0000 |
commit | bf4050f2f1952c876915397a03adee45fa31ac77 (patch) | |
tree | f5b6dfe0a06753959c878be691446baa131124b7 | |
parent | e66da3d58e62217d7864b58ea46aafc60a64ba00 (diff) |
automatic import of lessopeneuler24.03_LTS
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | less-394-time.patch | 11 | ||||
-rw-r--r-- | less-475-fsync.patch | 46 | ||||
-rw-r--r-- | less.csh | 15 | ||||
-rw-r--r-- | less.sh | 8 | ||||
-rw-r--r-- | less.spec | 166 | ||||
-rw-r--r-- | lesspipe.sh | 128 | ||||
-rw-r--r-- | sources | 1 |
8 files changed, 376 insertions, 0 deletions
@@ -0,0 +1 @@ +/less-661.tar.gz diff --git a/less-394-time.patch b/less-394-time.patch new file mode 100644 index 0000000..85f52b3 --- /dev/null +++ b/less-394-time.patch @@ -0,0 +1,11 @@ +--- less-394/Makefile.in.time 2005-09-14 04:21:38.000000000 +0200 ++++ less-394/Makefile.in 2007-02-07 13:21:24.000000000 +0100 +@@ -6,7 +6,7 @@ + VPATH = @srcdir@ + + CC = @CC@ +-INSTALL = @INSTALL@ ++INSTALL = @INSTALL@ -p + INSTALL_PROGRAM = @INSTALL_PROGRAM@ + INSTALL_DATA = @INSTALL_DATA@ + diff --git a/less-475-fsync.patch b/less-475-fsync.patch new file mode 100644 index 0000000..c964b31 --- /dev/null +++ b/less-475-fsync.patch @@ -0,0 +1,46 @@ +From 5396b6b77d0248678f716038dc747d6898acb0b3 Mon Sep 17 00:00:00 2001 +From: Stephen Gallagher <sgallagh@redhat.com> +Date: Fri, 22 Jan 2021 09:49:13 -0500 +Subject: [PATCH] Test for fsync on tty + +Signed-off-by: Stephen Gallagher <sgallagh@redhat.com> + +Modified for less 581.2 Filip Januš <fjanus@redhat.com> +diff -ur less-581.2/configure.ac less_fsync/configure.ac +--- less-581.2/configure.ac 2021-04-28 17:00:08.000000000 +0200 ++++ less_fsync/configure.ac 2021-05-06 10:59:07.560062397 +0200 +@@ -221,6 +221,8 @@ + [Define HAVE_TIME_T if your system supports the "time_t" type.]) + AH_TEMPLATE([HAVE_STRERROR], + [Define HAVE_STRERROR if you have the strerror() function.]) ++AH_TEMPLATE([HAVE_FSYNC], ++ [Define HAVE_FSYNC if fsync() on a tty works.]) + AH_TEMPLATE([HAVE_FILENO], + [Define HAVE_FILENO if you have the fileno() macro.]) + AH_TEMPLATE([HAVE_ERRNO], +@@ -274,7 +276,7 @@ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int f(int a) { return a; }]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ANSI_PROTOS)],[AC_MSG_RESULT(no)]) + + # Checks for library functions. +-AC_CHECK_FUNCS([fchmod fsync nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat strsignal system ttyname usleep]) ++AC_CHECK_FUNCS([fchmod nanosleep poll popen realpath _setjmp sigprocmask sigsetmask snprintf stat strsignal system ttyname usleep]) + + # AC_CHECK_FUNCS may not work for inline functions, so test these separately. + AC_MSG_CHECKING(for memcpy) +@@ -321,6 +323,16 @@ + #include <errno.h> + #endif]], [[static char *x; x = strerror(0);]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_STRERROR)],[AC_MSG_RESULT(no)]) + ++AC_MSG_CHECKING(for fsync) ++AC_TRY_RUN([ ++#include <fcntl.h> ++#include <unistd.h> ++int main(void) ++{ ++ int fd = open("/dev/tty", O_RDWR); ++ return fsync(fd); ++}], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FSYNC)], [AC_MSG_RESULT(no)]) ++ + AC_MSG_CHECKING(for sys_errlist) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *sys_errlist[]; static char **x; x = sys_errlist;]])],[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_ERRLIST)],[AC_MSG_RESULT(no)]) + diff --git a/less.csh b/less.csh new file mode 100644 index 0000000..d3c1f8e --- /dev/null +++ b/less.csh @@ -0,0 +1,15 @@ +# less initialization script (csh) + +# All less.*sh files should have the same semantics! + +# In case you are curious, the test for non-emptiness is not as easy as in +# Bourne shell. This "eval" construct is probably inspired by Stack +# Overflow question 13343392. +if ( $?LESSOPEN && { eval 'test ! -z "$LESSOPEN"' } ) then + : +else + if ( -x /usr/bin/lesspipe.sh ) then + # The '||' here is intentional, see rhbz#1254837. + setenv LESSOPEN "||/usr/bin/lesspipe.sh %s" + endif +endif @@ -0,0 +1,8 @@ +# less initialization script (sh) + +# All less.*sh files should have the same semantics! + +if [ -z "$LESSOPEN" ] && [ -x /usr/bin/lesspipe.sh ]; then + # The '||' here is intentional, see rhbz#1254837. + export LESSOPEN="||/usr/bin/lesspipe.sh %s" +fi diff --git a/less.spec b/less.spec new file mode 100644 index 0000000..afdee82 --- /dev/null +++ b/less.spec @@ -0,0 +1,166 @@ +Name: less +Version: 661 +Release: 1 +Summary: Less is a pager that displays text files. +License: GPL-3.0-only and BSD-2-Clause +URL: http://www.greenwoodsoftware.com/less +Source0: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz +Source1: lesspipe.sh +Source2: less.sh +Source3: less.csh +Patch0: less-394-time.patch +Patch1: less-475-fsync.patch + +BuildRequires: gcc make ncurses-devel autoconf automake libtool + +%description +Less is a pager. A pager is a program that displays text files. +Other pagers commonly in use are more and pg. Pagers are often +used in command-line environments like the Unix shell and the MS-DOS +command prompt to display files. + +Less is not an editor. You can't change the contents of the file +you're viewing. Less is not a windowing system. It doesn't have +fancy scroll bars or other GUI (graphical user interface) elements. + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +rm -f ./configure +autoreconf -ivf +%configure +%make_build CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" + +%install +%make_install +mkdir -p %{buildroot}%{_sysconfdir}/profile.d +install -p %{S:1} %{buildroot}%{_bindir} +install -p -m 644 %{S:2} %{buildroot}%{_sysconfdir}/profile.d +install -p -m 644 %{S:3} %{buildroot}%{_sysconfdir}/profile.d + +%files +%license LICENSE COPYING +%{_bindir}/less* +%{_sysconfdir}/profile.d/* + +%files help +%doc README NEWS INSTALL +%{_mandir}/man1/* + +%changelog +* Sun Jul 14 2024 Funda Wang <fundawang@yeah.net> - 661-1 +- Update to 661 + +* Sat May 11 2024 zhangxingrong <zhangxingrong@uniontech.com> - 633-4 +- backport some upstream patch + +* Mon Apr 29 2024 huyubiao <huyubiao@huawei.com> - 633-3 +- fix problem when a program piping into less reads from the tty, like sudo asking for password + +* Mon Apr 22 2024 wangjiang <wangjiang37@h-partners.com> - 633-2 +- fix CVE-2024-32487 + +* Tue Jan 30 2024 hongjinghao <hongjinghao@huawei.com> - 633-1 +- Update to 633 + +* Thu Mar 16 2023 EibzChan <chenbingzhao@huawei.com> - 608-4 +- remove unstable test patches and test compilation option + +* Fri Feb 17 2023 hongjinghao <hongjinghao@huawei.com> - 608-3 +- fix CVE-2022-46663 + +* Thu Dec 15 2022 EibzChan <chenbingzhao@huawei.com> - 608-2 +- Type:test enhancement +- ID:NA +- SUG:NA +- DESC:backport patches from upstream to enable make check. + backport-makecheck-0000-add-lesstest.patch + backport-makecheck-0001-Work-on-lesstest-remove-rstat-add-LESS_DUMP_CHAR.patch + backport-makecheck-0002-lesstest-correctly-handle-less-exit-during-run_inter.patch + backport-makecheck-0003-Some-runtest-tweaks.patch + backport-makecheck-0004-Rearrange-signal-handling-a-little.patch + backport-makecheck-0005-Don-t-setup_term-in-test-mode.patch + backport-makecheck-0006-Compile-fixes.patch + backport-makecheck-0007-Pass-less-specific-env-variables-to-lesstest-get-rid.patch + backport-makecheck-0008-Move-terminal-init-deinit-to-run_interactive-since.patch + backport-makecheck-0009-Fix-bug-in-setting-env-vars-from-lt-file-in-test-mod.patch + backport-makecheck-0010-Make-runtest-work.patch + backport-makecheck-0011-lesstest-in-interactive-mode-call-setup_term-before-.patch + backport-makecheck-0012-lesstest-log-LESS_TERMCAP_-vars-so-termcap-keys-etc.patch + backport-makecheck-0013-lesstest-accommodate-stupid-termcap-design-where-the.patch + backport-makecheck-0014-lesstest-maketest-should-not-overwrite-existing-lt-f.patch + backport-makecheck-0015-lesstest-add-O-option-to-maketest-if-textfile-is-not.patch + backport-makecheck-0016-lesstest-add-O-option-to-lesstest.patch + backport-makecheck-0017-lesstest-handle-colored-text-with-less-R.patch + backport-makecheck-0018-lesstest-add-e-option.patch + backport-makecheck-0019-lesstest-split-display_screen-into-display_screen_de.patch + backport-makecheck-0020-Add-E-option.patch + backport-makecheck-0021-Consistent-style.patch + backport-makecheck-0022-Obsolete-file.patch + backport-makecheck-0023-Tuesday-style.patch + backport-makecheck-0024-Tuesday-style.patch + backport-makecheck-0025-lesstest-add-support-for-combining-and-composing-cha.patch + backport-makecheck-0026-Minor-runtest-output-tweaks.patch + backport-makecheck-0027-lesstest-lt_screen-should-clear-param-stack-after-pr.patch + backport-makecheck-0028-Handle-fg-and-bg-colors.patch + backport-makecheck-0029-Have-lt_screen-use-ANSI-sequences-for-bold-underline.patch + backport-makecheck-0030-ESC-m-should-clear-attributes-as-well-as-colors.patch + backport-makecheck-0031-lesskey-make-lt_screen-treat-ESC-0m-like-ESC-m.patch + backport-makecheck-0032-Store-2-char-hex-values-in-log-file-rather-than-bina.patch + backport-makecheck-0033-lesstest-Make-display_screen_debug-write-to-stderr-n.patch + backport-makecheck-0034-lesstest-Clear-screen-at-end-of-maketest-in-case-ter.patch + backport-makecheck-0035-lesstest-Verify-that-the-less-binary-is-built-with-D.patch + backport-makecheck-0036-Add-check-target-to-Makefile-to-run-lesstest.patch + backport-makecheck-0037-Don-t-set-LESS_TERMCAP_xx-environment-vars-from-term.patch + backport-makecheck-0038-lesstest-Remove-unnecessary-exit_all_modes-field-fro.patch + backport-makecheck-0039-lesstest-Add-some-initial-lt-files.patch + backport-makecheck-0040-lesstest-Remove-empty-lt-file.patch + backport-makecheck-0041-lesstest-Add-a-couple-more-lt-files.patch + backport-makecheck-0042-Make-make-check-work-regardless-of-directory-where-l.patch + +* Fri Nov 18 2022 dillon chen <dillon.chen@gmail.com> - 608-1 +- update to 608 + +* Thu Oct 13 2022 fuanan <fuanan3@h-partners.com> - 590-2 +- DESC:fix the changelog exception macro + +* Fri Sep 24 2021 fuanan <fuanan3@huawei.com> - 590-1 +- update version to 590 + +* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 563-3 +- DESC: delete -S git from autosetup, and delete BuildRequires git + +* Fri May 28 2021 fuanan <fuanan3@huawei.com> - 563-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:[add] backport patches from upstream + Create only one ifile when a file is opened under different names. + Remove extraneous frees, associated with removed call to lrealpath. + Fix crash when call set_ifilename with a pointer to the name that is + Remove unnecessary call to pshift in pappend. + Reset horizontal shift when opening a new file. + Protect from buffer overrun. + Make histpattern return negative value to indicate error. + Lesskey: don't translate ctrl-K in an EXTRA string. + Ignore SIGTSTP in secure mode. + Fix "Tag not found" error while looking for a tag's location + Fix minor memory leak with input preprocessor. + +* Thu Jan 21 2021 wangchen <wangchen137@huawei.com> - 563-1 +- Update to 563 + +* Thu Jan 09 2020 openEuler Buildteam <buildteam@openeuler.org> - 551-3 +- Delete unneeded files + +* Fri Sep 27 2019 yefei <yefei25@huawei.com> - 551-2 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC: delete irrelevant comment + +* Tue Sep 10 2019 openEuler Buildteam <buildteam@openeuler.org> - 551-1 +- Package Init diff --git a/lesspipe.sh b/lesspipe.sh new file mode 100644 index 0000000..f2df6a1 --- /dev/null +++ b/lesspipe.sh @@ -0,0 +1,128 @@ +#!/bin/sh +# +# To use this filter with less, define LESSOPEN: +# export LESSOPEN="|/usr/bin/lesspipe.sh %s" +# +# The script should return zero if the output was valid and non-zero +# otherwise, so less could detect even a valid empty output +# (for example while uncompressing gzipped empty file). +# For backward-compatibility, this is not required by default. To turn +# this functionality there should be another vertical bar (|) straight +# after the first one in the LESSOPEN environment variable: +# export LESSOPEN="||/usr/bin/lesspipe.sh %s" + +if [ ! -e "$1" ] ; then + exit 1 +fi + +if [ -d "$1" ] ; then + ls -alF -- "$1" + exit $? +fi + +exec 2>/dev/null + +# Allow for user defined filters +if [ -x ~/.lessfilter ]; then + ~/.lessfilter "$1" + if [ $? -eq 0 ]; then + exit 0 + fi +fi + +manfilter () +{ + if test -x /usr/bin/man ; then + # See rhbz#1241543 for more info. Well, actually we firstly + # used 'man -l', then we switched to groff, and then we again + # switched back to 'man -l'. + /usr/bin/man -P /usr/bin/cat -l "$1" + elif test -x /usr/bin/groff; then + # This is from pre-rhbz#1241543-time. + groff -Tascii -mandoc "$1" | cat -s + else + echo "WARNING:" + echo "WARNING: to better show manual pages, install 'man-db' package" + echo "WARNING:" + cat "$1" + fi +} + +export MAN_KEEP_FORMATTING=1 + +case "$1" in +*.[1-9n].bz2|*.[1-9]x.bz2|*.man.bz2|*.[1-9n].[glx]z|*.[1-9]x.[glx]z|*.man.[glx]z|*.[1-9n].lzma|*.[1-9]x.lzma|*.man.lzma|*.[1-9n].zst|*.[1-9]x.zst|*.man.zst|*.[1-9n].br|*.[1-9]x.br|*.man.br) + case "$1" in + *.gz) DECOMPRESSOR="gzip -dc" ;; + *.bz2) DECOMPRESSOR="bzip2 -dc" ;; + *.lz) DECOMPRESSOR="lzip -dc" ;; + *.zst) DECOMPRESSOR="zstd -dcq" ;; + *.br) DECOMPRESSOR="brotli -dc" ;; + *.xz|*.lzma) DECOMPRESSOR="xz -dc" ;; + esac + if [ -n "$DECOMPRESSOR" ] && $DECOMPRESSOR -- "$1" | file - | grep -q troff; then + $DECOMPRESSOR -- "$1" | manfilter - + exit $? + fi ;;& +*.[1-9n]|*.[1-9]x|*.man) + if file "$1" | grep -q troff; then + manfilter "$1" + exit $? + fi ;;& +*.tar) tar tvvf "$1"; exit $? ;; +*.tgz|*.tar.gz|*.tar.[zZ]) tar tzvvf "$1"; exit $? ;; +*.tar.xz) tar Jtvvf "$1"; exit $? ;; +*.xz|*.lzma) xz -dc -- "$1"; exit $? ;; +*.tar.lz) tar --lzip -tvvf "$1"; exit $? ;; +*.lz) lzip -dc -- "$1"; exit $? ;; +*.tar.zst) tar --zstd -tvvf "$1"; exit $? ;; +*.zst) zstd -dcq -- "$1"; exit $? ;; +*.tar.br) brotli -dc -- "$1" | tar tvvf -; exit $? ;; +*.br) brotli -dc -- "$1"; exit $? ;; +*.tar.bz2|*.tbz2) bzip2 -dc -- "$1" | tar tvvf -; exit $? ;; +*.[zZ]|*.gz) gzip -dc -- "$1"; exit $? ;; +*.bz2) bzip2 -dc -- "$1"; exit $? ;; +*.zip|*.jar|*.nbm) zipinfo -- "$1"; exit $? ;; +# --nomanifest -> rhbz#1450277 +*.rpm) rpm -qpivl --changelog --nomanifest -- "$1"; exit $? ;; +*.cpi|*.cpio) cpio -itv < "$1"; exit $? ;; +*.gpg) + if [ -x /usr/bin/gpg2 ]; then + gpg2 -d "$1" + exit $? + elif [ -x /usr/bin/gpg ]; then + gpg -d "$1" + exit $? + else + echo "No GnuPG available." + echo "Install gnupg2 or gnupg to show encrypted files." + exit 1 + fi ;; +*.gif|*.jpeg|*.jpg|*.pcd|*.png|*.tga|*.tiff|*.tif) + if [ -x /usr/bin/identify ]; then + identify "$1" + exit $? + elif [ -x /usr/bin/gm ]; then + gm identify "$1" + exit $? + else + echo "No identify available" + echo "Install ImageMagick or GraphicsMagick to browse images" + exit 1 + fi ;; +*) + if [ -x /usr/bin/file ] && [ -x /usr/bin/iconv ] && [ -x /usr/bin/cut ]; then + case `file -b "$1"` in + *UTF-16*) conv='UTF-16' ;; + *UTF-32*) conv='UTF-32' ;; + esac + if [ -n "$conv" ]; then + env=`echo $LANG | cut -d. -f2` + if [ -n "$env" -a "$conv" != "$env" ]; then + iconv -f $conv -t $env "$1" + exit $? + fi + fi + fi + exit 1 +esac @@ -0,0 +1 @@ +44f54b6313c5d71fa1ac224d8d84766a less-661.tar.gz |