]> Dogcows Code - chaz/tar/commitdiff
Issue a warning if the archive being compared contais transformed file names.
authorSergey Poznyakoff <gray@gnu.org.ua>
Mon, 15 Nov 2010 09:22:27 +0000 (11:22 +0200)
committerSergey Poznyakoff <gray@gnu.org.ua>
Mon, 15 Nov 2010 09:22:27 +0000 (11:22 +0200)
* 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
src/compare.c
src/transform.c

index 69097b3f68cc791cca7269d4c12cdb60743af5d8..35e056ed7bd84457e367676a18895c8e847237c2 100644 (file)
@@ -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);
index f3112c6de8ff7b653b3212a7237bb2153b3cfffb..91ced57031925ddce030a4df2dc7f1d8decd4452 100644 (file)
@@ -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 ();
 
index c35133fa2578953bc5e21bf5cff9f56f877b8cc9..77aa0a299eb722a0deee32556d848ace239d7a5a 100644 (file)
@@ -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;
+}
This page took 0.021488 seconds and 4 git commands to generate.