Compare commits

..

12 Commits
master ... f13

Author SHA1 Message Date
Vojtech Vitek (V-Teq)
051cac53ff Don't convert files with UTF-16/UTF-32 string in filename 2011-04-13 16:55:21 +02:00
Vojtech Vitek (V-Teq)
9eb8cf8b45 Release build 436-9 2011-02-15 15:42:36 +01:00
Vojtech Vitek (V-Teq)
c74bca4632 - Enable LESSOPEN exit statuses as default also in less.sh 2011-02-15 15:40:10 +01:00
Vojtech Vitek (V-Teq)
a587b98d60 - Clean lesspipe.sh script 2011-02-15 15:39:57 +01:00
Vojtech Vitek (V-Teq)
f197286adf - Add support for *.xz and *.lzma man pages
Split case for compressed and plain troff files

Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2011-02-15 15:39:49 +01:00
Vojtech Vitek (V-Teq)
674b3188a8 - Add support for reading UTF-16 and UTF-32 files 2011-02-15 15:39:41 +01:00
Vojtech Vitek (V-Teq)
40c2f63c88 - Don't require correct exit status from LESSOPEN scripts 2011-02-15 15:39:23 +01:00
Vojtech Vitek (V-Teq)
8a2da05adb - Fix regression in lesspipe.sh script (*.gz files etc.)
Resolves #615303 (comment #9)
2011-01-03 10:34:27 +01:00
Vojtech Vitek (V-Teq)
44917d8329 - Fix for valid empty LESSOPEN pipe output
Resolves: #579251, #615303
- The new "--old-bot" option is not documented in the man page
  Resolves: #510724
- Fix descriptions of some options in online help
  Resolves: #578289 (Jeff Bastian <jbastian@redhat.com>)[IT603793]
2010-12-23 11:52:54 +01:00
Fedora Release Engineering
90568d8b51 dist-git conversion 2010-07-28 20:36:25 +00:00
Nikola Pajkovsky
0e0f6268fa RFE: lesspipe.sh could use a support for *.xz file 2010-04-12 08:12:24 +00:00
Jesse Keating
bb9d9edb26 Initialize branch F-13 for less 2010-02-17 01:49:00 +00:00
14 changed files with 284 additions and 432 deletions

4
.gitignore vendored
View File

@ -1,3 +1 @@
/less-530.tar.gz
/less-550.tar.gz
/less-551.tar.gz
less-436.tar.gz

105
less-406-Foption.patch Normal file
View File

