Browse Source

dpkg-deb: produce GNU tar archives 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.
Raphael Hertzog 17 years ago
parent
commit
4d1fe39cd9
3 changed files with 14 additions and 2 deletions
  1. 7 0
      ChangeLog
  2. 4 0
      debian/changelog
  3. 3 2
      dpkg-deb/build.c

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2008-02-02  Raphael Hertzog  <hertzog@debian.org>
+
+	* 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.
+
 2008-12-29  Guillem Jover  <guillem@debian.org>
 
 	* configure.ac: Bump version to 1.14.25~.

+ 4 - 0
debian/changelog

@@ -4,6 +4,10 @@ dpkg (1.14.25) UNRELEASED; urgency=low
   * Fix typo in package description ('privides' -> 'provides').
     Thanks to Pascal De Vuyst <pascal.devuyst@gmail.com>. Closes: #510755
 
+  [ Raphael Hertzog ]
+  * dpkg-deb now always produces GNU tarballs inside .deb and ignores
+    TAR_OPTIONS. Closes: #513863
+
   [ Updated dpkg translations ]
   * Basque (Piarres Beobide). Closes: #506092, #509851
   * Simplified Chinese (Deng Xiyue). Closes: #506177

+ 3 - 2
dpkg-deb/build.c

@@ -344,12 +344,13 @@ 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 */
+  unsetenv("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", "-cf", "-", "--format=gnu", ".", NULL);
     ohshite(_("failed to exec tar -cf"));
   }
   close(p1[1]);
@@ -422,7 +423,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", "-", "--format=gnu", "--null", "-T", "-", "--no-recursion", NULL);
     ohshite(_("failed to exec tar -cf"));
   }
   close(p1[0]);