patch from joeyh to hack around removal of the src/create.c patch concerning
authorBdale Garbee <bdale@gag.com>
Fri, 12 Nov 2010 09:22:49 +0000 (02:22 -0700)
committerBdale Garbee <bdale@gag.com>
Fri, 12 Nov 2010 09:22:49 +0000 (02:22 -0700)
links of 100 chars that breaks pristine-tar in some circumstances.  we think
this is better than having pristine-tar carry around an old copy of tar...

debian/changelog
debian/patches/longlink-hack.diff [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]
debian/source/format [new file with mode: 0644]

index 28792cd5c339d1a7cdc63ae2982b10977d9638c4..78372b57adf635ffdedafd8696b48331ad222e1b 100644 (file)
@@ -1,3 +1,14 @@
+tar (1.25-2) unstable; urgency=low
+
+  * accept a "hack" from Joey Hess to work around an unfortunate side effect 
+    of removing the patch to src/create.c regarding links of 100 chars in
+    1.23-4 that broke pristine-tar in some cases.  The "fix" is to support 
+    the old behavior if the environment variable TAR_LONGLINK_100 is set, 
+    which pristine-tar knows about and will use when necessary but which 
+    should never be used by anyone else!  closes: #603231
+
+ -- Bdale Garbee <bdale@gag.com>  Wed, 10 Nov 2010 15:45:09 -0700
+
 tar (1.25-1) unstable; urgency=low
 
   * new upstream version, closes: #602184, #602209, #602413, #575298
diff --git a/debian/patches/longlink-hack.diff b/debian/patches/longlink-hack.diff
new file mode 100644 (file)
index 0000000..7163e47
--- /dev/null
@@ -0,0 +1,68 @@
+diff -ur orig/tar-1.25/src/common.h tar-1.25/src/common.h
+--- orig/tar-1.25/src/common.h 2010-11-10 18:41:01.000000000 -0400
++++ tar-1.25/src/common.h      2010-11-11 20:28:06.000000000 -0400
+@@ -834,3 +834,5 @@
+ /* Module exit.c */
+ extern void (*fatal_exit_hook) (void);
++
++GLOBAL int debian_longlink_hack;
+diff -ur orig/tar-1.25/src/create.c tar-1.25/src/create.c
+--- orig/tar-1.25/src/create.c 2010-11-10 18:41:01.000000000 -0400
++++ tar-1.25/src/create.c      2010-11-11 20:30:44.000000000 -0400
+@@ -26,6 +26,8 @@
+ #include "common.h"
+ #include <hash.h>
++extern int debian_longlink_hack;
++
+ /* Error number to use when an impostor is discovered.
+    Pretend the impostor isn't there.  */
+ enum { IMPOSTOR_ERRNO = ENOENT };
+@@ -735,7 +737,7 @@
+       return write_short_name (st);
+     }
+   else if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT)
+-         < strlen (st->file_name))
++         < strlen (st->file_name) + debian_longlink_hack)
+     return write_long_name (st);
+   else
+     return write_short_name (st);
+@@ -1456,7 +1458,7 @@
+         block_ordinal = current_block_ordinal ();
+         assign_string (&st->link_name, link_name);
+         if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT)
+-            < strlen (link_name))
++            < strlen (link_name) + debian_longlink_hack)
+           write_long_link (st);
+         st->stat.st_size = 0;
+diff -ur orig/tar-1.25/src/tar.c tar-1.25/src/tar.c
+--- orig/tar-1.25/src/tar.c    2010-11-10 18:41:01.000000000 -0400
++++ tar-1.25/src/tar.c 2010-11-11 20:28:59.000000000 -0400
+@@ -2566,6 +2566,16 @@
+   report_textual_dates (&args);
+ }
++/* Debian specific environment variable used by pristine-tar to enable use of
++ * longlinks for filenames exactly 100 bytes long. */
++void debian_longlink_hack_init () {
++ char *s=getenv ("TAR_LONGLINK_100");
++ if (s && strcmp(s, "1") == 0)
++       debian_longlink_hack=1;
++ else
++       debian_longlink_hack=0;
++}
++
\f
+ /* Tar proper.  */
+@@ -2585,6 +2595,8 @@
+   filename_terminator = '\n';
+   set_quoting_style (0, DEFAULT_QUOTING_STYLE);
++  debian_longlink_hack_init ();
++
+   /* Make sure we have first three descriptors available */
+   stdopen ();
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..af084a4
--- /dev/null
@@ -0,0 +1 @@
+longlink-hack.diff
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)