@ -0,0 +1,105 @@
--- less-406/main.c.Foption 2007-06-17 18:56:04.000000000 +0200
+++ less-406/main.c 2008-01-11 10:18:46.000000000 +0100
@@ -33,6 +33,7 @@ public int quitting;
public int secure;
public int dohelp;
public int less_is_more;
+public int line_count;
#if LOGFILE
public int logfile = -1;
@@ -280,6 +281,16 @@ main(argc, argv)
{
if (edit_first()) /* Edit first valid file in cmd line */
quit(QUIT_ERROR);
+ /*
+ * In case that we have only one file and -F, have to get a line
+ * count fot init(). If the line count is less then a height of a term,
+ * the content of the file is printed out and then less quits. Otherwise
+ * -F can not be used
+ */
+ if (nifile() == 1 && quit_if_one_screen)
+ line_count = get_line_count();
+ else if (nifile() > 1) /* In case more than one file, -F can not be used */
+ quit_if_one_screen = FALSE;
}
init();
--- less-406/screen.c.Foption 2007-06-17 18:56:04.000000000 +0200
+++ less-406/screen.c 2008-01-11 10:20:00.000000000 +0100
@@ -204,6 +204,7 @@ public int missing_cap = 0; /* Some capa
static int attrmode = AT_NORMAL;
extern int binattr;
+extern int line_count;
#if !MSDOS_COMPILER
static char *cheaper();
@@ -233,6 +234,7 @@ extern int wscroll;
extern int screen_trashed;
extern int tty;
extern int top_scroll;
+extern int quit_if_one_screen;
extern int oldbot;
#if HILITE_SEARCH
extern int hilite_search;
@@ -1534,7 +1536,9 @@ win32_deinit_term()
init()
{
#if !MSDOS_COMPILER
- if (!no_init)
+ if (quit_if_one_screen && line_count >= sc_height)
+ quit_if_one_screen = FALSE;
+ if (!no_init && !quit_if_one_screen)
tputs(sc_init, sc_height, putchr);
if (!no_keypad)
tputs(sc_s_keypad, sc_height, putchr);
@@ -1573,8 +1577,9 @@ deinit()
#if !MSDOS_COMPILER
if (!no_keypad)
tputs(sc_e_keypad, sc_height, putchr);
- if (!no_init)
- tputs(sc_deinit, sc_height, putchr);
+ if (!no_init && !quit_if_one_screen)
+ tputs(sc_deinit, sc_height, putchr);
+
#else
/* Restore system colors. */
SETCOLORS(sy_fg_color, sy_bg_color);
--- less-406/funcs.h.Foption 2007-03-24 07:27:54.000000000 +0100
+++ less-406/funcs.h 2008-01-11 09:36:16.000000000 +0100
@@ -126,6 +126,7 @@
public void forward ();
public void backward ();
public int get_back_scroll ();
+ public int get_line_count ();
public void del_ifile ();
public IFILE next_ifile ();
public IFILE prev_ifile ();
--- less-406/forwback.c.Foption 2007-06-17 18:56:04.000000000 +0200
+++ less-406/forwback.c 2008-01-11 09:37:15.000000000 +0100
@@ -410,3 +410,24 @@ get_back_scroll()
return (sc_height - 2);
return (10000); /* infinity */
}
+
+/*
+ * Get line count of file
+ */
+ public int
+get_line_count()
+{
+ int nlines = 0;
+ POSITION pos;
+
+ pos = position(TOP);
+
+ while (pos != NULL_POSITION && nlines <= sc_height)
+ {
+ pos = forw_line(pos);
+ nlines++;
+ }
+
+ return nlines;
+}
+

View File

@ -14,8 +14,8 @@ diff -ur less-418.orig/configure.ac less-418/configure.ac
# Checks for library functions.
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([fsync popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod realpath])
+AC_CHECK_FUNCS([popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod realpath])
-AC_CHECK_FUNCS([fsync popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod])
+AC_CHECK_FUNCS([popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod])
# AC_CHECK_FUNCS may not work for inline functions, so test these separately.
AC_MSG_CHECKING(for memcpy)

View File

@ -0,0 +1,87 @@
diff -rup less-436-orig/filename.c less-436/filename.c
--- less-436-orig/filename.c 2009-07-06 22:52:23.000000000 +0200
+++ less-436/filename.c 2011-02-09 16:36:59.508940154 +0100
@@ -843,6 +843,16 @@ open_altfile(filename, pf, pfd)
#else
lessopen++;
returnfd = 1;
+
+ if (*lessopen == '|') {
+ /*
+ * If there is another vertical bar |, after
+ * the first one, it indicates a "pipe preprocessor"
+ * with correct exit status.
+ */
+ lessopen++;
+ returnfd = 2;
+ }
#endif
}
if (*lessopen == '-') {
@@ -879,17 +888,32 @@ open_altfile(filename, pf, pfd)
*/
f = fileno(fd);
SET_BINARY(f);
+ *pfd = (void *) fd;
+ *pf = f;
if (read(f, &c, 1) != 1)
{
/*
- * Pipe is empty. This means there is no alt file.
+ * Error or pipe is empty. Close it and eventually
+ * check exit status of the pipe process.
*/
- pclose(fd);
+ if (pclose(fd) == 0 && returnfd == 2) {
+ /*
+ * Exit status was zero, so the EOF was correct
+ * empty output. Let the program open /dev/null
+ * instead, as the pipe is already closed.
+ * Set force_open to omit bad_file() check
+ * failure, as it is special 'c' pseudo-device.
+ */
+ *pf = 0;
+ *pfd = NULL;
+ force_open = 1;
+ return (save("/dev/null"));
+ }
+ *pf = 0;
+ *pfd = NULL;
return (NULL);
}
ch_ungetchar(c);
- *pfd = (void *) fd;
- *pf = f;
return (save("-"));
}
#endif
diff -rup less-436-orig/less.nro less-436/less.nro
--- less-436-orig/less.nro 2011-02-09 16:00:12.520936431 +0100
+++ less-436/less.nro 2011-02-09 16:30:33.161235986 +0100
@@ -1147,11 +1147,26 @@ lesspipe.sh:
.br
;;
.br
+ *) exit 1
+.br
+ ;;
+.br
esac
.br
+ exit $?
+.br
.PP
To use this script, put it where it can be executed and set
LESSOPEN="|lesspipe.sh %s".
+.PP
+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, eg.
+LESSOPEN="||lesspipe.sh %s".
+.PP
When an input pipe is used, a LESSCLOSE postprocessor can be used,
but it is usually not necessary since there is no replacement file
to clean up.

