On Sat, 31 Jan 2009, Adrian Bunk wrote: > I just ran into this bug when using a modified tar that defaults to > create posix archives:
The simple work-around is to modify dpkg-deb to create tar archives used inside .deb with the option --format=gnu. Additionnaly, I think we should remove TAR_OPTIONS from the environment. Then the bug to support posix tar archive can again be wishlist. That could be even be done for lenny. Proposed patch is attached. I'd like to hear opinions from release managers and from Guillem. I tested the patch and it seems to work satisfactorily. Note about the patch: it's on purpose that I didn't tag the error string for translation, the error will never happen. Cheers, -- Raphaël Hertzog Le best-seller français mis à jour pour Debian Etch : http://www.ouaza.com/livre/admin-debian/
>From a0a9d389839fc2e0908682345dd42f45d11e238b Mon Sep 17 00:00:00 2001 From: Raphael Hertzog <hert...@debian.org> Date: Sun, 1 Feb 2009 10:38:49 +0100 Subject: [PATCH] dpkg-deb: produce GNU tar archive inside .deb * dpkg-deb/build.c: Ensure that data.tar and control.tar archives created inside a .deb use the GNU format that is compatible with dpkg itself. And remove TAR_OPTIONS from environment to avoid unexpected user customizations of the resulting archives. --- dpkg-deb/build.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index 8e854b2..6f13c32 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -344,12 +344,14 @@ void do_build(const char *const *argv) { if (setvbuf(ar, NULL, _IONBF, 0)) ohshite(_("unable to unbuffer `%.255s'"), debar); /* Fork a tar to package the control-section of the package */ + if (unsetenv("TAR_OPTIONS")) + ohshite("failed to remove environment variable TAR_OPTIONS"); m_pipe(p1); if (!(c1= m_fork())) { m_dup2(p1[1],1); close(p1[0]); close(p1[1]); if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory); if (chdir(BUILDCONTROLDIR)) ohshite(_("failed to chdir to .../DEBIAN")); - execlp(TAR, "tar", "-cf", "-", ".", NULL); + execlp(TAR, "tar", "--format=gnu", "-cf", "-", ".", NULL); ohshite(_("failed to exec tar -cf")); } close(p1[1]); @@ -422,7 +424,7 @@ void do_build(const char *const *argv) { m_dup2(p1[0],0); close(p1[0]); close(p1[1]); m_dup2(p2[1],1); close(p2[0]); close(p2[1]); if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory); - execlp(TAR, "tar", "-cf", "-", "--null", "-T", "-", "--no-recursion", NULL); + execlp(TAR, "tar", "-cf", "-", "--null", "-T", "-", "--no-recursion", "--format=gnu", NULL); ohshite(_("failed to exec tar -cf")); } close(p1[0]); -- 1.5.6.5