Here's an update to archivers/gcpio.

what's new:
* Improved error checking and diagnostics
* Fixed CAN-1999-1572
* Allow to use --sparse in both copy-in and copy-pass.
* Fix bug that eventually caused copying out the same hard-linked file 
several times to archive.
* Fix several LFS-related issues.

works for me on i386, amd64, sparc and sparc64.

please test and comment.

Rui Reis


Index: Makefile
===================================================================
RCS file: /cvs/ports/archivers/gcpio/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile    20 Oct 2005 21:45:18 -0000      1.10
+++ Makefile    15 Apr 2007 01:37:51 -0000
@@ -2,7 +2,7 @@
 
 COMMENT=       "GNU copy-in/out (cpio)"
 
-DISTNAME=      cpio-2.6
+DISTNAME=      cpio-2.7
 PKGNAME=       g${DISTNAME}
 CATEGORIES=    archivers
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/archivers/gcpio/distinfo,v
retrieving revision 1.5
diff -u -r1.5 distinfo
--- distinfo    5 Apr 2007 15:37:40 -0000       1.5
+++ distinfo    15 Apr 2007 01:37:51 -0000
@@ -1,5 +1,5 @@
-MD5 (cpio-2.6.tar.gz) = drQUXzPfCIpbreO/Q3PRfQ==
-RMD160 (cpio-2.6.tar.gz) = gka90Iq4cn+agELTPd/jpjMkdrg=
-SHA1 (cpio-2.6.tar.gz) = Wk6hVlGZCZlP4Fkz3II6vPB+PiE=
-SHA256 (cpio-2.6.tar.gz) = lUxXBeoYYaRD16YXU+MiZwHCAvyOOYynL2dONWHM9sI=
-SIZE (cpio-2.6.tar.gz) = 556018
+MD5 (cpio-2.7.tar.gz) = iFjTRNOS8yYhAyA54b97lQ==
+RMD160 (cpio-2.7.tar.gz) = gWVZK6+z73coYj39S0BSRf3GDeo=
+SHA1 (cpio-2.7.tar.gz) = dFtpVhSJXtyFwGnIHgAPB+rKtH4=
+SHA256 (cpio-2.7.tar.gz) = uupeFtELMXS/WqL9CFy+Pz97CATiLVOIHPlySzHqt6I=
+SIZE (cpio-2.7.tar.gz) = 895534
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/archivers/gcpio/patches/patch-configure,v
retrieving revision 1.1
diff -u -r1.1 patch-configure
--- patches/patch-configure     20 Oct 2005 21:45:18 -0000      1.1
+++ patches/patch-configure     15 Apr 2007 01:37:51 -0000
@@ -1,12 +1,12 @@
-$OpenBSD: patch-configure,v 1.1 2005/10/20 21:45:18 naddy Exp $
---- configure.orig     Thu Oct 20 23:11:17 2005
-+++ configure  Thu Oct 20 23:11:43 2005
-@@ -16167,7 +16167,7 @@ s,@host_vendor@,$host_vendor,;t t
- s,@host_os@,$host_os,;t t
- s,@LIBICONV@,$LIBICONV,;t t
- s,@LTLIBICONV@,$LTLIBICONV,;t t
--s,@INTLLIBS@,$INTLLIBS,;t t
-+s,@INTLLIBS@,$LTLIBINTL,;t t
- s,@LIBINTL@,$LIBINTL,;t t
- s,@LTLIBINTL@,$LTLIBINTL,;t t
- s,@POSUB@,$POSUB,;t t
+$OpenBSD$
+--- configure.orig     Sun Apr 15 01:57:52 2007
++++ configure  Sun Apr 15 01:58:30 2007
+@@ -35249,7 +35249,7 @@ MSGMERGE!$MSGMERGE$ac_delim
+ INTL_MACOSX_LIBS!$INTL_MACOSX_LIBS$ac_delim
+ LIBICONV!$LIBICONV$ac_delim
+ LTLIBICONV!$LTLIBICONV$ac_delim
+-INTLLIBS!$INTLLIBS$ac_delim
++INTLLIBS!$LTLIBINTL$ac_delim
+ LIBINTL!$LIBINTL$ac_delim
+ LTLIBINTL!$LTLIBINTL$ac_delim
+ POSUB!$POSUB$ac_delim
Index: patches/patch-doc_Makefile_in
===================================================================
RCS file: /cvs/ports/archivers/gcpio/patches/patch-doc_Makefile_in,v
retrieving revision 1.1
diff -u -r1.1 patch-doc_Makefile_in
--- patches/patch-doc_Makefile_in       20 Oct 2005 21:45:18 -0000      1.1
+++ patches/patch-doc_Makefile_in       15 Apr 2007 01:37:51 -0000
@@ -1,12 +1,12 @@
-$OpenBSD: patch-doc_Makefile_in,v 1.1 2005/10/20 21:45:18 naddy Exp $
---- doc/Makefile.in.orig       Thu Oct 20 21:47:43 2005
-+++ doc/Makefile.in    Thu Oct 20 21:47:57 2005
-@@ -206,7 +206,7 @@ sharedstatedir = @sharedstatedir@
+$OpenBSD$
+--- doc/Makefile.in.orig       Sun Apr 15 02:18:12 2007
++++ doc/Makefile.in    Sun Apr 15 02:18:26 2007
+@@ -290,7 +290,7 @@ sharedstatedir = @sharedstatedir@
  sysconfdir = @sysconfdir@
  target_alias = @target_alias@
  info_TEXINFOS = cpio.texi
 -man_MANS = cpio.1 mt.1
 +man_MANS = cpio.1