View File

@ -0,0 +1,10 @@
--- less-436/less.nro.manpage 2009-07-08 00:27:21.000000000 +0200
+++ less-436/less.nro 2010-01-04 14:45:16.979806602 +0100
@@ -1290,7 +1290,6 @@ The remainder of LESSBINFMT is a string
printf-style escape sequence (a % followed by x, X, o, d, etc.).
For example, if LESSBINFMT is "*u[%x]", binary characters
are displayed in underlined hexadecimal surrounded by brackets.
-The default if no LESSBINFMT is specified is "*s<%X>".
The default if no LESSBINFMT is specified is "*s<%02X>".
Warning: the result of expanding the character via LESSBINFMT must
be less than 31 characters.

View File

@ -1,22 +0,0 @@
diff -up less-466/less.nro.filters-man less-466/less.nro
--- less-466/less.nro.filters-man 2014-09-18 14:32:32.124111631 +0200
+++ less-466/less.nro 2014-09-18 14:32:39.548177152 +0200
@@ -1234,6 +1234,18 @@ Similarly, if the first two characters o
the input pipe is used on standard input as well as other files.
Again, in this case the dash is not considered to be part of
the input pipe command.
+.PP
+There are used following files to set up default preprocessor:
+.br
+ /etc/profile.d/less.sh
+.br
+ /etc/profile.d/less.csh
+.br
+These files set up /usr/bin/lesspipe.sh as a default filter. An user defined
+filter can be specified in ~/.lessfilter. This file should have an execute bit
+set and accept only one parameter, which represents a filename. If
+the user defined filter process the file, zero should be returned. Otherwise
+~/.lessfilter tries to handle the file.
.SH "NATIONAL CHARACTER SETS"
There are three types of characters in the input file:

View File

@ -1,33 +0,0 @@
diff -upr less-458_orig/lessecho.c less-458_work/lessecho.c
--- less-458_orig/lessecho.c 2013-05-07 14:03:52.091104655 +0200
+++ less-458_work/lessecho.c 2013-05-07 11:21:10.883991862 +0200
@@ -41,7 +41,27 @@ static int num_metachars = 0;
pr_usage(VOID_PARAM)
{
fprintf(stderr,
- "usage: lessecho [-ox] [-cx] [-pn] [-dn] [-mx] [-nn] [-ex] [-fn] [-a] file ...\n");
+ "usage: lessecho [-ox] [-cx] [-pn] [-dn] [-mx] [-nn] [-ex] [-fn] [-a] file ...\n\n");
+ fprintf(stderr,
+ " -ox\t- specifies \"x\" to be the open quote character\n");
+ fprintf(stderr,
+ " -cx\t- specifies \"x\" to be the close quote character\n");
+ fprintf(stderr,
+ " -pn\t- specifies \"n\" to be the open quote character, as an integer\n");
+ fprintf(stderr,
+ " -dn\t- specifies \"n\" to be the close quote character, as an integer\n");
+ fprintf(stderr,
+ " -mx\t- specifies \"x\" to be a metachar\n");
+ fprintf(stderr,
+ " -nn\t- specifies \"n\" to be a metachar, as an integer\n");
+ fprintf(stderr,
+ " -ex\t- specifies \"x\" to be the escape char for metachars\n");
+ fprintf(stderr,
+ " -fn\t- specifies \"n\" to be the escape char for metachars, as an integer\n");
+ fprintf(stderr,
+ " -a\t- specifies that all arguments are to be quoted\n");
+ fprintf(stderr,
+ " -?\t- prints this help\n");
}
static void

