- Add --alias/-A option to set .zip name for stdin input
- Add --comment/-C option to add comment in .gz or .zip
- Fix a bug that misidentified a multi-entry .zip
- Fix a bug that did not emit double syncs for -i -p 1
- Fix a bug in yarn that could try to access freed data
- Do not delete multi-entry .zip files when extracting
- Do not reject .zip entries with bit 11 set
- Avoid a possible threads lock-order inversion
- Ignore trailing junk after a gzip stream by default

Besides the routine update, I had to amend CFLAGS to fix the following
warning:

        cc -O2 -pipe   -Wall -Wextra  -c pigz.c
        pigz.c:4543:9: warning: implicit declaration of function 'pledge' is 
invalid in C99 [-Wimplicit-function-declaration]
            if (pledge("stdio rpath wpath cpath fattr chown", NULL) == -1) {
                ^

That's because of this change in 2.5:

--- pig.c       Mon Jan 25 23:26:18 2021
+++ pig.c       Mon Jan 25 23:42:30 2021
@@ -321,8 +330,10 @@
    buffers to about the same number.
  */
 
-// Use large file functions if available.
-#define _FILE_OFFSET_BITS 64
+// Portability defines.
+#define _FILE_OFFSET_BITS 64            // Use large file functions
+#define _LARGE_FILES                    // Same thing for AIX
+#define _POSIX_C_SOURCE 200809L         // For MinGW
 
 // Included headers and what is expected from each.
 #include <stdio.h>      // fflush(), fprintf(), fputs(), getchar(), putc(),


_POSIX_C_SOURCE makes <sys/cdefs.h> define __POSIX_VISIBLE and, because
_BSD_SOURCE is not defined, therefore also define __BSD_VISIBLE 0.

<unistd.h> only protoypes pledge(2) under __BSD_VISIBLE, so fix the
warning by defining _BSD_SOURCE such that <sys/cdefs.h> defines
__BSD_VISIBLE 1.

This does result in object change.

Feedback? OK?


Index: Makefile
===================================================================
RCS file: /cvs/ports/archivers/pigz/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile    12 Jul 2019 20:43:29 -0000      1.8
+++ Makefile    25 Jan 2021 23:18:26 -0000
@@ -5,8 +5,7 @@ NOT_FOR_ARCHS=  ${GCC3_ARCHS}
 
 COMMENT =      parallel implementation of gzip utilizing multiple cores
 
-DISTNAME =     pigz-2.4
-REVISION =     0
+DISTNAME =     pigz-2.5
 CATEGORIES =   archivers
 HOMEPAGE =     https://zlib.net/pigz/
 
@@ -22,6 +21,10 @@ MASTER_SITES =       https://zlib.net/pigz/
 
 MAKE_FLAGS =   CC="${CC}" \
                CFLAGS="${CFLAGS} -Wall -Wextra"
+
+# pigz.c 2.5 defines _POSIX_C_SOURCE which prevents <unistd.h> from
+# prototyping pledge(2), override the define
+CFLAGS +=      -D_BSD_SOURCE
 
 ALL_TARGET =   pigz
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/archivers/pigz/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo    25 Jan 2018 10:34:49 -0000      1.4
+++ distinfo    25 Jan 2021 22:26:27 -0000
@@ -1,2 +1,2 @@
-SHA256 (pigz-2.4.tar.gz) = pPgWIip7Qmm9IyaAWQtXnMxyWR8bta2vzXIIynfhT3M=
-SIZE (pigz-2.4.tar.gz) = 98234
+SHA256 (pigz-2.5.tar.gz) = oAZkVwLKrsrOYzqJ61w3FIK0SkjQTzTgBY4rhdddTDY=
+SIZE (pigz-2.5.tar.gz) = 106438
Index: patches/patch-pigz_c
===================================================================
RCS file: /cvs/ports/archivers/pigz/patches/patch-pigz_c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-pigz_c
--- patches/patch-pigz_c        10 Jul 2018 13:32:44 -0000      1.1
+++ patches/patch-pigz_c        25 Jan 2021 22:26:28 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-pigz_c,v 1.1 2018/07/10 
 Index: pigz.c
 --- pigz.c.orig
 +++ pigz.c
-@@ -4307,6 +4307,11 @@ int main(int argc, char **argv) {
+@@ -4540,6 +4540,11 @@ int main(int argc, char **argv) {
      char *opts, *p;                 // environment default options, marker
      ball_t err;                     // error information from throw()
  
@@ -15,7 +15,7 @@ Index: pigz.c
      g.ret = 0;
      try {
          // initialize globals
-@@ -4408,6 +4413,12 @@ int main(int argc, char **argv) {
+@@ -4646,6 +4651,12 @@ int main(int argc, char **argv) {
              else if (option(argv[n]))   // process argument
                  argv[n] = NULL;         // remove if option
          option(NULL);                   // check for missing parameter

Reply via email to