From 67e54bc93cd1b1fec06789f62084ad3aef5d58d9 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Fri, 12 Nov 2010 02:22:49 -0700 Subject: [PATCH] patch from joeyh to hack around removal of the src/create.c patch concerning 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 | 11 +++++ debian/patches/longlink-hack.diff | 68 +++++++++++++++++++++++++++++++ debian/patches/series | 1 + debian/source/format | 1 + 4 files changed, 81 insertions(+) create mode 100644 debian/patches/longlink-hack.diff create mode 100644 debian/patches/series create mode 100644 debian/source/format diff --git a/debian/changelog b/debian/changelog index 28792cd5..78372b57 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 index 00000000..7163e47f --- /dev/null +++ b/debian/patches/longlink-hack.diff @@ -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 + ++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; ++} ++ + + /* 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 index 00000000..af084a44 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +longlink-hack.diff diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) -- 2.30.2