On Thu, Dec 07, 2017 at 11:12:29PM +0100, Jeremie Courreges-Anglas wrote: > On Wed, Nov 29 2017, Mikolaj Kucharski <miko...@kucharski.name> wrote: > > Hi, > > > > Update to the latest release on GitHub. Ports changes: > > > > - drop patches included by upstream > > - adapt pledge(2) patches after files moved into src/ subdir > > - use GitHub variables > > - drop uneeded variables after previous > > > > The biggest change which I'm aware from user perspective is author > > inversed the behaviour of -N option in version 0.7.0. If you are > > using par2cmdline with that option, you should drop it after attached > > update. If you want to bring back behaviour of par2cmdline from before > > version 0.7.0, then you need to add -N to your scripts or apps. I > > personally was relaying on -N, so now I can remove it. > > > > Changes between versions by upstream can be seen at: > > > > https://github.com/Parchive/par2cmdline/releases > > > > I personally didn't had a chance to test this release properly yet, but > > posting if someone else is using par2cmdline too. > > > > Regress tests pass on amd64: > > > > # TOTAL: 28 > > # PASS: 28 > > # SKIP: 0 > > # XFAIL: 0 > > # FAIL: 0 > > # XPASS: 0 > > # ERROR: 0 > > This update looks good, just one question: why switch to > github-generated tarballs? Upstream still provides tarballs as usual.
It looks like a mistake. I don't remember why I did it. Thanks for catching this. Updated diff below, switching back to a release tarball. Index: Makefile =================================================================== RCS file: /cvs/ports/archivers/par2cmdline/Makefile,v retrieving revision 1.16 diff -u -p -u -r1.16 Makefile --- Makefile 26 Jul 2017 22:45:14 -0000 1.16 +++ Makefile 9 Dec 2017 16:40:01 -0000 @@ -2,10 +2,8 @@ COMMENT = command line implementation of the PAR v2.0 specification -V = 0.6.14 +V = 0.7.4 DISTNAME = par2cmdline-$V -DISTFILES = ${DISTNAME}{v$V}.tar.gz -REVISION = 2 CATEGORIES = archivers @@ -19,7 +17,7 @@ WANTLIB = c m ${COMPILER_LIBCXX} MAINTAINER = Mikolaj Kucharski <miko...@kucharski.name> -MASTER_SITES = ${HOMEPAGE}archive/ +MASTER_SITES = ${HOMEPAGE}releases/download/v$V/ BUILD_DEPENDS = ${MODGNU_AUTOCONF_DEPENDS} \ ${MODGNU_AUTOMAKE_DEPENDS} @@ -41,8 +39,5 @@ post-patch: post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/par2cmdline ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/par2cmdline - -pre-test: - sed -i -e 's,^tar -xf,tar -xzf,' ${WRKSRC}/tests/test* .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/archivers/par2cmdline/distinfo,v retrieving revision 1.6 diff -u -p -u -r1.6 distinfo --- distinfo 5 Oct 2015 16:50:14 -0000 1.6 +++ distinfo 9 Dec 2017 16:40:01 -0000 @@ -1,2 +1,2 @@ -SHA256 (par2cmdline-0.6.14.tar.gz) = L9gxupJNnw7NkkLKRVUbaZXt4e0oGveaow50kNVZbno= -SIZE (par2cmdline-0.6.14.tar.gz) = 3539262 +SHA256 (par2cmdline-0.7.4.tar.gz) = uPHju+cs0pgigzLmfTU3BsPaFsxFI8Yvb9BT9JxUsdA= +SIZE (par2cmdline-0.7.4.tar.gz) = 3617577 Index: patches/patch-configure_ac =================================================================== RCS file: /cvs/ports/archivers/par2cmdline/patches/patch-configure_ac,v retrieving revision 1.1 diff -u -p -u -r1.1 patch-configure_ac --- patches/patch-configure_ac 13 Jun 2016 17:32:27 -0000 1.1 +++ patches/patch-configure_ac 9 Dec 2017 16:40:01 -0000 @@ -1,7 +1,8 @@ $OpenBSD: patch-configure_ac,v 1.1 2016/06/13 17:32:27 semarie Exp $ ---- configure.ac.orig Wed Jun 8 23:30:46 2016 -+++ configure.ac Wed Jun 8 23:31:20 2016 -@@ -56,6 +56,7 @@ dnl Checks for library functions. +Index: configure.ac +--- configure.ac.orig ++++ configure.ac +@@ -60,6 +60,7 @@ dnl Checks for library functions. AC_FUNC_MEMCMP AC_CHECK_FUNCS([stricmp] [strcasecmp]) AC_CHECK_FUNCS([strchr] [memcpy]) Index: patches/patch-par1repairer_cpp =================================================================== RCS file: patches/patch-par1repairer_cpp diff -N patches/patch-par1repairer_cpp --- patches/patch-par1repairer_cpp 13 Jun 2016 17:32:27 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,25 +0,0 @@ -$OpenBSD: patch-par1repairer_cpp,v 1.3 2016/06/13 17:32:27 semarie Exp $ - -pledge: - 'par2 repair' with par1 files - stdio rpath cpath - once the target files have been opened for writing, wpath is no - longer required, cpath must be kept to delete partial files in - case of an error - ---- par1repairer.cpp.orig Wed Jun 8 23:41:11 2016 -+++ par1repairer.cpp Wed Jun 8 23:42:01 2016 -@@ -157,6 +157,14 @@ Result Par1Repairer::Process(const CommandLine &comman - if (!CreateTargetFiles()) - return eFileIOError; - -+#ifdef HAVE_PLEDGE -+ if (pledge("stdio rpath cpath", NULL) == -1) -+ { -+ cerr << "pledge failed" << endl; -+ return eLogicError; -+ } -+#endif -+ - // Work out which data blocks are available, which need to be recreated, - // and compute the appropriate Reed Solomon matrix. - if (!ComputeRSmatrix()) Index: patches/patch-par2cmdline_cpp =================================================================== RCS file: patches/patch-par2cmdline_cpp diff -N patches/patch-par2cmdline_cpp --- patches/patch-par2cmdline_cpp 13 Jun 2016 17:32:27 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,57 +0,0 @@ -$OpenBSD: patch-par2cmdline_cpp,v 1.1 2016/06/13 17:32:27 semarie Exp $ - -pledge: - 'par2 create' - stdio rpath wpath cpath - creates and writes par files - - 'par2 repair' - stdio rpath wpath cpath - renames and deletes partial/damaged files, writes repaired files - - 'par2 verify' - stdio rpath cpath - may delete par files, only if -p option was given, otherwise - cpath is not required - ---- par2cmdline.cpp.orig Wed Jun 8 23:31:42 2016 -+++ par2cmdline.cpp Wed Jun 8 23:38:36 2016 -@@ -34,6 +34,14 @@ int main(int argc, char *argv[]) - _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_ALLOC_MEM_DF | /*_CRTDBG_CHECK_CRT_DF | */_CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF); - #endif - -+#ifdef HAVE_PLEDGE -+ if (pledge("stdio rpath wpath cpath", NULL) == -1) -+ { -+ cerr << "pledge failed" << endl; -+ return eLogicError; -+ } -+#endif -+ - // Parse the command line - CommandLine *commandline = new CommandLine; - -@@ -55,6 +63,26 @@ int main(int argc, char *argv[]) - break; - case CommandLine::opVerify: - { -+#ifdef HAVE_PLEDGE -+ if (!commandline->GetPurgeFiles()) -+ { -+ if (pledge("stdio rpath", NULL) == -1) -+ { -+ cerr << "pledge failed" << endl; -+ result = eLogicError; -+ break; -+ } -+ } -+ else -+ { -+ if (pledge("stdio rpath cpath", NULL) == -1) -+ { -+ cerr << "pledge failed" << endl; -+ result = eLogicError; -+ break; -+ } -+ } -+#endif - // Verify damaged files - switch (commandline->GetVersion()) - { Index: patches/patch-par2cmdline_h =================================================================== RCS file: patches/patch-par2cmdline_h diff -N patches/patch-par2cmdline_h --- patches/patch-par2cmdline_h 5 Oct 2015 16:50:14 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,18 +0,0 @@ -$OpenBSD: patch-par2cmdline_h,v 1.3 2015/10/05 16:50:14 sthen Exp $ - -- https://github.com/Parchive/par2cmdline/issues/55 and - https://github.com/Parchive/par2cmdline/pull/60 - ---- par2cmdline.h.orig Sun Aug 2 17:09:46 2015 -+++ par2cmdline.h Sun Oct 4 18:32:15 2015 -@@ -156,9 +156,9 @@ typedef unsigned long long u64; - # ifndef __LITTLE_ENDIAN - # ifdef _LITTLE_ENDIAN - # define __LITTLE_ENDIAN _LITTLE_ENDIAN --# define __LITTLE_ENDIAN _LITTLE_ENDIAN - # define __BIG_ENDIAN _BIG_ENDIAN - # define __PDP_ENDIAN _PDP_ENDIAN -+# define __BYTE_ORDER _BYTE_ORDER - # else - # error <endian.h> does not define __LITTLE_ENDIAN etc. - # endif Index: patches/patch-par2repairer_cpp =================================================================== RCS file: patches/patch-par2repairer_cpp diff -N patches/patch-par2repairer_cpp --- patches/patch-par2repairer_cpp 13 Jun 2016 17:32:27 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,25 +0,0 @@ -$OpenBSD: patch-par2repairer_cpp,v 1.3 2016/06/13 17:32:27 semarie Exp $ - -pledge: - 'par2 repair' with par2 files - stdio rpath cpath - once the target files have been opened for writing, wpath is no - longer required, cpath must be kept to delete partial files in - case of an error - ---- par2repairer.cpp.orig Wed Jun 8 23:38:53 2016 -+++ par2repairer.cpp Wed Jun 8 23:41:00 2016 -@@ -193,6 +193,14 @@ Result Par2Repairer::Process(const CommandLine &comman - if (!CreateTargetFiles()) - return eFileIOError; - -+#ifdef HAVE_PLEDGE -+ if (pledge("stdio rpath cpath", NULL) == -1) -+ { -+ cerr << "pledge failed" << endl; -+ return eLogicError; -+ } -+#endif -+ - // Work out which data blocks are available, which need to be copied - // directly to the output, and which need to be recreated, and compute - // the appropriate Reed Solomon matrix. Index: patches/patch-reedsolomon_cpp =================================================================== RCS file: patches/patch-reedsolomon_cpp diff -N patches/patch-reedsolomon_cpp --- patches/patch-reedsolomon_cpp 5 Oct 2015 16:50:14 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,25 +0,0 @@ -$OpenBSD: patch-reedsolomon_cpp,v 1.2 2015/10/05 16:50:14 sthen Exp $ - -- c++: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] - https://github.com/Parchive/par2cmdline/pull/60 - ---- reedsolomon.cpp.orig Sun Aug 2 17:09:46 2015 -+++ reedsolomon.cpp Sun Oct 4 18:31:57 2015 -@@ -294,7 +294,7 @@ template<> bool ReedSolomon<Galois16>::InternalProcess - *pL = *LL + *HL; - #else - unsigned int temp = *LL + *HL; -- *pL = (temp >> 8) & 0xff | (temp << 8) & 0xff00; -+ *pL = ((temp >> 8) & 0xff) | ((temp << 8) & 0xff00); - #endif - - pL++; -@@ -305,7 +305,7 @@ template<> bool ReedSolomon<Galois16>::InternalProcess - *pH = *LH + *HH; - #else - temp = *LH + *HH; -- *pH = (temp >> 8) & 0xff | (temp << 8) & 0xff00; -+ *pH = ((temp >> 8) & 0xff) | ((temp << 8) & 0xff00); - #endif - - pH++; Index: patches/patch-src_par1repairer_cpp =================================================================== RCS file: patches/patch-src_par1repairer_cpp diff -N patches/patch-src_par1repairer_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_par1repairer_cpp 9 Dec 2017 16:40:01 -0000 @@ -0,0 +1,26 @@ +$OpenBSD$ + +pledge: + 'par2 repair' with par1 files - stdio rpath cpath + once the target files have been opened for writing, wpath is no + longer required, cpath must be kept to delete partial files in + case of an error + +Index: src/par1repairer.cpp +--- src/par1repairer.cpp.orig ++++ src/par1repairer.cpp +@@ -157,6 +157,14 @@ Result Par1Repairer::Process(const CommandLine &comman + if (!CreateTargetFiles()) + return eFileIOError; + ++#ifdef HAVE_PLEDGE ++ if (pledge("stdio rpath cpath", NULL) == -1) ++ { ++ cerr << "pledge failed" << endl; ++ return eLogicError; ++ } ++#endif ++ + // Work out which data blocks are available, which need to be recreated, + // and compute the appropriate Reed Solomon matrix. + if (!ComputeRSmatrix()) Index: patches/patch-src_par2cmdline_cpp =================================================================== RCS file: patches/patch-src_par2cmdline_cpp diff -N patches/patch-src_par2cmdline_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_par2cmdline_cpp 9 Dec 2017 16:40:01 -0000 @@ -0,0 +1,58 @@ +$OpenBSD$ + +pledge: + 'par2 create' - stdio rpath wpath cpath + creates and writes par files + + 'par2 repair' - stdio rpath wpath cpath + renames and deletes partial/damaged files, writes repaired files + + 'par2 verify' - stdio rpath cpath + may delete par files, only if -p option was given, otherwise + cpath is not required + +Index: src/par2cmdline.cpp +--- src/par2cmdline.cpp.orig ++++ src/par2cmdline.cpp +@@ -34,6 +34,14 @@ int main(int argc, char *argv[]) + _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_ALLOC_MEM_DF | /*_CRTDBG_CHECK_CRT_DF | */_CRTDBG_DELAY_FREE_MEM_DF | _CRTDBG_LEAK_CHECK_DF); + #endif + ++#ifdef HAVE_PLEDGE ++ if (pledge("stdio rpath wpath cpath", NULL) == -1) ++ { ++ cerr << "pledge failed" << endl; ++ return eLogicError; ++ } ++#endif ++ + // Parse the command line + CommandLine *commandline = new CommandLine; + +@@ -55,6 +63,26 @@ int main(int argc, char *argv[]) + break; + case CommandLine::opVerify: + { ++#ifdef HAVE_PLEDGE ++ if (!commandline->GetPurgeFiles()) ++ { ++ if (pledge("stdio rpath", NULL) == -1) ++ { ++ cerr << "pledge failed" << endl; ++ result = eLogicError; ++ break; ++ } ++ } ++ else ++ { ++ if (pledge("stdio rpath cpath", NULL) == -1) ++ { ++ cerr << "pledge failed" << endl; ++ result = eLogicError; ++ break; ++ } ++ } ++#endif + // Verify damaged files + switch (commandline->GetVersion()) + { Index: patches/patch-src_par2repairer_cpp =================================================================== RCS file: patches/patch-src_par2repairer_cpp diff -N patches/patch-src_par2repairer_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_par2repairer_cpp 9 Dec 2017 16:40:01 -0000 @@ -0,0 +1,26 @@ +$OpenBSD$ + +pledge: + 'par2 repair' with par2 files - stdio rpath cpath + once the target files have been opened for writing, wpath is no + longer required, cpath must be kept to delete partial files in + case of an error + +Index: src/par2repairer.cpp +--- src/par2repairer.cpp.orig ++++ src/par2repairer.cpp +@@ -187,6 +187,14 @@ Result Par2Repairer::Process(const CommandLine &comman + if (!CreateTargetFiles()) + return eFileIOError; + ++#ifdef HAVE_PLEDGE ++ if (pledge("stdio rpath cpath", NULL) == -1) ++ { ++ cerr << "pledge failed" << endl; ++ return eLogicError; ++ } ++#endif ++ + // Work out which data blocks are available, which need to be copied + // directly to the output, and which need to be recreated, and compute + // the appropriate Reed Solomon matrix. Index: patches/patch-tests_test12 =================================================================== RCS file: patches/patch-tests_test12 diff -N patches/patch-tests_test12 --- patches/patch-tests_test12 5 Oct 2015 16:50:14 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -$OpenBSD: patch-tests_test12,v 1.1 2015/10/05 16:50:14 sthen Exp $ - -- Fix regress tests, head -c not working on OpenBSD - ---- tests/test12.orig Sun Aug 2 17:09:46 2015 -+++ tests/test12 Sun Oct 4 22:23:04 2015 -@@ -19,7 +19,7 @@ echo $banner - echo $dashes - - mv test.data test.data-correct --head -c 113579 test.data-correct > test.data -+dd if=test.data-correct bs=113579 count=1 status=none of=test.data - - ../../par2 r test.par2 > ../$testname.log || { echo "ERROR: repair files using PAR 2.0 failed" ; exit 1; } >&2 - Index: patches/patch-tests_test13 =================================================================== RCS file: patches/patch-tests_test13 diff -N patches/patch-tests_test13 --- patches/patch-tests_test13 5 Oct 2015 16:50:14 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -$OpenBSD: patch-tests_test13,v 1.1 2015/10/05 16:50:14 sthen Exp $ - -- Fix regress tests, head -c not working on OpenBSD - ---- tests/test13.orig Sun Aug 2 17:09:46 2015 -+++ tests/test13 Sun Oct 4 22:23:56 2015 -@@ -28,7 +28,7 @@ echo $banner - echo $dashes - - mv test-1.data test-1.data-correct --head -c 177173 test-1.data-correct > test-1.data -+dd if=test-1.data-correct bs=177173 count=1 status=none of=test-1.data - - ../../par2 r testdata.par2 > ../$testname.log || { echo "ERROR: repair files using PAR 2.0 failed" ; exit 1; } >&2 - Index: patches/patch-tests_test18 =================================================================== RCS file: patches/patch-tests_test18 diff -N patches/patch-tests_test18 --- patches/patch-tests_test18 5 Oct 2015 16:50:14 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -$OpenBSD: patch-tests_test18,v 1.1 2015/10/05 16:50:14 sthen Exp $ - -- Fix regress tests, head -c not working on OpenBSD - ---- tests/test18.orig Sun Aug 2 17:09:46 2015 -+++ tests/test18 Sun Oct 4 22:24:50 2015 -@@ -28,7 +28,7 @@ echo $banner - echo $dashes - - mv flatdata.tar.gz flatdata.tar.gz-orig --head -c 1983 flatdata.tar.gz-orig > flatdata.tar.gz -+dd if=flatdata.tar.gz-orig bs=1983 count=1 status=none of=flatdata.tar.gz - rm -f flatdata.tar.gz-orig - - ../../par2 r recovery.par2 ./* > ../$testname.log || { echo "ERROR: PAR 2.0 repair failed" ; exit 1; } >&2 Index: patches/patch-tests_test20 =================================================================== RCS file: patches/patch-tests_test20 diff -N patches/patch-tests_test20 --- patches/patch-tests_test20 5 Oct 2015 16:50:14 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -$OpenBSD: patch-tests_test20,v 1.1 2015/10/05 16:50:14 sthen Exp $ - -- On OpenBSD iflag is not supported - ---- tests/test20.orig Sun Oct 4 22:27:11 2015 -+++ tests/test20 Sun Oct 4 22:30:27 2015 -@@ -16,7 +16,7 @@ echo $dashes - echo $banner - echo $dashes - --dd bs=1000 count=2 iflag=fullblock if=/dev/random of=myfile.dat -+dd bs=1000 count=2 if=/dev/random of=myfile.dat - - banner="Creating PAR 2.0 recovery data" - dashes=`echo "$banner" | sed s/./-/g` -- best regards q#