From 73d0d1a0f883be5f67534362c99382f1eae8d178 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 15 Nov 2010 11:22:27 +0200 Subject: [PATCH] Issue a warning if the archive being compared contais transformed file names. * src/common.h (transform_program_p): New proto. * src/transform.c (transform_program_p): New function. * src/compare.c (verify_volume): Warn if the archive contains transformed file names. --- src/common.h | 1 + src/compare.c | 13 +++++++++++-- src/transform.c | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/common.h b/src/common.h index 69097b3..35e056e 100644 --- a/src/common.h +++ b/src/common.h @@ -779,6 +779,7 @@ void set_transform_expr (const char *expr); bool transform_name (char **pinput, int type); bool transform_name_fp (char **pinput, int type, char *(*fun)(char *, void *), void *); +bool transform_program_p (void); /* Module suffix.c */ void set_compression_program_by_suffix (const char *name, const char *defprog); diff --git a/src/compare.c b/src/compare.c index f3112c6..91ced57 100644 --- a/src/compare.c +++ b/src/compare.c @@ -512,14 +512,23 @@ diff_archive (void) void verify_volume (void) { + int may_fail = 0; if (removed_prefixes_p ()) { WARN((0, 0, _("Archive contains file names with leading prefixes removed."))); + may_fail = 1; + } + if (transform_program_p ()) + { WARN((0, 0, - _("Verification may fail to locate original files."))); + _("Archive contains transformed file names."))); + may_fail = 1; } - + if (may_fail) + WARN((0, 0, + _("Verification may fail to locate original files."))); + if (!diff_buffer) diff_init (); diff --git a/src/transform.c b/src/transform.c index c35133f..77aa0a2 100644 --- a/src/transform.c +++ b/src/transform.c @@ -628,3 +628,9 @@ transform_name (char **pinput, int type) { return transform_name_fp (pinput, type, NULL, NULL); } + +bool +transform_program_p (void) +{ + return transform_head != NULL; +} -- 2.45.2