diff --git a/bugfix-of-gcc-10.patch b/bugfix-of-gcc-10.patch index b573833..38d2b02 100644 --- a/bugfix-of-gcc-10.patch +++ b/bugfix-of-gcc-10.patch @@ -1,9 +1,19 @@ -diff -Nur pinfo-0.6.10/src/parse_config.h pinfo-0.6.10-new/src/parse_config.h ---- pinfo-0.6.10/src/parse_config.h 2006-03-10 03:44:48.000000000 +0800 -+++ pinfo-0.6.10-new/src/parse_config.h 2021-08-03 15:53:00.000000000 +0800 -@@ -85,7 +85,7 @@ +From 16dba5978146b6d3a540ac7c8f415eda49280847 Mon Sep 17 00:00:00 2001 +From: Bas Zoetekouw +Date: Thu, 23 Jul 2020 20:11:24 +0200 +Subject: [PATCH] fix use of global variabel + +--- + src/parse_config.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/parse_config.h b/src/parse_config.h +index 2dffa4f..4e68bb4 100644 +--- a/src/parse_config.h ++++ b/src/parse_config.h +@@ -85,7 +85,7 @@ typedef struct colours colours; - #endif /* NO_COLOR_CURSES */ + #endif /* HAVE_CURSES_COLOR */ -int use_manual; +extern int use_manual; diff --git a/pinfo-0.6.10.tar.bz2 b/pinfo-0.6.10.tar.bz2 deleted file mode 100644 index 1bc8e34..0000000 Binary files a/pinfo-0.6.10.tar.bz2 and /dev/null differ diff --git a/pinfo-0.6.13-gccwarn.patch b/pinfo-0.6.13-gccwarn.patch new file mode 100644 index 0000000..a50b8d5 --- /dev/null +++ b/pinfo-0.6.13-gccwarn.patch @@ -0,0 +1,63 @@ +From fc67ceacd81f0c74fcab85447c23a532ae482827 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Thu, 11 Nov 2021 18:59:57 +0000 +Subject: [PATCH 1/2] src/utils.c: suppres unused parameter warning + + utils.c:372:62: error: unused parameter 'completions' [-Werror=unused-parameter] + 372 | getstring_with_completion(char *prompt, const char * const * completions) + | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ +--- + src/utils.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/utils.c b/src/utils.c +index 2e4139c..34c9b88 100644 +--- a/src/utils.c ++++ b/src/utils.c +@@ -394,7 +394,7 @@ getstring_with_completion(char *prompt, const char * const * completions) + curs_set(0); + + #else +- ++ (void)completions; /* unused */ + move(maxy - 1, 0); + buf = readlinewrapper(prompt); + +-- +2.39.1 + +From ab604fdb67296dad27f3a25f3c9aabdd2fb8c3fa Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Thu, 11 Nov 2021 19:02:24 +0000 +Subject: [PATCH 2/2] src/video.c: use %ld to print longs + +ncurses-6.3 added printf()-stype attribute annotations for gcc-like +compilers that can now detect argument mismatches: + + video.c:114:26: error: format '%d' expects argument of type 'int', + but argument 3 has type 'long unsigned int' [-Werror=format=] + 114 | printw(_("Viewing line %d/%d, 100%%"), lines, lines); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +--- + src/video.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/video.c b/src/video.c +index f6b444a..195d781 100644 +--- a/src/video.c ++++ b/src/video.c +@@ -109,9 +109,9 @@ showscreen(char **message, unsigned long lines, unsigned long pos, long cursor, + mymvhline(maxy - 1, 0, ' ', maxx); + move(maxy - 1, 0); + if ((pos < lines - 1) &&(lines > pos + maxy - 2)) +- printw(_("Viewing line %d/%d, %d%%"), pos + maxy - 2, lines,((pos + maxy - 2) * 100) / lines); ++ printw(_("Viewing line %ld/%ld, %ld%%"), pos + maxy - 2, lines,((pos + maxy - 2) * 100) / lines); + else +- printw(_("Viewing line %d/%d, 100%%"), lines, lines); ++ printw(_("Viewing line %ld/%ld, 100%%"), lines, lines); + info_add_highlights(pos, cursor, lines, column, message); + attrset(normal); + move(0, 0); +-- +2.39.1 + diff --git a/pinfo-0.6.13-stringop-overflow.patch b/pinfo-0.6.13-stringop-overflow.patch new file mode 100644 index 0000000..a807b1c --- /dev/null +++ b/pinfo-0.6.13-stringop-overflow.patch @@ -0,0 +1,40 @@ +From 23c169877fda839f0634b2d193eaf26de290f141 Mon Sep 17 00:00:00 2001 +From: Bas Zoetekouw +Date: Thu, 23 Jul 2020 20:39:04 +0200 +Subject: [PATCH] workaround false positie in gcc-10 stringop-overflow checks + +--- + src/utils.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/src/utils.c b/src/utils.c +index cb2fe76..2e4139c 100644 +--- a/src/utils.c ++++ b/src/utils.c +@@ -848,10 +848,9 @@ char * + make_tempfile() + { + char *filename; +- size_t len; + + /* TODO: fix hardcoded /tmp */ +- char tmpfile_template[] = "/tmp/pinfo.XXXXXX"; ++ char tmpfile_template[32] = "/tmp/pinfo.XXXXXX"; + + /* create a tmpfile */ + int fd = mkstemp(tmpfile_template); +@@ -864,9 +863,8 @@ make_tempfile() + } + + /* allocate a new string and copy the filename there */ +- len = strlen(tmpfile_template)+1; +- filename = xmalloc(len+1); /* guarenteerd to be set to \0's */ +- strncpy(filename, tmpfile_template, len); ++ filename = xmalloc(33); /* guarenteerd to be set to \0's */ ++ strncpy(filename, tmpfile_template, 32); + + /* close the file */ + close(fd); +-- +2.39.1 + diff --git a/pinfo-0.6.13.tar.gz b/pinfo-0.6.13.tar.gz new file mode 100644 index 0000000..2207872 Binary files /dev/null and b/pinfo-0.6.13.tar.gz differ diff --git a/pinfo-0.6.9-infosuff.patch b/pinfo-0.6.9-infosuff.patch deleted file mode 100644 index 7ab326f..0000000 --- a/pinfo-0.6.9-infosuff.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- pinfo-0.6.9/src/filehandling_functions.c.infosuff 2006-03-16 16:15:02.000000000 +0100 -+++ pinfo-0.6.9/src/filehandling_functions.c 2006-09-18 14:32:32.000000000 +0200 -@@ -94,6 +94,7 @@ - /* iterate over all files in the directory */ - while ((dp = readdir(dir)) != NULL) - { -+ int info_suffix; - /* use strcat rather than strdup, because xmalloc handles all - * malloc errors */ - char *thisfile = xmalloc(strlen(dp->d_name)+1); -@@ -101,7 +102,9 @@ - - /* strip suffixes (so "gcc.info.gz" -> "gcc") */ - strip_compression_suffix(thisfile); -+ info_suffix = strlen(thisfile); - strip_info_suffix(thisfile); -+ info_suffix -= strlen(thisfile); - - /* compare this file with the file we're looking for */ - if (strcmp(thisfile,bname) == 0) -@@ -110,7 +113,8 @@ - matched++; - /* put it in the buffer */ - strncat(Buf, thisfile, 1023-strlen(Buf)); -- strncat(Buf, ".info", 1023-strlen(Buf)); -+ if (info_suffix) -+ strncat(Buf, ".info", 1023-strlen(Buf)); - - /* clean up, and exit the loop */ - xfree(thisfile); diff --git a/pinfo-0.6.9-mansection.patch b/pinfo-0.6.9-mansection.patch deleted file mode 100644 index e54cdb6..0000000 --- a/pinfo-0.6.9-mansection.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- pinfo-0.6.9/src/manual.c.mansection 2006-03-16 15:14:30.000000000 +0100 -+++ pinfo-0.6.9/src/manual.c 2007-02-23 14:52:30.000000000 +0100 -@@ -167,16 +167,29 @@ - } - i = len; - /* find the beginning of the last token */ -- for (i = len - 1;(i > 0) &&(!isspace(name1[i])); i--); -- -- /* if we've found space, then we move to the first nonspace character */ -- if (i > 0) -- i++; -+ for (i = len - 1;(i >= 0) &&(!isspace(name1[i])); i--) -+ ; -+ i++; - - /* filename->name */ -- strcpy(manualhistory[0].name, &name1[i]); -+ snprintf(manualhistory[0].name, 256, "%s", &name1[i]); -+ - /* section unknown */ -- strcpy(manualhistory[0].sect, ""); -+ manualhistory[0].sect[0] = 0; -+ -+ /* try to find section */ -+ if (i > 1) { -+ for (i--; (i >= 0) && isspace(name1[i]); i--) -+ ; -+ if (i >= 0) { -+ name1[i + 1] = 0; -+ for (; (i >= 0) && !isspace(name1[i]); i--) -+ ; -+ i++; -+ snprintf(manualhistory[0].sect, 32, "%s", &name1[i]); -+ } -+ } -+ - /* selected unknown */ - manualhistory[0].selected = -1; - /* pos=0 */ diff --git a/pinfo-0.6.9-nogroup.patch b/pinfo-0.6.9-nogroup.patch index b8f351b..1c72ff2 100644 --- a/pinfo-0.6.9-nogroup.patch +++ b/pinfo-0.6.9-nogroup.patch @@ -7,7 +7,7 @@ -char *safe_group = "nogroup"; +char *safe_group = "nobody"; - #ifndef HAVE_CURS_SET + #ifndef HAVE_DECL_CURS_SET void --- pinfo-0.6.9/src/pinforc.in.nogroup 2007-01-19 13:42:14.000000000 +0100 +++ pinfo-0.6.9/src/pinforc.in 2007-01-19 13:45:35.000000000 +0100 diff --git a/pinfo.spec b/pinfo.spec index 3d4c4bc..73073d2 100644 --- a/pinfo.spec +++ b/pinfo.spec @@ -1,14 +1,17 @@ Name: pinfo -Version: 0.6.10 -Release: 24 +Version: 0.6.13 +Release: 1 Summary: An user-friendly, console-based viewer for Info documents License: GPLv2 -URL: http://pinfo.alioth.debian.org -Source: http://ftp.corbina.net/pub/Linux/gentoo/distfiles/d9/pinfo-0.6.10.tar.bz2 +URL: https://github.com/baszoetekouw/pinfo +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Patch0001: pinfo-0.6.9-xdg.patch -Patch0002: pinfo-0.6.9-infosuff.patch +# https://github.com/baszoetekouw/pinfo/commit/fc67ceacd81f0c74fcab85447c23a532ae482827 +# https://github.com/baszoetekouw/pinfo/commit/ab604fdb67296dad27f3a25f3c9aabdd2fb8c3fa +Patch0002: pinfo-0.6.13-gccwarn.patch Patch0003: pinfo-0.6.9-nogroup.patch -Patch0004: pinfo-0.6.9-mansection.patch +# https://github.com/baszoetekouw/pinfo/commit/23c169877fda839f0634b2d193eaf26de290f141 +Patch0004: pinfo-0.6.13-stringop-overflow.patch Patch0005: pinfo-0.6.9-infopath.patch Patch0006: pinfo-0.6.10-man.patch Patch0007: bugfix-of-gcc-10.patch @@ -34,24 +37,30 @@ Pinfo-help provides man pages and other related help documents for pinfo. %build ./autogen.sh %configure --without-readline +%make_build %install %make_install +rm -f $RPM_BUILD_ROOT%{_infodir}/dir + %find_lang %{name} %files -f %{name}.lang -%doc AUTHORS COPYING +%license COPYING +%doc AUTHORS %{_bindir}/pinfo %{_infodir}/pinfo.info* %config(noreplace) %{_sysconfdir}/pinforc -%exclude %{_infodir}/dir %files help -%doc ChangeLog* NEWS README TECHSTUFF +%doc Changelog* NEWS README.md TECHSTUFF %{_mandir}/man1/pinfo.1* %changelog +* Sun Oct 08 2023 yaoxin - 0.6.13-1 +- Upgrade to 0.6.13 + * Tue Aug 3 2021 Shenmei Tu - 0.6.10-24 - bugfix-of-gcc-10.patch diff --git a/pinfo.yaml b/pinfo.yaml index 00bbaf0..8a6e51f 100644 --- a/pinfo.yaml +++ b/pinfo.yaml @@ -1,4 +1,4 @@ -version_control: NA -src_repo: NA -tag_prefix: NA -seperator: NA +version_control: github +src_repo: baszoetekouw/pinfo +tag_prefix: '^v' +seperator: '.'