View File

@ -1,20 +0,0 @@
diff -upr less-458_orig/lesskey.c less-458_work/lesskey.c
--- less-458_orig/lesskey.c 2013-05-07 14:03:52.062104533 +0200
+++ less-458_work/lesskey.c 2013-05-07 11:21:10.881991855 +0200
@@ -217,7 +217,15 @@ extern char version[];
void
usage(VOID_PARAM)
{
- fprintf(stderr, "usage: lesskey [-o output] [input]\n");
+ fprintf(stderr, "usage: lesskey [-o output] [input]\n\n");
+ fprintf(stderr,
+ " -o output\t- specify output file, otherwise $HOME/.less is used\n");
+ fprintf(stderr,
+ " -i input\t- specify input file, otherwise standard input is used\n");
+ fprintf(stderr,
+ " -V\t\t- print lesskey version\n");
+ fprintf(stderr,
+ " -h\t\t- print this help\n");
exit(1);
}

View File

@ -1,24 +0,0 @@
diff -up less-458/help.c.oldbothelp less-458/help.c
--- less-458/help.c.oldbothelp 2014-02-03 16:49:34.000000000 +0100
+++ less-458/help.c 2014-02-03 16:50:17.202836595 +0100
@@ -138,6 +138,8 @@ constant char helpdata[] = {
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','H','i','g','h','l','i','g','h','t',' ','o','n','l','y',' ','l','a','s','t',' ','m','a','t','c','h',' ','f','o','r',' ','s','e','a','r','c','h','e','s','.','\n',
' ',' ','-','G',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','H','I','L','I','T','E','-','S','E','A','R','C','H','\n',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','o','n','\'','t',' ','h','i','g','h','l','i','g','h','t',' ','a','n','y',' ','m','a','t','c','h','e','s',' ','f','o','r',' ','s','e','a','r','c','h','e','s','.','\n',
+' ',' ','-','-','o','l','d','-','b','o','t','\n',
+' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','R','e','v','e','r','t',' ','t','o',' ','t','h','e',' ','o','l','d',' ','b','o','t','t','o','m',' ','o','f',' ','s','c','r','e','e','n',' ','b','e','h','a','v','i','o','r','.','\n',
' ',' ','-','h',' ','[','_','\b','N',']',' ',' ','.','.','.','.',' ',' ','-','-','m','a','x','-','b','a','c','k','-','s','c','r','o','l','l','=','[','_','\b','N',']','\n',
' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','B','a','c','k','w','a','r','d',' ','s','c','r','o','l','l',' ','l','i','m','i','t','.','\n',
' ',' ','-','i',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','i','g','n','o','r','e','-','c','a','s','e','\n',
diff -up less-458/less.hlp.oldbothelp less-458/less.hlp
--- less-458/less.hlp.oldbothelp 2014-02-03 16:49:34.503555646 +0100
+++ less-458/less.hlp 2014-02-03 16:49:34.507555673 +0100
@@ -135,6 +135,8 @@
Highlight only last match for searches.
-G ........ --HILITE-SEARCH
Don't highlight any matches for searches.
+ --old-bot
+ Revert to the old bottom of screen behavior.
-h [_N] .... --max-back-scroll=[_N]
Backward scroll limit.
-i ........ --ignore-case

15
less.csh Normal file → Executable file
View File

@ -1,15 +1,4 @@
# 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
if ( -x /usr/bin/lesspipe.sh ) then
setenv LESSOPEN "||/usr/bin/lesspipe.sh %s"
endif

8
less.sh Normal file → Executable file
View File

@ -1,8 +1,2 @@
# 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
[ -x /usr/bin/lesspipe.sh ] && export LESSOPEN="||/usr/bin/lesspipe.sh %s"

296
less.spec
View File

@ -1,22 +1,24 @@
Summary: A text file browser similar to more, but better
Name: less
Version: 551
Release: 2%{?dist}
License: GPLv3+ or BSD
Version: 436
Release: 10%{?dist}
License: GPLv3+
Group: Applications/Text
Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz
Source1: lesspipe.sh
Source2: less.sh
Source3: less.csh
Patch1: less-406-Foption.patch
Patch4: less-394-time.patch
Patch5: less-418-fsync.patch
Patch6: less-436-manpage-add-old-bot-option.patch
Patch7: less-436-help.patch
Patch8: less-458-lessecho-usage.patch
Patch9: less-458-less-filters-man.patch
Patch10: less-458-lesskey-usage.patch
Patch11: less-458-old-bot-in-help.patch
Patch7: less-436-manpage-del-extra-line.patch
Patch8: less-436-help.patch
Patch9: less-436-empty-lessopen-pipe.patch
URL: http://www.greenwoodsoftware.com/less/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ncurses-devel
BuildRequires: pcre-devel
BuildRequires: autoconf automake libtool
%description
@ -31,258 +33,70 @@ files, and you'll use it frequently.
%prep
%setup -q
%patch1 -p1 -b .Foption
%patch4 -p1 -b .time
%patch5 -p1 -b .fsync
%patch6 -p1 -b .manpage-add-old-bot-option
%patch7 -p1 -b .help
%patch8 -p1 -b .lessecho-usage
%patch9 -p1 -b .less-filters-man
%patch10 -p1 -b .lesskey-usage
%patch11 -p1 -b .old-bot
%patch7 -p1 -b .manpage-del-extra-line
%patch8 -p1 -b .help
%patch9 -p1 -b .empty-lessopen-pipe
autoreconf
chmod -R a+w *
chmod 644 lessecho.c lesskey.c version.c LICENSE
%build
rm -f ./configure
autoreconf -fiv
%configure
make %{?_smp_mflags} CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
%configure --with-regex=pcre
make CC="gcc $RPM_OPT_FLAGS -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" datadir=%{_docdir}
%install
%make_install
rm -rf $RPM_BUILD_ROOT
%makeinstall
strip -R .comment $RPM_BUILD_ROOT/%{_bindir}/less
mkdir -p $RPM_BUILD_ROOT/etc/profile.d
install -p %{SOURCE1} $RPM_BUILD_ROOT/%{_bindir}
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d
install -p -c -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_bindir}
install -p -c -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d
install -p -c -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d
ls -la $RPM_BUILD_ROOT/etc/profile.d
%files
%doc README NEWS INSTALL
%license LICENSE COPYING
%defattr(-,root,root,-)
%doc LICENSE
/etc/profile.d/*
%{_bindir}/*
%{_mandir}/man1/*
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 551-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Apr 13 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-10
- Don't convert files with UTF-16/UTF-32 string in filename
Resolve: #638312
* Wed Jul 17 2019 Matej Mužila <mmuzila@redhat.com> - 551-1
- Update to new upstream release
- Resolves: #1719419
* Tue Jun 04 2019 Matej Mužila <mmuzila@redhat.com> - 550-1
- Update to new upstream release
- Resolves: #1674080
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 530-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 09 2019 Pavel Raiskup <praiskup@redhat.com> - 530-3
- add lzip compression support into lesspipe.sh (rhbz#1664383)
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 530-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sat Feb 17 2018 Pavel Raiskup <praiskup@redhat.com> - 530-1
- new release, per upstream release notes:
http://greenwoodsoftware.com/less/news.530.html
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 487-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 487-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 487-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue May 16 2017 Pavel Raiskup <praiskup@redhat.com> - 487-3
- read correctly text files named accidentally '*.rpm' (rhbz#1449790)
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 487-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Oct 28 2016 Jozef Mlich <imlich@fit.vutbr.cz> - 487-1
- Resolves: rhbz#1389577
Update to new upstream release
* Tue Oct 11 2016 Ville Skyttä <ville.skytta@iki.fi> - 481-6
- Prefer gpg2 over gpg for *.gpg (rhbz#1383284)
* Mon Apr 25 2016 Pavel Raiskup <praiskup@redhat.com> - 481-5
- again use the correct '||' syntax in LESSOPEN variable (rhbz#1254837)
* Wed Apr 20 2016 Pavel Raiskup <praiskup@redhat.com> - 481-4
- don't strictly require man-db or groff-base (rhbz#1278857)
* Tue Mar 29 2016 Pavel Raiskup <praiskup@redhat.com> - 481-3
- avoid one ubiquitous stat() call in less.sh and less.csh if possible
(rhbz#1321591)
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 481-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Oct 2 2015 Viktor Jancik <vjancik@redhat.com> - 481-1
- Update to version 481, fixes #1231493
* Wed Sep 2 2015 Viktor Jancik <vjancik@redhat.com> - 479-3
- Added missing double quotes in profile.d scripts
- Corrected license information
* Mon Aug 24 2015 Viktor Jancik <vjancik@redhat.com> - 479-2
- Updated spec file to comply with current Fedora Packaging Guidelines
Added missing documentation files
- Fixed less profile.d scripts
- Fixed preprocessing of man pages with special characters (#1241543)
* Tue Jul 07 2015 Fedora Release Monitoring <release-monitoring@fedoraproject.org> - 479-1
- Update to 479 (#1240456)
* Wed Jun 24 2015 Jozef Mlich <jmlich@redhat.com> - 478-1
- update to 478
http://greenwoodsoftware.com/less/news.478.html
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 471-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Jun 01 2015 Jozef Mlich <jmlich@redhat.com> - 471-4
- update of previous patch
* Mon Jun 01 2015 Jozef Mlich <jmlich@redhat.com> - 471-3
- out of bounds read access in is_utf8_well_formed()
Resolves: #1201310
CVE-2014-9488
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 471-2
- Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
* Wed Dec 17 2014 Jozef Mlich <jmlich@redhat.com> - 471-1
- Update to 471
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 458-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sat Jul 12 2014 Tom Callaway <spot@fedoraproject.org> - 458-12
- fix license handling
* Mon Jun 23 2014 Jozef Mlich <jmlich@redhat.com> - 458-11
- rollback of previous problem. See explanation of upstream.
http://greenwoodsoftware.com/less/faq.html#profileout
- fixing exit status values (the $? should be used as soon
as possible)
* Thu Jun 19 2014 Jozef Mlich <jmlich@redhat.com> - 458-10
- (lesspipe) better handling of exit status
fixing regression of #186931 - turns over the lesspipe exit behavior
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 458-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu May 22 2014 Jozef Mlich <jmlich@redhat.com> - 458-8
- (lesspipe) the groff was used just in case of gzipped man pages
- (lesspipe) the exit $? should be used directly after command;
otherwise may return unexpected value.
- (lesspipe) not preprocessed output was returning 1
* Mon Mar 31 2014 Jozef Mlich <jmlich@redhat.com> - 458-7
- FIXES outdated ubin_table in charset.c;
Kudos to Akira TAGOH
Resolves: #1074489
* Mon Feb 10 2014 Jozef Mlich <jmlich@redhat.com> - 458-6
- The data in less-458-old-bot-in-help.patch was not
preprocessed by mkhelp (i.e. not applied)
* Mon Dec 02 2013 Jozef Mlich <jmlich@redhat.com> - 458-5
- Resolves #1036326 fixing command line parsing in lesskey
- changed day of week in order to avoid bogus date in changelog
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 458-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Tue May 07 2013 Fridolin Pokorny <fpokorny@redhat.com> - 458-3
- Expanded lessecho usage (#948597)
- Added lessfilter info to man (#948597)
- Expanded lesskey usage (#948597)
- Added --old-bot to help (#948597)
* Thu Apr 11 2013 Fridolin Pokorny <fpokorny@redhat.com> - 458-2
- Added gpg support to lesspipe.sh (#885122)
- Added ~/.lessfilter support (#885122)
* Thu Apr 11 2013 Fridolin Pokorny <fpokorny@redhat.com> - 458-1
- Update to 458
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 451-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Oct 25 2012 Martin Briza <mbriza@redhat.com> - 451-2
- Changed unnecessary groff dependency to groff-base (#868376)
* Tue Sep 11 2012 Martin Briza <mbriza@redhat.com> - 451-1
- Rebase to 451 (#835802)
- Removed the empty-lessopen-pipe patch as the issue is now fixed upstream.
* Mon May 14 2012 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 444-7
- Fix less.sh not to override user-defined LESSOPEN variable (#802757)
- Use POSIX regcomp instead of PCRE - revert 406-11, commit 4b961c7 (#643233)
- Merge Foption changes by Colin Guthrie to Foption.v2.patch (#805735)
* Fri Feb 10 2012 Petr Pisar <ppisar@redhat.com> - 444-6
- Rebuild against PCRE 8.30
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 444-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Thu Dec 08 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 444-4
- Avoid some unnecessary stat calls and commands in lesspipe.sh,
patch by Ville Skyttä (#741440)
- Use `groff' instead of `man -s' for rendering manpages to prevent
options incompatibility between man and man-db packages (#718498)
- Add groff to Requires
* Tue Aug 23 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 444-3
- Substitute %%makeinstall macro with make DESTDIR* install (#732557)
* Fri Aug 12 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 444-2
- Fix debuginfo source files permissions
- Remove strip after %%makeinstall to fix debuginfo package
* Thu Jul 14 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 444-1
- Rebase to 444 (#713406)
* Wed Apr 20 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 443-1
- Rebase to 443
- Foption patch made applicable against 443
- Manpage extra line patch removed; fixed upstream (#697451)
* Wed Apr 13 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-13
- Don't convert files with UTF-16/UTF-32 string in filename (#638312)
* Tue Feb 15 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-12
- Enable LESSOPEN exit statuses as default also in less.sh (#666084, #676057)
* Tue Feb 15 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-11
* Tue Feb 15 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-9
- Clean lesspipe.sh script
- Split case for compressed and plain troff files
- Add support for *.xz and *.lzma man pages (#676057)
- Add support for reading UTF-16 and UTF-32 files (#638312)
- Add support for *.xz and *.lzma man pages
Resolves: #676057
- Add support for reading UTF-16 and UTF-32 files
Resolves: #638312
- Don't require correct exit status from LESSOPEN scripts until
it gets accepted by upstream (preserve backward compatibility) (#666084, #676057)
it gets accepted by upstream (preserve backward compatibility)
Resolves: #666084, #676057
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 436-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Jan 03 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-8
- Fix regression in lesspipe.sh script (*.gz files etc.)
Resolves: #615303 (comment #9)
* Mon Jan 03 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-9
- Fix regression in lesspipe.sh script (*.gz files etc.) (#615303 comment #9)
* Wed Dec 22 2010 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-8
- The new "--old-bot" option is not documented in the man page (#510724)
* Thu Dec 23 2010 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-7
- Fix for valid empty LESSOPEN pipe output
Resolves: #579251, #615303
- The new "--old-bot" option is not documented in the man page
Resolves: #510724
- Fix descriptions of some options in online help
(#578289, patch by Jeff Bastian <jbastian@redhat.com> [IT603793])
* Tue Dec 21 2010 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 436-7
- Fix for valid empty LESSOPEN pipe output (#579251, #615303)
Resolves: #578289 (Jeff Bastian <jbastian@redhat.com>)[IT603793]
* Wed Jan 20 2010 Nikola Pajkovsky <npajkovs@redhat.com> - 436-6
- RFE: lesspipe.sh could use a support for *.xz file
@ -290,7 +104,7 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d
* Mon Jan 4 2010 Nikola Pajkovsky <npajkovs@redhat.com> - 436-5
- patched wrong manpage. Resolves: #537746.
* Sat Dec 12 2009 Nikola Pajkovsky <npajkovs@redhat.com> - 436-4
* Mon Dec 12 2009 Nikola Pajkovsky <npajkovs@redhat.com> - 436-4
- #546613 - RFE: add *.jar *.nbm to lesspipe.sh
* Wed Dec 9 2009 Nikola Pajkovsky <npajkovs@redhat.com> - 436-3
@ -299,7 +113,7 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 436-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Fri Jul 10 2009 Zdenek Prikryl <zprikryl@redhat.com> - 436-1
* Tue Jul 10 2009 Zdenek Prikryl <zprikryl@redhat.com> - 436-1
- Foption patch is more optimal now
- Update to 436
@ -380,7 +194,7 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 394-4.1
- rebuild
* Fri May 5 2006 Ivana Varekova <varekova@redhat.com> - 394-4
* Thu May 5 2006 Ivana Varekova <varekova@redhat.com> - 394-4
- fix problem with unassigned variable DECOMPRESSOR (#190619)
* Wed Feb 15 2006 Ivana Varekova <varekova@redhat.com> - 394-3
@ -580,7 +394,7 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d
- fix up lesspipe stuff (Bug #8750 and a couple of non-reported bugs)
(Karsten, did I mention I'll kill you when you return from SAP? ;) )
* Fri Jan 7 2000 Karsten Hopp <karsten@redhat.de>
* Sun Jan 07 2000 Karsten Hopp <karsten@redhat.de>
- added lesspipe.sh to show listings of package
contents instead of binary output.

View File

@ -22,101 +22,55 @@ 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].bz2|*.[1-9]x.bz2|*.man.bz2|*.[1-9n].[gx]z|*.[1-9]x.[gx]z|*.man.[gx]z|*.[1-9n].lzma|*.[1-9]x.lzma|*.man.lzma)
case "$1" in
*.gz) DECOMPRESSOR="gzip -dc" ;;
*.bz2) DECOMPRESSOR="bzip2 -dc" ;;
*.lz) DECOMPRESSOR="lzip -dc" ;;
*.xz|*.lzma) DECOMPRESSOR="xz -dc" ;;
esac
if [ -n "$DECOMPRESSOR" ] && $DECOMPRESSOR -- "$1" | file - | grep -q troff; then
$DECOMPRESSOR -- "$1" | manfilter -
$DECOMPRESSOR -- "$1" | man -l - | cat -s
exit $?
fi ;;&
*.[1-9n]|*.[1-9]x|*.man)
if file "$1" | grep -q troff; then
manfilter "$1"
man -l "$1" | cat -s
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.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 ;;
*.tar) tar tvvf "$1" ;;
*.tgz|*.tar.gz|*.tar.[zZ]) tar tzvvf "$1" ;;
*.tar.xz) tar Jtvvf "$1" ;;
*.xz|*.lzma) xz -dc -- "$1" ;;
*.tar.bz2|*.tbz2) bzip2 -dc -- "$1" | tar tvvf - ;;
*.[zZ]|*.gz) gzip -dc -- "$1" ;;
*.bz2) bzip2 -dc -- "$1" ;;
*.zip|*.jar|*.nbm) zipinfo -- "$1" ;;
*.rpm) rpm -qpivl --changelog -- "$1" ;;
*.cpi|*.cpio) cpio -itv < "$1" ;;
*.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
if [ -x /usr/bin/file -a -x /usr/bin/iconv -a -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
env=`echo $LANG | cut -d. -f2`
if [ -n "$conv" -a -n "$env" -a "$conv" != "$env" ]; then
iconv -f $conv -t $env "$1"
exit $?
fi
fi
exit 1
esac
exit $?

View File

@ -1 +1 @@
SHA512 (less-551.tar.gz) = ef5296b9ebd72f83c05cad8a0f7a5eec2290e9b358ee725e09e8541bd95f94c0e14ea22aa04b287a0654079338eaeae813f2235b8e9f819fbbc9040dd65a9585
817bf051953ad2dea825a1cdf460caa4 less-436.tar.gz