Fix bug with --one-file-system --listed-incremental (used by amanda)

per: http://www.mail-archive.com/bug-tar@gnu.org/msg03019.html

Pass FORCE_UNSAFE_CONFIGURE=1 in the configure env to allow
building of this package as root.
This commit is contained in:
tez 2010-12-15 20:37:38 +00:00
parent 5b1f30e57f
commit f11d754ff1
5 changed files with 108 additions and 2 deletions

View file

@ -1,7 +1,8 @@
# $NetBSD: Makefile,v 1.66 2010/12/12 13:10:39 wiz Exp $
# $NetBSD: Makefile,v 1.67 2010/12/15 20:37:38 tez Exp $
DISTNAME= tar-1.25
PKGNAME= gtar-base-1.25
PKGREVISION= 1
SVR4_PKGNAME= gtarb
CATEGORIES= archivers
MASTER_SITES= ${MASTER_SITE_GNU:=tar/}
@ -40,6 +41,9 @@ CONFIGURE_ARGS+= --program-prefix=${GTAR_PROGRAM_PREFIX:Q}
# lie to configure about gettext -- it does not need GNU gettext
CONFIGURE_ENV+= gt_cv_func_gnugettext2_libintl=yes
# allow configure to run as root
CONFIGURE_ENV+= FORCE_UNSAFE_CONFIGURE=1
PLIST_SUBST+= GTAR_PROGRAM_PREFIX=${GTAR_PROGRAM_PREFIX:Q}
BUILD_DEFS+= GNU_PROGRAM_PREFIX
BUILD_DEFS+= GTAR_PROGRAM_PREFIX

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.26 2010/12/12 13:10:39 wiz Exp $
$NetBSD: distinfo,v 1.27 2010/12/15 20:37:38 tez Exp $
SHA1 (tar-1.25.tar.gz) = 28bcf4cfcb32805afead8a6259158064d96359fb
RMD160 (tar-1.25.tar.gz) = 8013ed400958cc8e9d605f5541e52e413bf878dc
@ -7,3 +7,6 @@ SHA1 (patch-aa) = 976d0caa9dd67c04a3c1b40ca5d5bea91bc9fcdf
SHA1 (patch-ab) = fcfa62f76b3ed3a0297962c39ae0de96e335e330
SHA1 (patch-ad) = 5573bd0e8aaf71b8a23d8b031c61b48c97b3fa97
SHA1 (patch-af) = 826a3c60c6f5734c87c64c53970d4ae956d51767
SHA1 (patch-al) = 53056a3b20a40aac0e04a1137856c5b47a7d6e0c
SHA1 (patch-am) = aec3b1496c227a64b098d0f3666ff9be4e4b10b5
SHA1 (patch-an) = 75c83efad6f197e82b9f1966c1034c393e749930

View file

@ -0,0 +1,16 @@
$NetBSD: patch-al,v 1.1 2010/12/15 20:37:38 tez Exp $
fix bug with --one-file-system --listed-incremental
(used by amanda)
--- src/create.c.orig 2010-12-15 13:53:21.658522400 -0600
+++ src/create.c 2010-12-15 13:55:08.938651400 -0600
@@ -1680,7 +1680,7 @@
This check is omitted if incremental_option is set *and* the
requested file is not explicitely listed in the command line. */
- if (!(incremental_option && !is_individual_file (p))
+ if (! (incremental_option && ! top_level)
&& !S_ISDIR (st->stat.st_mode)
&& OLDER_TAR_STAT_TIME (*st, m)
&& (!after_date_option || OLDER_TAR_STAT_TIME (*st, c)))

View file

@ -0,0 +1,29 @@
$NetBSD: patch-am,v 1.1 2010/12/15 20:37:38 tez Exp $
fix bug with --one-file-system --listed-incremental
(used by amanda)
--- src/incremen.c.orig 2010-12-15 13:53:32.763202200 -0600
+++ src/incremen.c 2010-12-15 13:57:33.751064600 -0600
@@ -426,7 +426,6 @@
{
struct directory *directory;
struct stat *stat_data = &st->stat;
- dev_t device = st->parent ? st->parent->stat.st_dev : 0;
bool nfs = NFS_FILE_STAT (*stat_data);
if ((directory = find_directory (name_buffer)) != NULL)
@@ -540,11 +539,8 @@
}
}
- /* If the directory is on another device and --one-file-system was given,
- omit it... */
- if (one_file_system_option && device != stat_data->st_dev
- /* ... except if it was explicitely given in the command line */
- && !is_individual_file (name_buffer))
+ if (one_file_system_option && st->parent
+ && stat_data->st_dev != st->parent->stat.st_dev)
/* FIXME:
WARNOPT (WARN_XDEV,
(0, 0,

View file

@ -0,0 +1,54 @@
$NetBSD: patch-an,v 1.1 2010/12/15 20:37:38 tez Exp $
fix bug with --one-file-system --listed-incremental
(used by amanda)
--- src/names.c.orig 2010-10-24 13:07:55.000000000 -0500
+++ src/names.c 2010-12-15 14:17:10.636670200 -0600
@@ -47,8 +47,6 @@
static uid_t cached_no_such_uid;
static gid_t cached_no_such_gid;
-static void register_individual_file (char const *name);
-
/* Given UID, find the corresponding UNAME. */
void
uid_to_uname (uid_t uid, char **uname)
@@ -360,8 +358,6 @@
{
if (unquote_option)
unquote_string (name_buffer);
- if (incremental_option)
- register_individual_file (name_buffer);
entry.type = ep->type;
entry.v.name = name_buffer;
return &entry;
@@ -1152,28 +1148,6 @@
return excluded_file_name (excluded, name + FILE_SYSTEM_PREFIX_LEN (name));
}
-static Hash_table *individual_file_table;
-
-static void
-register_individual_file (char const *name)
-{
- struct stat st;
-
- if (deref_stat (name, &st) != 0)
- return; /* Will be complained about later */
- if (S_ISDIR (st.st_mode))
- return;
-
- hash_string_insert (&individual_file_table, name);
-}
-
-bool
-is_individual_file (char const *name)
-{
- return hash_string_lookup (individual_file_table, name);
-}
-
-
/* Return the size of the prefix of FILE_NAME that is removed after
stripping NUM leading file name components. NUM must be