pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/archivers/par2



Module Name:    pkgsrc
Committed By:   gdt
Date:           Sun Aug 30 01:13:18 UTC 2026

Modified Files:
        pkgsrc/archivers/par2: Makefile distinfo
Added Files:
        pkgsrc/archivers/par2/patches: patch-src_par2repairer.cpp

Log Message:
archivers/par2: Work around gcc 10 bug

It seems that when an ostringstream is operated on with <<, the
resulting object is an ostream, not an ostringstream, and one can't
.str() that.  Simplify the code and use variables.

All tests pass on NetBSD 10 amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 pkgsrc/archivers/par2/Makefile
cvs rdiff -u -r1.30 -r1.31 pkgsrc/archivers/par2/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/archivers/par2/patches/patch-src_par2repairer.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/archivers/par2/Makefile
diff -u pkgsrc/archivers/par2/Makefile:1.39 pkgsrc/archivers/par2/Makefile:1.40
--- pkgsrc/archivers/par2/Makefile:1.39 Sat Aug 29 00:11:54 2026
+++ pkgsrc/archivers/par2/Makefile      Sun Aug 30 01:13:18 2026
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.39 2026/08/29 00:11:54 gdt Exp $
+# $NetBSD: Makefile,v 1.40 2026/08/30 01:13:18 gdt Exp $
 
 DISTNAME=      par2cmdline-1.3.0
 PKGNAME=       ${DISTNAME:S/cmdline//}
+PKGREVISION=   1
 CATEGORIES=    archivers misc
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=Parchive/}
 GITHUB_PROJECT=        par2cmdline

Index: pkgsrc/archivers/par2/distinfo
diff -u pkgsrc/archivers/par2/distinfo:1.30 pkgsrc/archivers/par2/distinfo:1.31
--- pkgsrc/archivers/par2/distinfo:1.30 Tue Aug 25 10:30:30 2026
+++ pkgsrc/archivers/par2/distinfo      Sun Aug 30 01:13:18 2026
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.30 2026/08/25 10:30:30 adam Exp $
+$NetBSD: distinfo,v 1.31 2026/08/30 01:13:18 gdt Exp $
 
 BLAKE2s (par2cmdline-1.3.0.tar.gz) = 3fff543aaf238e89fc97019951e0f5f64b054144f6bb165c256d5450df5145a4
 SHA512 (par2cmdline-1.3.0.tar.gz) = 297dedcd160f897772aec7bc2ca7466565f4cf16cc9e09c9a6eb788124fa114ec3f0a06befc3b58511eda959bee6f7db4c4e6f5d856b690f0caa9f0e4557570b
 Size (par2cmdline-1.3.0.tar.gz) = 3739505 bytes
+SHA1 (patch-src_par2repairer.cpp) = 8503314fc1914c5fb6ff115e8b64fd464c846627

Added files:

Index: pkgsrc/archivers/par2/patches/patch-src_par2repairer.cpp
diff -u /dev/null pkgsrc/archivers/par2/patches/patch-src_par2repairer.cpp:1.1
--- /dev/null   Sun Aug 30 01:13:18 2026
+++ pkgsrc/archivers/par2/patches/patch-src_par2repairer.cpp    Sun Aug 30 01:13:18 2026
@@ -0,0 +1,42 @@
+$NetBSD: patch-src_par2repairer.cpp,v 1.1 2026/08/30 01:13:18 gdt Exp $
+
+Apparently, gcc<=10, when using ostringstream, somehow turns the type
+into ostream after <<, and ostream has no str().
+
+Not yet filed upstream, because probably upstream does not regard gcc
+10 as reasonable, or they would have CI with it.
+
+--- src/par2repairer.cpp.orig  2026-08-30 01:03:00.454241587 +0000
++++ src/par2repairer.cpp
+@@ -1673,9 +1673,12 @@ bool Par2Repairer::ScanDataFile(DiskFile
+     {
+       if (lastmatchoffset < filechecksummer.Offset() && noiselevel > nlNormal)
+       {
+-        progress.PrintLine((std::ostringstream()
+-          << "No data found between offset " << lastmatchoffset
+-          << " and " << filechecksummer.Offset()).str());
++      // Avoid gcc <= 10 bug.
++      std::ostringstream oss = std::ostringstream();
++      oss << "No data found between offset " << lastmatchoffset
++          << " and " << filechecksummer.Offset();
++
++        progress.PrintLine(oss.str());
+       }
+ 
+       // Is this the first match
+@@ -1805,9 +1808,12 @@ bool Par2Repairer::ScanDataFile(DiskFile
+ 
+   if (lastmatchoffset < filechecksummer.Offset() && noiselevel > nlNormal)
+   {
+-    progress.PrintLine((std::ostringstream()
+-      << "No data found between offset " << lastmatchoffset
+-      << " and " << filechecksummer.Offset()).str());
++    // Avoid gcc <= 10 bug.
++    std::ostringstream oss = std::ostringstream();
++    oss << "No data found between offset " << lastmatchoffset
++      << " and " << filechecksummer.Offset();
++
++    progress.PrintLine(oss.str());
+   }
+ 
+   // Get the Full and 16k hash values of the file



Home | Main Index | Thread Index | Old Index