pkgsrc/archivers/gtar-base/patches/patch-ag
2006-12-03 15:21:20 +00:00

69 lines
1.7 KiB
Text

$NetBSD: patch-ag,v 1.4 2006/12/03 15:21:20 tron Exp $
--- src/extract.c.orig 2004-12-21 09:55:12.000000000 +0000
+++ src/extract.c 2006-12-03 15:13:25.000000000 +0000
@@ -195,7 +195,11 @@
mode = cur_info->st_mode ^ invert_permissions;
}
+#if (defined (__NetBSD__) && NetBSD > 199706 && !defined(NetBSD1_2))
+ if (lchmod (file_name, mode) != 0)
+#else
if (chmod (file_name, mode) != 0)
+#endif
chmod_error_details (file_name, mode);
}
@@ -235,7 +239,12 @@
{
struct utimbuf utimbuf;
+#if !(defined (__NetBSD__) && NetBSD > 199706 && !defined(NetBSD1_2))
if (typeflag != SYMTYPE)
+#else
+ struct timeval tv[2];
+#endif
+
{
/* We do the utime before the chmod because some versions of utime are
broken and trash the modes of the file. */
@@ -248,6 +257,7 @@
/* FIXME: incremental_option should set ctime too, but how? */
+#if !(defined (__NetBSD__) && NetBSD > 199706 && !defined(NetBSD1_2))
if (incremental_option)
utimbuf.actime = stat_info->st_atime;
else
@@ -256,6 +266,16 @@
utimbuf.modtime = stat_info->st_mtime;
if (utime (file_name, &utimbuf) < 0)
+#else
+ if (incremental_option)
+ tv[0].tv_sec = stat_info->st_atime;
+ else
+ tv[0].tv_sec = start_time;
+ tv[0].tv_usec = 0;
+ tv[1].tv_sec = stat_info->st_mtime;
+ tv[1].tv_usec = 0;
+ if (lutimes (file_name, tv) < 0)
+#endif
utime_error (file_name);
else
{
@@ -1101,7 +1121,13 @@
break;
case GNUTYPE_NAMES:
- extract_mangle ();
+ if (allow_name_mangling_option) {
+ extract_mangle ();
+ }
+ else {
+ ERROR ((0, 0, _("GNUTYPE_NAMES mangling ignored")));
+ skip_member ();
+ }
break;
case GNUTYPE_MULTIVOL: