Here is an update to xz 5.2.0.

OK?


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/archivers/xz/Makefile,v
retrieving revision 1.23
diff -u -p -u -p -r1.23 Makefile
--- Makefile    21 Sep 2014 12:18:29 -0000      1.23
+++ Makefile    7 Jan 2015 00:37:52 -0000
@@ -2,8 +2,8 @@
 
 COMMENT=       LZMA compression and decompression tools
 
-DISTNAME=      xz-5.0.7
-SHARED_LIBS=   lzma                 1.0      # .5.6
+DISTNAME=      xz-5.2.0
+SHARED_LIBS=   lzma                 2.0      # .7.0
 CATEGORIES=    archivers
 DPB_PROPERTIES=        parallel
 
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/archivers/xz/distinfo,v
retrieving revision 1.10
diff -u -p -u -p -r1.10 distinfo
--- distinfo    21 Sep 2014 12:18:29 -0000      1.10
+++ distinfo    4 Jan 2015 21:58:45 -0000
@@ -1,2 +1,2 @@
-SHA256 (xz-5.0.7.tar.gz) = 9NIWVVO50Ngv0IvC6s3etI6+uGKlaGpgP4wESi5SyT8=
-SIZE (xz-5.0.7.tar.gz) = 1317771
+SHA256 (xz-5.2.0.tar.gz) = Ix7zaZgiQLsg7Xz/pSuxKkopfOaHH0gKuF6Ke6mL89Y=
+SIZE (xz-5.2.0.tar.gz) = 1445562
Index: patches/patch-config_h_in
===================================================================
RCS file: /home/cvs/ports/archivers/xz/patches/patch-config_h_in,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 patch-config_h_in
--- patches/patch-config_h_in   19 Sep 2014 20:58:39 -0000      1.4
+++ patches/patch-config_h_in   7 Jan 2015 09:56:26 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-config_h_in,v 1.4 2014/09/19 20:58:39 naddy Exp $
---- config.h.in.orig   Sun Sep 14 18:40:20 2014
-+++ config.h.in        Thu Sep 18 18:02:46 2014
-@@ -288,7 +288,11 @@
+--- config.h.in.orig   Sun Dec 21 13:50:05 2014
++++ config.h.in        Wed Jan  7 04:54:36 2015
+@@ -345,7 +345,11 @@
  
  /* Define to 1 if the system supports fast unaligned access to 16-bit and
     32-bit integers. */