- EXTRA_DIST = $(man_MANS)
+ EXTRA_DIST = $(man_MANS) gendocs_template
  all: all-am
  
Index: patches/patch-lib_system_h
===================================================================
RCS file: /cvs/ports/archivers/gcpio/patches/patch-lib_system_h,v
retrieving revision 1.1
diff -u -r1.1 patch-lib_system_h
--- patches/patch-lib_system_h  20 Oct 2005 21:45:18 -0000      1.1
+++ patches/patch-lib_system_h  15 Apr 2007 01:37:51 -0000
@@ -1,12 +1,12 @@
-$OpenBSD: patch-lib_system_h,v 1.1 2005/10/20 21:45:18 naddy Exp $
---- lib/system.h.orig  Thu Oct 20 21:27:34 2005
-+++ lib/system.h       Thu Oct 20 21:27:49 2005
-@@ -467,7 +467,7 @@ char *getenv ();
-   ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 \
-    + 1 + TYPE_SIGNED (t))
+$OpenBSD$
+--- lib/system.h.orig  Sat Apr 14 18:08:21 2007
++++ lib/system.h       Sat Apr 14 18:08:43 2007
+@@ -425,7 +425,7 @@ char *getenv ();
  
--#define UINTMAX_STRSIZE_BOUND (INT_STRLEN_BOUND (uintmax_t) + 1)
-+#define UINTMAX_STRSIZE_BOUND (INT_STRLEN_BOUND (uint64_t) + 1)
+ #include <intprops.h>
+ 
+-#define UINTMAX_STRSIZE_BOUND INT_BUFSIZE_BOUND (uintmax_t)
++#define UINTMAX_STRSIZE_BOUND INT_BUFSIZE_BOUND (uint64_t)
  
  /* Prototypes for external functions.  */
  
