Compare commits

..

57 Commits
f18 ... master

Author SHA1 Message Date
Fedora Release Engineering
5bb61822f1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 12:36:51 +00:00
Matej Mužila
88a2d30d09 Add new source tarball (forgotten in previous commit) 2019-07-17 13:05:43 +02:00
Matej Mužila
fbf1954bf4 Update to new upstream release
Resolves: #1719419
2019-07-17 12:59:17 +02:00
Matej Mužila
4a46a54bc3 Update to new upstream release
Resolves: #1674080
2019-06-04 15:22:03 +02:00
Fedora Release Engineering
dfb1edb94c - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 06:30:04 +00:00
Igor Gnatenko
115e05d7e4 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:11 +01:00
Pavel Raiskup
02d1df97a0 add lzip compression support into lesspipe.sh script
Thanks for the patch to Andrew Schorr.

Version: 530-3
2019-01-09 09:57:26 +01:00
Fedora Release Engineering
92933f680d - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 07:41:28 +00:00
Pavel Raiskup
42417cf532 new upstream stable release
Version: 530-1
2018-02-17 06:21:12 +01:00
Pavel Raiskup
3a269d779c rebase: new (at this time only beta) upstream release
Version: 529-1
2018-02-17 06:16:38 +01:00
Pavel Raiskup
24940f06e5 rebase: new (at this time only beta) upstream release
Version: 527-1
2018-02-17 06:15:53 +01:00
Pavel Raiskup
584367a469 rebase: beta test release
Version: 520-1
2018-02-17 06:14:14 +01:00
Fedora Release Engineering
1d41c18e55 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 21:00:59 +00:00
Fedora Release Engineering
b1a2bf9089 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 01:04:10 +00:00
Fedora Release Engineering
f90e9de914 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 18:23:24 +00:00
Pavel Raiskup
f32e1da3d7 lesspipe.sh: read *.rpm text files
Resolves: rhbz#1449790
Version: 487-3
2017-05-16 16:44:03 +02:00
Fedora Release Engineering
8ba41a80f5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-10 18:15:05 +00:00
Jozef Mlich
9f27a92b2f rebase to less 487
Resolves: #1389577
2016-10-28 08:27:05 +02:00
Ville Skyttä
6502b093ba Prefer gpg2 over gpg for *.gpg
Resolves: rhbz#1383284
Version: 481-6
2016-10-11 12:04:13 +02:00
Pavel Raiskup
8e7f15f2e1 LESSOPEN: use '||' syntax again
Related: rhbz#1254837
Version: 481-5
2016-04-25 06:53:44 +02:00
Pavel Raiskup
6dde17a846 requires: don't require man-db
Resolves: rhbz#1278857
Version: 481-4
2016-04-20 09:59:55 +02:00
Pavel Raiskup
32b553bce3 less.csh: avoid unnecessary stat() call
Resolves: #1321591
Version: 481-3
2016-03-29 15:38:13 +02:00
Ville Skyttä
11bfc57bdf less.sh: Avoid unnecessary stat call
While at it, remove unnecessary executable bits (in git) and shebang
from less.*sh.
2016-03-29 08:37:07 +02:00
Dennis Gilmore
3628f016fe - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-04 02:46:08 +00:00
Viktor Jancik
81a5028f51 Update to 481, fixes (#1231493) 2015-10-02 12:57:18 +02:00
Viktor Jancik
00941dc566 Fixed licensing and missing double quotes in profile.d scripts #1257516 #1258808 #1259030 2015-09-02 13:44:57 +02:00
Viktor Jancik
09eadae3be Fixed man page text highlighting 2015-08-22 17:37:14 +02:00
Viktor Jancik
6d7e9d2370 Fixed displaying of nonascii characters #1241543 2015-08-22 02:52:22 +02:00
Viktor Jancik
b539f87ad6 Modification to previous profile.d script changes 2015-08-22 00:45:30 +02:00
Viktor Jancik
3f003aa67c Fixed profile.d less init scripts 2015-08-21 22:16:14 +02:00
Viktor Jancik
396e286dd3 Updated spec file 2015-08-03 15:44:43 +02:00
Jozef Mlich
9820dc236c Update to 479 (#1240456) 2015-07-08 08:40:33 +02:00
Jozef Mlich
9c78a12749 update to 478
http://greenwoodsoftware.com/less/news.478.html
2015-06-24 10:26:21 +02:00
Dennis Gilmore
a24f11f952 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-17 14:04:23 +00:00
Jozef Mlich
48f39f63a0 out of bounds read access in is_utf8_well_formed()
Resolves: #1201310
CVE-2014-9488

This is an update of previous patch.

The function is_utf8_well_formed was defined in charset.c with single parameter. I was surprised, that it is even compiling.

This new patch is updating own implementation of function is_utf8_well_formed and fixing also its other use. The code is taken from Mark Nudelman's unreleased version of less.
2015-06-01 09:13:01 +02:00
Jozef Mlich
a879a7d3f4 out of bounds read access in is_utf8_well_formed()
Resolves: #1201310
CVE-2014-9488
2015-06-01 08:08:35 +02:00
Till Maas
2044640c90 Rebuilt for Fedora 23 Change
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
2015-02-21 22:29:44 +01:00
Jozef Mlich
4dff135eed Update to 471 2014-12-17 17:43:11 +01:00
Peter Robinson
e581d3f3f5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-17 01:49:27 +00:00
Tom Callaway
6a65c154fa fix license handling 2014-07-12 18:51:50 -04:00
Jozef Mlich
db9a82f2cb rollback of previous regression/not a bug; early handling of 0 2014-06-23 16:32:33 +02:00
Jozef Mlich
632b88cf21 - (lesspipe) better handling of exit status
fixing regression of #186931 - turns over the lesspipe exit behavior
2014-06-19 14:09:08 +02:00
Dennis Gilmore
e15ca03bd8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-06 21:15:44 -05:00
Jozef Mlich
532ba4528e - (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
2014-05-22 16:53:02 +02:00
Jozef Mlich
a1689649cb FIXES outdated ubin_table in charset.c;
Kudos to Akira TAGOH
Resolves: #1074489
2014-03-31 09:57:35 +02:00
Jozef Mlich
c75bddd4a1 The data in less-458-old-bot-in-help.patch was not
preprocessed by mkhelp (i.e. not applied)

The --old-bot option was missing in help.
2014-02-10 09:54:22 +01:00
Jozef Mlich
fefa9bc7e4 Resolves #1036326 fixing command line parsing in lesskey 2013-12-02 15:12:42 +01:00
Dennis Gilmore
925187a252 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild 2013-08-02 23:29:56 -05:00
Fridolin Pokorny
2b1d93d7cd Added --old-bot to help (#948597) 2013-05-07 14:46:25 +02:00
Fridolin Pokorny
72dfd3f635 Expanded lesskey usage (#948597) 2013-05-07 14:44:46 +02:00
Fridolin Pokorny
3f5d948810 Added lessfilter info to man (#948597) 2013-05-07 14:43:29 +02:00
Fridolin Pokorny
ba0e442ee9 Expanded lessecho usage (#948597) 2013-05-07 14:41:56 +02:00
Fridolin Pokorny
de1ff32b5a Added gpg support to lesspipe.sh (#885122)
- Added ~/.lessfilter support (#885122)
2013-04-11 15:53:08 +02:00
Fridolin Pokorny
4a15a797fc Update to 458 2013-04-11 14:36:54 +02:00
Dennis Gilmore
1536f4583b - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild 2013-02-13 21:51:25 -06:00
Martin Briza
633949cc39 Changed unnecessary groff dependency to groff-base (#868376) 2012-10-25 17:42:43 +02:00
Martin Briza
e1aee64c27 Rebase to 451 2012-09-11 15:15:06 +02:00
14 changed files with 370 additions and 319 deletions

6
.gitignore vendored
View File

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

View File

@ -1,32 +0,0 @@
--- less-394/line.c.search 2005-12-03 21:20:32.000000000 +0100
+++ less-394/line.c 2006-02-15 11:23:25.308694376 +0100
@@ -1125,6 +1125,14 @@
break;
}
}
+ if (c == '\0')
+ {
+ /*
+ * Pretend the line ended here
+ */
+ new_pos = ch_tell();
+ break;
+ }
linebuf[n++] = c;
c = ch_forw_get();
}
@@ -1198,6 +1206,14 @@
*to = *fm;
n = size_linebuf - old_size_linebuf;
}
+ if (c == '\0')
+ {
+ /*
+ * Pretend the line ended here
+ */
+ new_pos = ch_tell() + 1;
+ break;
+ }
linebuf[--n] = c;
}
if (linep != NULL)

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])
+AC_CHECK_FUNCS([popen _setjmp sigprocmask sigsetmask snprintf stat system fchmod])
-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 may not work for inline functions, so test these separately.
AC_MSG_CHECKING(for memcpy)

View File

@ -1,87 +0,0 @@
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

@ -1,139 +0,0 @@
From 21d56469fd4b4558d640ad82c78f2b9748341c11 Mon Sep 17 00:00:00 2001
From: "Vojtech Vitek (V-Teq)" <vvitek@redhat.com>
Date: Mon, 14 May 2012 17:31:20 +0200
Subject: [PATCH] Fix -F option behavior
Original patch written by Jindrich Novy <jnovy@redhat.com>.
Changes and improvements by Zdenek Prikryl <zprikryl@redhat.com>,
Vojtech Vitek <vvitek@redhat.com> and Colin Guthrie <colin@mageia.org>.
---
forwback.c | 20 ++++++++++++++++++++
funcs.h | 1 +
main.c | 16 ++++++++++++++++
screen.c | 9 +++++++--
4 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/forwback.c b/forwback.c
index ebe422d..687355f 100644
--- a/forwback.c
+++ b/forwback.c
@@ -422,3 +422,23 @@ get_back_scroll()
return (sc_height - 2);
return (10000); /* infinity */
}
+
+/*
+ * Get line count of file up to the screen height + 1 char
+ */
+ public int
+get_line_count()
+{
+ int nlines = 0;
+ POSITION pos;
+
+ pos = ch_zero();
+
+ while (pos != NULL_POSITION && nlines <= sc_height)
+ {
+ pos = forw_line(pos);
+ nlines++;
+ }
+
+ return nlines;
+}
diff --git a/funcs.h b/funcs.h
index 6595232..8ca4656 100644
--- a/funcs.h
+++ b/funcs.h
@@ -136,6 +136,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 ();
diff --git a/main.c b/main.c
index 0af1762..ef69440 100644
--- a/main.c
+++ b/main.c
@@ -55,6 +55,7 @@ static char consoleTitle[256];
#endif
extern int less_is_more;
+public int line_count;
extern int missing_cap;
extern int know_dumb;
extern int quit_if_one_screen;
@@ -277,10 +278,25 @@ main(argc, argv)
{
if (edit_stdin()) /* Edit standard input */
quit(QUIT_ERROR);
+ if (quit_if_one_screen)
+ line_count = get_line_count();
} else
{
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 (quit_if_one_screen)
+ {
+ if (nifile() == 1)
+ line_count = get_line_count();
+ else /* In case more than one file, -F can not be used */
+ quit_if_one_screen = FALSE;
+ }
}
init();
diff --git a/screen.c b/screen.c
index b8bc666..1883e3e 100644
--- a/screen.c
+++ b/screen.c
@@ -204,6 +204,7 @@ public int missing_cap = 0; /* Some capability is missing */
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);
@@ -1574,8 +1578,9 @@ deinit()
#if !MSDOS_COMPILER
if (!no_keypad)
tputs(sc_e_keypad, sc_height, putchr);
- if (!no_init)
+ if (!no_init && !quit_if_one_screen)
tputs(sc_deinit, sc_height, putchr);
+
#else
/* Restore system colors. */
SETCOLORS(sy_fg_color, sy_bg_color);
--
1.7.7.6

View File

@ -0,0 +1,22 @@
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

@ -0,0 +1,33 @@
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

@ -0,0 +1,20 @@
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

@ -0,0 +1,24 @@
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 Executable file → Normal file
View File

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

8
less.sh Executable file → Normal file
View File

@ -1,2 +1,8 @@
# less initialization script (sh)
[ -x /usr/bin/lesspipe.sh ] && export LESSOPEN="${LESSOPEN-||/usr/bin/lesspipe.sh %s}"
# 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

223
less.spec
View File

@ -1,22 +1,21 @@
Summary: A text file browser similar to more, but better
Name: less
Version: 444
Release: 9%{?dist}
License: GPLv3+
Group: Applications/Text
Version: 551
Release: 2%{?dist}
License: GPLv3+ or BSD
Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz
Source1: lesspipe.sh
Source2: less.sh
Source3: less.csh
Patch1: less-444-Foption.v2.patch
Patch2: less-394-search.patch
Patch4: less-394-time.patch
Patch5: less-418-fsync.patch
Patch6: less-436-manpage-add-old-bot-option.patch
Patch8: less-436-help.patch
Patch9: less-436-empty-lessopen-pipe.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
URL: http://www.greenwoodsoftware.com/less/
Requires: groff-base
BuildRequires: ncurses-devel
BuildRequires: autoconf automake libtool
@ -25,54 +24,204 @@ The less utility is a text file browser that resembles more, but has
more capabilities. Less allows you to move backwards in the file as
well as forwards. Since less doesn't have to read the entire input file
before it starts, less starts up more quickly than text editors (for
example, vi).
example, vi).
You should install less because it is a basic utility for viewing text
files, and you'll use it frequently.
%prep
%setup -q
%patch1 -p1 -b .Foption
%patch2 -p1 -b .search
%patch4 -p1 -b .time
%patch5 -p1 -b .fsync
%patch6 -p1 -b .manpage-add-old-bot-option
%patch8 -p1 -b .help
%patch9 -p1 -b .empty-lessopen-pipe
autoreconf
%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
chmod -R a+w *
chmod 644 *.c *.h LICENSE README
%build
rm -f ./configure
autoreconf -fiv
%configure
make CC="gcc $RPM_OPT_FLAGS -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" datadir=%{_docdir}
make %{?_smp_mflags} CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%make_install
mkdir -p $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
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
%files
%defattr(-,root,root,-)
%doc LICENSE
%doc README NEWS INSTALL
%license LICENSE COPYING
/etc/profile.d/*
%{_bindir}/*
%{_mandir}/man1/*
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Thu Oct 25 2012 Martin Briza <mbriza@redhat.com> - 444-9
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 551-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* 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)
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 444-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* 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)
@ -92,7 +241,7 @@ rm -rf $RPM_BUILD_ROOT
options incompatibility between man and man-db packages (#718498)
- Add groff to Requires
* Mon Aug 23 2011 Vojtech Vitek (V-Teq) <vvitek@redhat.com> - 444-3
* 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
@ -141,7 +290,7 @@ rm -rf $RPM_BUILD_ROOT
* Mon Jan 4 2010 Nikola Pajkovsky <npajkovs@redhat.com> - 436-5
- patched wrong manpage. Resolves: #537746.
* Mon Dec 12 2009 Nikola Pajkovsky <npajkovs@redhat.com> - 436-4
* Sat 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
@ -150,7 +299,7 @@ rm -rf $RPM_BUILD_ROOT
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 436-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Tue Jul 10 2009 Zdenek Prikryl <zprikryl@redhat.com> - 436-1
* Fri Jul 10 2009 Zdenek Prikryl <zprikryl@redhat.com> - 436-1
- Foption patch is more optimal now
- Update to 436
@ -231,7 +380,7 @@ rm -rf $RPM_BUILD_ROOT
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 394-4.1
- rebuild
* Thu May 5 2006 Ivana Varekova <varekova@redhat.com> - 394-4
* Fri 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
@ -431,7 +580,7 @@ rm -rf $RPM_BUILD_ROOT
- 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? ;) )
* Sun Jan 07 2000 Karsten Hopp <karsten@redhat.de>
* Fri Jan 7 2000 Karsten Hopp <karsten@redhat.de>
- added lesspipe.sh to show listings of package
contents instead of binary output.

View File

@ -22,37 +22,83 @@ 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].[gx]z|*.[1-9]x.[gx]z|*.man.[gx]z|*.[1-9n].lzma|*.[1-9]x.lzma|*.man.lzma)
*.[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)
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" | groff -Tascii -mandoc -
$DECOMPRESSOR -- "$1" | manfilter -
exit $?
fi ;;&
*.[1-9n]|*.[1-9]x|*.man)
if file "$1" | grep -q troff; then
man -l "$1" | cat -s
manfilter "$1"
exit $?
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" ;;
*.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 ;;
*.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"
@ -74,5 +120,3 @@ case "$1" in
fi
exit 1
esac
exit $?

View File

@ -1 +1 @@
56f9f76ffe13f70155f47f6b3c87d421 less-444.tar.gz
SHA512 (less-551.tar.gz) = ef5296b9ebd72f83c05cad8a0f7a5eec2290e9b358ee725e09e8541bd95f94c0e14ea22aa04b287a0654079338eaeae813f2235b8e9f819fbbc9040dd65a9585