Index: patches/patch-src_xz_file_io_c
===================================================================
RCS file: patches/patch-src_xz_file_io_c
diff -N patches/patch-src_xz_file_io_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_xz_file_io_c      11 Jan 2015 20:44:13 -0000
@@ -0,0 +1,127 @@
+$OpenBSD$
+
+f0f1f6c7235ffa901cf76fe18e33749e200b3eea
+xz: Don't fail if stdin doesn't support O_NONBLOCK.
+
+It's a problem at least on OpenBSD which doesn't support
+O_NONBLOCK on e.g. /dev/null. I'm not surprised if it's
+a problem on other OSes too since this behavior is allowed
+in POSIX-1.2008.
+
+The code relying on this behavior was committed in June 2013
+and included in 5.1.3alpha released on 2013-10-26. Clearly
+the development releases only get limited testing.
+
+4170edc914655310d2363baccf5e615e09b04911
+xz: Don't fail if stdout doesn't support O_NONBLOCK.
+
+This is similar to the case with stdin.
+
+Thanks to Brad Smith for the bug report and testing
+on OpenBSD.
+
+--- src/xz/file_io.c.orig      Sun Dec 21 13:49:36 2014
++++ src/xz/file_io.c   Sun Jan 11 15:40:57 2015
+@@ -393,7 +393,11 @@ io_open_src_real(file_pair *pair)
+ #ifdef TUKLIB_DOSLIKE
+               setmode(STDIN_FILENO, O_BINARY);
+ #else
+-              // Enable O_NONBLOCK for stdin.
++              // Try to set stdin to non-blocking mode. It won't work
++              // e.g. on OpenBSD if stdout is e.g. /dev/null. In such
++              // case we proceed as if stdin were non-blocking anyway
++              // (in case of /dev/null it will be in practice). The
++              // same applies to stdout in io_open_dest_real().
+               stdin_flags = fcntl(STDIN_FILENO, F_GETFL);
+               if (stdin_flags == -1) {
+                       message_error(_("Error getting the file status flags "
+@@ -402,17 +406,10 @@ io_open_src_real(file_pair *pair)
+                       return true;
+               }
+ 
+-              if ((stdin_flags & O_NONBLOCK) == 0) {
+-                      if (fcntl(STDIN_FILENO, F_SETFL,
+-                                      stdin_flags | O_NONBLOCK) == -1) {
+-                              message_error(_("Error setting O_NONBLOCK "
+-                                              "on standard input: %s"),
+-                                              strerror(errno));
+-                              return true;
+-                      }
+-
++              if ((stdin_flags & O_NONBLOCK) == 0
++                              && fcntl(STDIN_FILENO, F_SETFL,
++                                      stdin_flags | O_NONBLOCK) != -1)
+                       restore_stdin_flags = true;
+-              }
+ #endif
+ #ifdef HAVE_POSIX_FADVISE
+               // It will fail if stdin is a pipe and that's fine.
+@@ -705,7 +702,10 @@ io_open_dest_real(file_pair *pair)
+ #ifdef TUKLIB_DOSLIKE
+               setmode(STDOUT_FILENO, O_BINARY);
+ #else
+-              // Set O_NONBLOCK if it isn't already set.
++              // Try to set O_NONBLOCK if it isn't already set.
++              // If it fails, we assume that stdout is non-blocking
++              // in practice. See the comments in io_open_src_real()
++              // for similar situation with stdin.
+               //
+               // NOTE: O_APPEND may be unset later in this function
+               // and it relies on stdout_flags being set here.
+@@ -717,17 +717,10 @@ io_open_dest_real(file_pair *pair)
+                       return true;
+               }
+ 
+-              if ((stdout_flags & O_NONBLOCK) == 0) {
+-                      if (fcntl(STDOUT_FILENO, F_SETFL,
+-                                      stdout_flags | O_NONBLOCK) == -1) {
+-                              message_error(_("Error setting O_NONBLOCK "
+-                                              "on standard output: %s"),
+-                                              strerror(errno));
+-                              return true;
+-                      }
+-
+-                      restore_stdout_flags = true;
+-              }
++              if ((stdout_flags & O_NONBLOCK) == 0
++                              && fcntl(STDOUT_FILENO, F_SETFL,
++                                      stdout_flags | O_NONBLOCK) != -1)
++                              restore_stdout_flags = true;
+ #endif
+       } else {
+               pair->dest_name = suffix_get_dest_name(pair->src_name);
+@@ -829,23 +822,24 @@ io_open_dest_real(file_pair *pair)
+                               if (lseek(STDOUT_FILENO, 0, SEEK_END) == -1)
+                                       return false;
+ 
+-                              // O_NONBLOCK was set earlier in this function
+-                              // so it must be kept here too. If this
+-                              // fcntl() call fails, we continue but won't
++                              // Construct the new file status flags.
++                              // If O_NONBLOCK was set earlier in this
++                              // function, it must be kept here too.
++                              int flags = stdout_flags & ~O_APPEND;
++                              if (restore_stdout_flags)
++                                      flags |= O_NONBLOCK;
++
++                              // If this fcntl() fails, we continue but won't
+                               // try to create sparse output. The original
+                               // flags will still be restored if needed (to
+                               // unset O_NONBLOCK) when the file is finished.
+-                              if (fcntl(STDOUT_FILENO, F_SETFL,
+-                                              (stdout_flags | O_NONBLOCK)
+-                                              & ~O_APPEND) == -1)
++                              if (fcntl(STDOUT_FILENO, F_SETFL, flags) == -1)
+                                       return false;
+ 
+                               // Disabling O_APPEND succeeded. Mark
+                               // that the flags should be restored
+-                              // in io_close_dest(). This quite likely was
+-                              // already set when enabling O_NONBLOCK but
+-                              // just in case O_NONBLOCK was already set,
+-                              // set this again here.
++                              // in io_close_dest(). (This may have already
++                              // been set when enabling O_NONBLOCK.)
+                               restore_stdout_flags = true;
+ 
+                       } else if (lseek(STDOUT_FILENO, 0, SEEK_CUR)
Index: patches/patch-tests_xzgrep_expected_output
===================================================================
RCS file: patches/patch-tests_xzgrep_expected_output
diff -N patches/patch-tests_xzgrep_expected_output
--- patches/patch-tests_xzgrep_expected_output  19 Sep 2014 20:58:39 -0000      
1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-$OpenBSD: patch-tests_xzgrep_expected_output,v 1.1 2014/09/19 20:58:39 naddy 
Exp $
-
-OpenBSD grep and GNU grep interpret the combination -l -q differently.
-
---- tests/xzgrep_expected_output.orig  Sun Sep 14 18:17:20 2014
-+++ tests/xzgrep_expected_output       Fri Sep 19 21:34:41 2014
-@@ -4,7 +4,9 @@ xzgrep_test_1.xz:in voluptate velit esse cillum dolore
- xzgrep_test_2.xz:Hello
- retval 0
- => xzgrep -l el <=
-+(standard input)
- xzgrep_test_1.xz
-+(standard input)
- xzgrep_test_2.xz
- retval 0
- => xzgrep -h el <=
-@@ -21,6 +23,7 @@ retval 0
- xzgrep_test_2.xz:Hello
- retval 0
- => xzgrep -l Hello <=
-+(standard input)
- xzgrep_test_2.xz
- retval 0
- => xzgrep -h Hello <=
Index: pkg/PLIST
===================================================================
RCS file: /home/cvs/ports/archivers/xz/pkg/PLIST,v
retrieving revision 1.9
diff -u -p -u -p -r1.9 PLIST
--- pkg/PLIST   19 Sep 2014 20:58:39 -0000      1.9
+++ pkg/PLIST   11 Jan 2015 00:30:30 -0000
@@ -36,7 +36,7 @@ include/lzma/filter.h
 include/lzma/hardware.h
 include/lzma/index.h
 include/lzma/index_hash.h
-include/lzma/lzma.h
+include/lzma/lzma12.h
 include/lzma/stream_flags.h
 include/lzma/version.h
 include/lzma/vli.h
@@ -80,6 +80,7 @@ share/doc/xz/examples/00_README.txt
 share/doc/xz/examples/01_compress_easy.c
 share/doc/xz/examples/02_decompress.c
 share/doc/xz/examples/03_compress_custom.c
+share/doc/xz/examples/04_compress_easy_mt.c
 share/doc/xz/examples/Makefile
 share/doc/xz/examples_old/
 share/doc/xz/examples_old/xz_pipe_comp.c

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to