Index: patches/patch-src_copyin_c
===================================================================
RCS file: patches/patch-src_copyin_c
diff -N patches/patch-src_copyin_c
--- patches/patch-src_copyin_c  20 Oct 2005 21:45:18 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,100 +0,0 @@
-$OpenBSD: patch-src_copyin_c,v 1.1 2005/10/20 21:45:18 naddy Exp $
---- src/copyin.c.orig  Wed Sep  8 13:10:02 2004
-+++ src/copyin.c       Thu Oct 20 23:33:40 2005
-@@ -389,19 +389,20 @@ create_final_defers ()
-         continue;
-       }
- 
--      if (close (out_file_des) < 0)
--      error (0, errno, "%s", d->header.c_name);
--
-       /* File is now copied; set attributes.  */
-       if (!no_chown_flag)
--      if ((chown (d->header.c_name,
-+      if ((fchown (out_file_des,
-                   set_owner_flag ? set_owner : d->header.c_uid,
-              set_group_flag ? set_group : d->header.c_gid) < 0)
-           && errno != EPERM)
-         error (0, errno, "%s", d->header.c_name);
-       /* chown may have turned off some permissions we wanted. */
--      if (chmod (d->header.c_name, (int) d->header.c_mode) < 0)
-+      if (fchmod (out_file_des, (int) d->header.c_mode) < 0)
-       error (0, errno, "%s", d->header.c_name);
-+
-+      if (close (out_file_des) < 0)
-+      error (0, errno, "%s", d->header.c_name);
-+
-       if (retain_time_flag)
-       {
-         times.actime = times.modtime = d->header.c_mtime;
-@@ -1335,6 +1336,48 @@ swab_array (char *ptr, int count)
-     }
- }
- 
-+/* Return a safer suffix of FILE_NAME, or "." if it has no safer
-+   suffix.  Check for fully specified file names and other atrocities.  */
-+static const char *
-+safer_name_suffix (char const *file_name)
-+{
-+  char const *p;
-+
-+  /* Skip leading file name components that contain "..", and leading 
slashes.  */
-+  size_t prefix_len = 0;
-+
-+  for (p = file_name; *p;)
-+    {
-+      if (p[0] == '.' && p[1] == '.' && ((p[2] == '/') || !p[2]))
-+      prefix_len = p + 2 - file_name;
-+
-+      do
-+      {
-+        if (*p++ == '/')
-+          break;
-+      }
-+      while (*p);
-+    }
-+
-+  for (p = file_name + prefix_len; *p == '/'; p++)
-+    continue;
-+  prefix_len = p - file_name;
-+
-+  if (prefix_len)
-+    {
-+      char *prefix = alloca (prefix_len + 1);
-+      memcpy (prefix, file_name, prefix_len);
-+      prefix[prefix_len] = '\0';
-+
-+      error (0, 0, ("Removing leading `%s' from member names"), prefix);
-+    }
-+
-+  if (!*p)
-+    p = ".";
-+
-+  return p;
-+}
-+
- /* Read the collection from standard input and create files
-    in the file system.  */
- 
-@@ -1445,18 +1488,11 @@ process_copy_in ()
- 
-       /* Do we have to ignore absolute paths, and if so, does the filename
-          have an absolute path?  */
--      if (no_abs_paths_flag && file_hdr.c_name && file_hdr.c_name [0] == '/')
-+      if (no_abs_paths_flag && file_hdr.c_name && file_hdr.c_name [0])
-       {
--        char *p;
-+        const char *p = safer_name_suffix (file_hdr.c_name);
- 
--        p = file_hdr.c_name;
--        while (*p == '/')
--          ++p;
--        if (*p == '\0')
--          {
--            strcpy (file_hdr.c_name, ".");
--          }
--        else
-+        if (p != file_hdr.c_name)
-           {
-               /* Debian hack: file_hrd.c_name is sometimes set to
-                  point to static memory by code in tar.c.  This
Index: patches/patch-src_copypass_c
===================================================================
RCS file: patches/patch-src_copypass_c
diff -N patches/patch-src_copypass_c
--- patches/patch-src_copypass_c        20 Oct 2005 21:45:18 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,29 +0,0 @@
-$OpenBSD: patch-src_copypass_c,v 1.1 2005/10/20 21:45:18 naddy Exp $
---- src/copypass.c.orig        Mon Sep  6 14:09:04 2004
-+++ src/copypass.c     Thu Oct 20 23:33:41 2005
-@@ -181,19 +181,20 @@ process_copy_pass ()
-               }
-             if (close (in_file_des) < 0)
-               error (0, errno, "%s", input_name.ds_string);
--            if (close (out_file_des) < 0)
--              error (0, errno, "%s", output_name.ds_string);
--
-             /* Set the attributes of the new file.  */
-             if (!no_chown_flag)
--              if ((chown (output_name.ds_string,
-+              if ((fchown (out_file_des,
-                           set_owner_flag ? set_owner : in_file_stat.st_uid,
-                     set_group_flag ? set_group : in_file_stat.st_gid) < 0)
-                   && errno != EPERM)
-                 error (0, errno, "%s", output_name.ds_string);
-             /* chown may have turned off some permissions we wanted. */
--            if (chmod (output_name.ds_string, in_file_stat.st_mode) < 0)
-+            if (fchmod (out_file_des, in_file_stat.st_mode) < 0)
-               error (0, errno, "%s", output_name.ds_string);
-+              
-+            if (close (out_file_des) < 0)
-+              error (0, errno, "%s", output_name.ds_string);
-+
-             if (reset_time_flag)
-               {
-                 times.actime = in_file_stat.st_atime;
Index: patches/patch-src_main_c
===================================================================
RCS file: patches/patch-src_main_c
diff -N patches/patch-src_main_c
--- patches/patch-src_main_c    20 Oct 2005 21:45:18 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-src_main_c,v 1.1 2005/10/20 21:45:18 naddy Exp $
---- src/main.c.orig    Tue Nov 23 01:42:18 2004
-+++ src/main.c Thu Oct 20 21:57:59 2005
-@@ -740,7 +740,6 @@ main (int argc, char *argv[])
-   textdomain (PACKAGE);
- 
-   program_name = argv[0];
--  umask (0);
- 
- #ifdef __TURBOC__
-   _fmode = O_BINARY;          /* Put stdin and stdout in binary mode.  */
-@@ -751,6 +750,7 @@ main (int argc, char *argv[])
- #endif
- 
-   process_args (argc, argv);
-+  umask (0);
- 
-   initialize_buffers ();
- 
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/archivers/gcpio/pkg/PLIST,v
retrieving revision 1.4
diff -u -r1.4 PLIST
--- pkg/PLIST   20 Oct 2005 21:45:18 -0000      1.4
+++ pkg/PLIST   15 Apr 2007 01:37:51 -0000
@@ -6,14 +6,19 @@
 share/locale/de/LC_MESSAGES/cpio.mo
 share/locale/es/LC_MESSAGES/cpio.mo
 share/locale/fr/LC_MESSAGES/cpio.mo
+share/locale/ga/LC_MESSAGES/cpio.mo
 share/locale/gl/LC_MESSAGES/cpio.mo
-share/locale/hu/LC_MESSAGES/cpio.mo
 share/locale/ko/LC_MESSAGES/cpio.mo
 share/locale/nl/LC_MESSAGES/cpio.mo
 share/locale/pl/LC_MESSAGES/cpio.mo
 share/locale/pt_BR/LC_MESSAGES/cpio.mo
 share/locale/ro/LC_MESSAGES/cpio.mo
 share/locale/ru/LC_MESSAGES/cpio.mo
+share/locale/rw/
+share/locale/rw/LC_MESSAGES/
+share/locale/rw/LC_MESSAGES/cpio.mo
 share/locale/sv/LC_MESSAGES/cpio.mo
 share/locale/tr/LC_MESSAGES/cpio.mo
+share/locale/uk/LC_MESSAGES/cpio.mo
+share/locale/vi/LC_MESSAGES/cpio.mo
 share/locale/zh_CN/LC_MESSAGES/cpio.mo

Reply via email to