+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
--- /dev/null
+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 ();
+