rebase: beta test release

Version: 520-1
This commit is contained in:
Pavel Raiskup 2017-09-26 07:03:10 +02:00
parent 1d41c18e55
commit 584367a469
2 changed files with 5 additions and 135 deletions

View File

@ -1,131 +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>.
Jozef Mlich <jmlich@redhat.com>
---
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. */

View File

@ -1,14 +1,13 @@
Summary: A text file browser similar to more, but better Summary: A text file browser similar to more, but better
Name: less Name: less
Version: 487 Version: 520
Release: 6%{?dist} Release: 1%{?dist}
License: GPLv3+ or BSD License: GPLv3+ or BSD
Group: Applications/Text Group: Applications/Text
Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz Source: http://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz
Source1: lesspipe.sh Source1: lesspipe.sh
Source2: less.sh Source2: less.sh
Source3: less.csh Source3: less.csh
Patch1: less-444-Foption.v2.patch
Patch4: less-394-time.patch Patch4: less-394-time.patch
Patch5: less-418-fsync.patch Patch5: less-418-fsync.patch
Patch6: less-436-manpage-add-old-bot-option.patch Patch6: less-436-manpage-add-old-bot-option.patch
@ -33,7 +32,6 @@ files, and you'll use it frequently.
%prep %prep
%setup -q %setup -q
%patch1 -p2 -b .Foption
%patch4 -p1 -b .time %patch4 -p1 -b .time
%patch5 -p1 -b .fsync %patch5 -p1 -b .fsync
%patch6 -p1 -b .manpage-add-old-bot-option %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/* %{_mandir}/man1/*
%changelog %changelog
* Sat Feb 17 2018 Pavel Raiskup <praiskup@redhat.com> - 520-1
- beta testing release
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 487-6 * Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 487-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild