From 6fbf673663d627cb26ae747ccc9697e33eae2854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Thu, 26 Jan 2023 10:41:36 +0100 Subject: [PATCH] Update pinfo to 0.6.13 --- .gitignore | 1 + pinfo-0.6.10-gcc10.patch | 12 ---- pinfo-0.6.13-fnocommon.patch | 22 +++++++ pinfo-0.6.13-gccwarn.patch | 63 +++++++++++++++++++ ...ogroup.patch => pinfo-0.6.13-nogroup.patch | 2 +- pinfo-0.6.13-stringop-overflow.patch | 40 ++++++++++++ pinfo-0.6.9-as-needed.patch | 22 ------- pinfo-0.6.9-infosuff.patch | 30 --------- pinfo-0.6.9-mansection.patch | 39 ------------ pinfo.spec | 46 ++++++++------ sources | 2 +- 11 files changed, 156 insertions(+), 123 deletions(-) delete mode 100644 pinfo-0.6.10-gcc10.patch create mode 100644 pinfo-0.6.13-fnocommon.patch create mode 100644 pinfo-0.6.13-gccwarn.patch rename pinfo-0.6.9-nogroup.patch => pinfo-0.6.13-nogroup.patch (95%) create mode 100644 pinfo-0.6.13-stringop-overflow.patch delete mode 100644 pinfo-0.6.9-as-needed.patch delete mode 100644 pinfo-0.6.9-infosuff.patch delete mode 100644 pinfo-0.6.9-mansection.patch diff --git a/.gitignore b/.gitignore index 748b3d8..ec7228c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ pinfo-0.6.10.tar.bz2 +/v0.6.13.tar.gz diff --git a/pinfo-0.6.10-gcc10.patch b/pinfo-0.6.10-gcc10.patch deleted file mode 100644 index 5973ad8..0000000 --- a/pinfo-0.6.10-gcc10.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up pinfo-0.6.10/src/parse_config.h.me pinfo-0.6.10/src/parse_config.h ---- pinfo-0.6.10/src/parse_config.h.me 2020-02-24 16:01:08.119884715 +0100 -+++ pinfo-0.6.10/src/parse_config.h 2020-02-24 16:01:19.396990442 +0100 -@@ -85,7 +85,7 @@ typedef struct colours - colours; - #endif /* NO_COLOR_CURSES */ - --int use_manual; -+extern int use_manual; - - int parse_config (void); - int parse_line (char *line); diff --git a/pinfo-0.6.13-fnocommon.patch b/pinfo-0.6.13-fnocommon.patch new file mode 100644 index 0000000..38d2b02 --- /dev/null +++ b/pinfo-0.6.13-fnocommon.patch @@ -0,0 +1,22 @@ +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 /* HAVE_CURSES_COLOR */ + +-int use_manual; ++extern int use_manual; + + int parse_config (void); + int parse_line (char *line); 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.9-nogroup.patch b/pinfo-0.6.13-nogroup.patch similarity index 95% rename from pinfo-0.6.9-nogroup.patch rename to pinfo-0.6.13-nogroup.patch index b8f351b..1c72ff2 100644 --- a/pinfo-0.6.9-nogroup.patch +++ b/pinfo-0.6.13-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-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.9-as-needed.patch b/pinfo-0.6.9-as-needed.patch deleted file mode 100644 index 85a80e6..0000000 --- a/pinfo-0.6.9-as-needed.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/macros/curses.m4 -+++ b/macros/curses.m4 -@@ -257,8 +257,8 @@ - dnl save CFLAGS and LDFLAGS and set new ones - CFLAGS_OLD=$CFLAGS - CFLAGS="$CFLAGS $curses_includes" -- LDFLAGS_OLD=$LDFLAGS -- LDFLAGS="$LDFLAGS $curses_libs" -+ LIBS_OLD=$LIBS -+ LIBS="$LIBS $curses_libs" - - dnl do the compile test - AC_MSG_CHECKING([if curses is usable]) -@@ -288,7 +288,7 @@ - - dnl restore variables - CFLAGS=$CFLAGS_OLD -- LDFLAGS=$LDFLAGS_OLD -+ LIBS=$LIBS_OLD - - ]) - 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.spec b/pinfo.spec index f60d734..35dadc6 100644 --- a/pinfo.spec +++ b/pinfo.spec @@ -1,22 +1,28 @@ Summary: An info file viewer Name: pinfo -Version: 0.6.10 -Release: 31%{?dist} +Version: 0.6.13 +Release: 1%{?dist} License: GPLv2 -URL: http://pinfo.alioth.debian.org -Source: http://alioth.debian.org/frs/download.php/3351/pinfo-0.6.10.tar.bz2 -Patch1: pinfo-0.6.9-xdg.patch -Patch2: pinfo-0.6.9-infosuff.patch -Patch3: pinfo-0.6.9-nogroup.patch -Patch4: pinfo-0.6.9-mansection.patch -Patch5: pinfo-0.6.9-infopath.patch -Patch6: pinfo-0.6.10-man.patch -Patch7: pinfo-0.6.9-as-needed.patch -Patch8: pinfo-0.6.10-gcc10.patch +URL: https://github.com/baszoetekouw/pinfo +Source: %{url}/archive/refs/tags/v%{version}.tar.gz + +Patch1: pinfo-0.6.9-infopath.patch +Patch2: pinfo-0.6.9-xdg.patch +Patch3: pinfo-0.6.10-man.patch +Patch4: pinfo-0.6.13-fnocommon.patch +Patch5: pinfo-0.6.13-gccwarn.patch +Patch6: pinfo-0.6.13-nogroup.patch +Patch7: pinfo-0.6.13-stringop-overflow.patch + +BuildRequires: automake +BuildRequires: gcc +BuildRequires: gettext-devel +BuildRequires: libtool BuildRequires: make BuildRequires: ncurses-devel -BuildRequires: automake gettext-devel libtool texinfo +BuildRequires: texinfo + Requires: xdg-utils %description @@ -35,8 +41,8 @@ using regular expressions, and is based on the ncurses library. %install %make_install # These symbolic links conflict with actual binaries in perl-pmtools (bz 437612) -# ln -sf pinfo $RPM_BUILD_ROOT%{_bindir}/pman -# ln -sf pinfo.1 $RPM_BUILD_ROOT%{_mandir}/man1/pman.1 +# ln -sf pinfo $RPM_BUILD_ROOT%%{_bindir}/pman +# ln -sf pinfo.1 $RPM_BUILD_ROOT%%{_mandir}/man1/pman.1 # This file should not be packaged rm -f $RPM_BUILD_ROOT%{_infodir}/dir @@ -44,15 +50,19 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %find_lang %{name} %files -f %{name}.lang -%doc AUTHORS COPYING ChangeLog* NEWS README TECHSTUFF +%license COPYING +%doc AUTHORS NEWS README.md TECHSTUFF %config(noreplace) %{_sysconfdir}/pinforc %{_bindir}/pinfo -# %{_bindir}/pman +# %%{_bindir}/pman %{_infodir}/pinfo.info* %{_mandir}/man1/pinfo.1* -# %{_mandir}/man1/pman.1* +# %%{_mandir}/man1/pman.1* %changelog +* Thu Jan 26 2023 Lukáš Zaoral - 0.6.13-1 +- Update to v0.6.13 + * Fri Jan 20 2023 Fedora Release Engineering - 0.6.10-31 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/sources b/sources index 2e0056b..aa29d63 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -fe3d3da50371b1773dfe29bf870dbc5b pinfo-0.6.10.tar.bz2 +SHA512 (v0.6.13.tar.gz) = 739e24821a363a087fb9df5651694f051286d4a15c3e51f2421a2aa60b1efe1da558b959ba22a0094e22854534ea5875498156e8ea2e198e31001aecab1a18df