head 1.6; access; symbols pkgsrc-2013Q2:1.6.0.54 pkgsrc-2013Q2-base:1.6 pkgsrc-2012Q4:1.6.0.52 pkgsrc-2012Q4-base:1.6 pkgsrc-2011Q4:1.6.0.50 pkgsrc-2011Q4-base:1.6 pkgsrc-2011Q2:1.6.0.48 pkgsrc-2011Q2-base:1.6 pkgsrc-2009Q4:1.6.0.46 pkgsrc-2009Q4-base:1.6 pkgsrc-2008Q4:1.6.0.44 pkgsrc-2008Q4-base:1.6 pkgsrc-2008Q3:1.6.0.42 pkgsrc-2008Q3-base:1.6 cube-native-xorg:1.6.0.40 cube-native-xorg-base:1.6 pkgsrc-2008Q2:1.6.0.38 pkgsrc-2008Q2-base:1.6 pkgsrc-2008Q1:1.6.0.36 pkgsrc-2008Q1-base:1.6 pkgsrc-2007Q4:1.6.0.34 pkgsrc-2007Q4-base:1.6 pkgsrc-2007Q3:1.6.0.32 pkgsrc-2007Q3-base:1.6 pkgsrc-2007Q2:1.6.0.30 pkgsrc-2007Q2-base:1.6 pkgsrc-2007Q1:1.6.0.28 pkgsrc-2007Q1-base:1.6 pkgsrc-2006Q4:1.6.0.26 pkgsrc-2006Q4-base:1.6 pkgsrc-2006Q3:1.6.0.24 pkgsrc-2006Q3-base:1.6 pkgsrc-2006Q2:1.6.0.22 pkgsrc-2006Q2-base:1.6 pkgsrc-2006Q1:1.6.0.20 pkgsrc-2006Q1-base:1.6 pkgsrc-2005Q4:1.6.0.18 pkgsrc-2005Q4-base:1.6 pkgsrc-2005Q3:1.6.0.16 pkgsrc-2005Q3-base:1.6 pkgsrc-2005Q2:1.6.0.14 pkgsrc-2005Q2-base:1.6 pkgsrc-2005Q1:1.6.0.12 pkgsrc-2005Q1-base:1.6 pkgsrc-2004Q4:1.6.0.10 pkgsrc-2004Q4-base:1.6 pkgsrc-2004Q3:1.6.0.8 pkgsrc-2004Q3-base:1.6 pkgsrc-2004Q2:1.6.0.6 pkgsrc-2004Q2-base:1.6 pkgsrc-2004Q1:1.6.0.4 pkgsrc-2004Q1-base:1.6 pkgsrc-2003Q4:1.6.0.2 pkgsrc-2003Q4-base:1.6 buildlink2-base:1.6 netbsd-1-4-PATCH001:1.4 netbsd-1-4-RELEASE:1.4 netbsd-1-3-PATCH003:1.4 netbsd-1-3-PATCH002:1.3; locks; strict; comment @# @; 1.6 date 99.09.18.15.23.43; author kim; state dead; branches; next 1.5; 1.5 date 99.08.10.05.05.40; author christos; state Exp; branches; next 1.4; 1.4 date 98.08.07.10.35.49; author agc; state Exp; branches; next 1.3; 1.3 date 98.03.24.20.34.52; author tv; state Exp; branches; next 1.2; 1.2 date 98.03.08.02.51.17; author tv; state Exp; branches; next 1.1; 1.1 date 98.03.05.19.57.18; author tv; state Exp; branches; next ; desc @@ 1.6 log @Turn this into a meta-package for GNU tar. @ text @$NetBSD: patch-ab,v 1.5 1999/08/10 05:05:40 christos Exp $ --- src/extract.c.orig Tue Apr 22 20:05:57 1997 +++ src/extract.c Fri Mar 6 14:33:05 1998 @@@@ -103,7 +103,11 @@@@ if (!keep_old_files_option || (stat_info->st_mode & (S_ISUID | S_ISGID | S_ISVTX))) +#ifdef __NetBSD__ + if (lchmod (file_name, ~current_umask & (int) stat_info->st_mode) < 0) +#else if (chmod (file_name, ~current_umask & (int) stat_info->st_mode) < 0) +#endif ERROR ((0, errno, _("%s: Cannot change mode to %0.4o"), file_name, ~current_umask & (int) stat_info->st_mode)); } @@@@ -124,8 +128,10 @@@@ { struct utimbuf utimbuf; +#ifndef __NetBSD__ if (!symlink_flag) { +#endif /* We do the utime before the chmod because some versions of utime are broken and trash the modes of the file. */ @@@@ -137,6 +143,7 @@@@ /* FIXME: incremental_option should set ctime too, but how? */ +#ifndef __NetBSD__ if (incremental_option) utimbuf.actime = stat_info->st_atime; else @@@@ -145,6 +152,19 @@@@ utimbuf.modtime = stat_info->st_mtime; if (utime (file_name, &utimbuf) < 0) +#else + struct timeval tv[2]; + + if (incremental_option) + tv[0].tv_sec = stat_info->st_atime; + else + tv[0].tv_sec = now; + 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 ERROR ((0, errno, _("%s: Could not change access and modification times"), file_name)); @@@@ -155,7 +175,9 @@@@ have to set permissions prior to possibly giving files away. */ set_mode (file_name, stat_info); +#ifndef __NetBSD__ } +#endif /* If we are root, set the owner and group of the extracted file, so we extract as the original owner. Or else, if we are running as a user, --- src/tar.c.orig Fri Apr 25 16:09:49 1997 +++ src/tar.c Sat Mar 7 21:43:15 1998 @@@@ -163,6 +163,7 @@@@ #define SUFFIX_OPTION 15 #define USE_COMPRESS_PROGRAM_OPTION 16 #define VOLNO_FILE_OPTION 17 +#define NO_UNLINK_FIRST_OPTION 20 /* Some cleanup is being made in GNU tar long options. Using old names is allowed for a while, but will also send a warning to stderr. Take old @@@@ -237,6 +238,8 @@@@ {"newer-mtime", required_argument, NULL, NEWER_MTIME_OPTION}, {"null", no_argument, NULL, NULL_OPTION}, {"no-recursion", no_argument, NULL, NO_RECURSE_OPTION}, + {"norecurse", no_argument, NULL, NO_RECURSE_OPTION}, + {"no-unlink-first", no_argument, NULL, NO_UNLINK_FIRST_OPTION}, {"numeric-owner", no_argument, &numeric_owner_option, 1}, {"old-archive", no_argument, NULL, 'o'}, {"one-file-system", no_argument, NULL, 'l'}, @@@@ -267,6 +270,7 @@@@ {"touch", no_argument, NULL, 'm'}, {"uncompress", no_argument, NULL, 'Z'}, {"ungzip", no_argument, NULL, 'z'}, + {"unlink", no_argument, NULL, 'U'}, {"unlink-first", no_argument, NULL, 'U'}, {"update", no_argument, NULL, 'u'}, {"use-compress-program", required_argument, NULL, USE_COMPRESS_PROGRAM_OPTION}, @@@@ -320,7 +324,8 @@@@ -W, --verify attempt to verify the archive after writing it\n\ --remove-files remove files after adding them to the archive\n\ -k, --keep-old-files don't overwrite existing files when extracting\n\ - -U, --unlink-first remove each file prior to extracting over it\n\ + -U, --unlink-first remove each file prior to extracting (default)\n\ + --no-unlink-first don't remove each file prior to extracting\n\ --recursive-unlink empty hierarchies prior to extracting directory\n\ -S, --sparse handle sparse files efficiently\n\ -O, --to-stdout extract files to standard output\n\ @@@@ -487,6 +492,7 @@@@ owner_option = -1; group_option = -1; + unlink_first_option = 1; backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); version_control_string = getenv ("VERSION_CONTROL"); @@@@ -780,6 +786,10 @@@@ case 'U': unlink_first_option = 1; + break; + + case NO_UNLINK_FIRST_OPTION: + unlink_first_option = 0; break; case 'v': @ 1.5 log @make this work under linux. - don't use gnumalloc - use lchmod only on NetBSD @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.4 1998/08/07 10:35:49 agc Exp $ @ 1.4 log @Add NetBSD RCS Ids. @ text @d1 1 a1 1 $NetBSD$ d5 1 a5 1 @@@@ -103,7 +103,7 @@@@ d9 1 a9 1 - if (chmod (file_name, ~current_umask & (int) stat_info->st_mode) < 0) d11 3 d17 1 a17 1 @@@@ -124,8 +124,10 @@@@ d28 1 a28 1 @@@@ -137,6 +139,7 @@@@ d36 1 a36 1 @@@@ -145,6 +148,19 @@@@ d56 1 a56 1 @@@@ -155,7 +171,9 @@@@ @ 1.3 log @fix for PR 5194 from augustss - no directory in patched file names @ text @d1 2 @ 1.2 log @gtar, in this pkg format, will never be called from pkg_add, so we won't even pretend that we support the --fast-read option as a no-op--we don't support it at all. (pax or the old in-tree tar does.) @ text @d1 2 a2 2 --- extract.c.orig Tue Apr 22 20:05:57 1997 +++ extract.c Fri Mar 6 14:33:05 1998 d61 2 a62 2 --- tar.c.orig Fri Apr 25 16:09:49 1997 +++ tar.c Sat Mar 7 21:43:15 1998 @ 1.1 log @Bring gtar up to date with the NetBSD changes to GNU tar: - use lutimes() and lchmod() in addition to lchown() - add --norecurse as an undocumented synonym for --no-recursion - add --fast-read as an undocumented nullop (this is _not_ necessary) - pre-set --unlink-first - add --unlink as an undocumented synonym for --unlink-first - add --no-unlink-first to allow turning --unlink-first off NetBSD's tar is based on GNU tar 1.11.2. This tar, 1.12, has much of the functionality NetBSD has added over time, so only the above changes were necessary. @ text @d1 2 a2 2 --- src/extract.c.orig Tue Apr 22 20:05:57 1997 +++ src/extract.c Thu Mar 5 13:59:52 1998 d61 2 a62 2 --- src/tar.c.orig Fri Apr 25 16:09:49 1997 +++ src/tar.c Thu Mar 5 14:32:19 1998 d71 1 a71 9 @@@@ -211,6 +212,7 @@@@ {"exclude", required_argument, NULL, EXCLUDE_OPTION}, {"exclude-from", required_argument, NULL, 'X'}, {"extract", no_argument, NULL, 'x'}, + {"fast-read", no_argument, NULL, 1}, {"file", required_argument, NULL, 'f'}, {"files-from", required_argument, NULL, 'T'}, {"force-local", no_argument, &force_local_option, 1}, @@@@ -237,6 +239,8 @@@@ d80 1 a80 1 @@@@ -267,6 +271,7 @@@@ d88 1 a88 1 @@@@ -320,7 +325,8 @@@@ d98 1 a98 1 @@@@ -487,6 +493,7 @@@@ d106 1 a106 1 @@@@ -780,6 +787,10 @@@@ @