From af16b403775c058b6cb1ed2f2ddc6e2d46681535 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Sep 26 2017 05:03:10 +0000 Subject: rebase: beta test release Version: 520-1 --- diff --git a/less-444-Foption.v2.patch b/less-444-Foption.v2.patch deleted file mode 100644 index d996a5c..0000000 --- a/less-444-Foption.v2.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 21d56469fd4b4558d640ad82c78f2b9748341c11 Mon Sep 17 00:00:00 2001 -From: "Vojtech Vitek (V-Teq)" -Date: Mon, 14 May 2012 17:31:20 +0200 -Subject: [PATCH] Fix -F option behavior - -Original patch written by Jindrich Novy . - -Changes and improvements by Zdenek Prikryl , -Vojtech Vitek and Colin Guthrie . -Jozef Mlich ---- -diff -up ./less-466/forwback.c.Foption ./less-466/forwback.c ---- ./less-466/forwback.c.Foption 2014-08-24 02:46:52.000000000 +0200 -+++ ./less-466/forwback.c 2014-09-18 13:54:28.804626580 +0200 -@@ -440,3 +440,24 @@ 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 -up ./less-466/funcs.h.Foption ./less-466/funcs.h ---- ./less-466/funcs.h.Foption 2014-08-24 02:46:54.000000000 +0200 -+++ ./less-466/funcs.h 2014-09-18 13:55:12.140010010 +0200 -@@ -139,6 +139,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 -up ./less-466/main.c.Foption ./less-466/main.c ---- ./less-466/main.c.Foption 2014-08-24 02:46:51.000000000 +0200 -+++ ./less-466/main.c 2014-09-18 14:03:12.868331522 +0200 -@@ -54,8 +54,10 @@ 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; - extern int pr_type; - - -@@ -273,10 +275,27 @@ 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 -up ./less-466/screen.c.Foption ./less-466/screen.c ---- ./less-466/screen.c.Foption 2014-08-24 02:46:51.000000000 +0200 -+++ ./less-466/screen.c 2014-09-18 13:58:52.772962165 +0200 -@@ -203,6 +203,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(); -@@ -232,6 +233,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; -@@ -1533,7 +1535,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,7 +1577,7 @@ 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. */ diff --git a/less.spec b/less.spec index 69d9005..893913f 100644 --- a/less.spec +++ b/less.spec @@ -1,14 +1,13 @@ Summary: A text file browser similar to more, but better Name: less -Version: 487 -Release: 5%{?dist} +Version: 520 +Release: 1%{?dist} License: GPLv3+ or BSD Group: Applications/Text 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 Patch4: less-394-time.patch Patch5: less-418-fsync.patch Patch6: less-436-manpage-add-old-bot-option.patch @@ -33,7 +32,6 @@ files, and you'll use it frequently. %prep %setup -q -%patch1 -p2 -b .Foption %patch4 -p1 -b .time %patch5 -p1 -b .fsync %patch6 -p1 -b .manpage-add-old-bot-option @@ -65,6 +63,9 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d %{_mandir}/man1/* %changelog +* Tue Sep 26 2017 Pavel Raiskup - 520-1 +- beta testing release + * Thu Aug 03 2017 Fedora Release Engineering - 487-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild