]> err.no Git - dpkg/commitdiff
Fix dpkg-deb to be able to handle archives made with Linux ar
authorWichert Akkerman <wakkerma@debian.org>
Mon, 11 Oct 1999 02:11:58 +0000 (02:11 +0000)
committerWichert Akkerman <wakkerma@debian.org>
Mon, 11 Oct 1999 02:11:58 +0000 (02:11 +0000)
ChangeLog
dpkg-deb/dpkg-deb.h
dpkg-deb/extract.c

index 10c78baed38de13e1c81585251a975198bc35671..74b95a1ce1ab0f6669ede2842cfdf2c57a0eb90e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Oct 11 02:13:15 CEST 1999 Wichert Akkerman <wakkerma@debian.org>
+
+  * Merge patch from Ben Collins <bcollins@debian.org> to make dpkg-deb
+    handle packages created with Linux ar.
+
 Thu Oct  7 01:16:23 CEST 1999 Wichert Akkerman <wakkerma@debian.org>
 
   * Check if codenumber is between 0 and 99 instead of just checking
index 946e823ce6477ee617053fc110fac1f4b35a1ce7..e48e29e237c94355333799c20e120fb56cc45a5a 100644 (file)
@@ -34,7 +34,9 @@ void extracthalf(const char *debar, const char *directory,
                  const char *taroption, int admininfo);
 
 #define DEBMAGIC     "!<arch>\ndebian-binary   "
-#define ADMINMEMBER  "control.tar.gz  "
-#define DATAMEMBER   "data.tar.gz     "
+#define ADMINMEMBER            "control.tar.gz  "
+#define ADMINMEMBER_COMPAT     "control.tar.gz/ "
+#define DATAMEMBER             "data.tar.gz     "
+#define DATAMEMBER_COMPAT      "data.tar.gz/    "
 
 #endif /* DPKG_DEB_H */
index 7f080a8d08ccb105ea17a60646b5c3bdfec38f4e..b063bf0d18636d5bfd65f0ccaa07fe6cfe54cf6a 100644 (file)
@@ -125,7 +125,8 @@ void extracthalf(const char *debar, const char *directory,
       if (memberlen<0)
         ohshit(_("file `%.250s' is corrupt - negative member length %ld"),debar,memberlen);
       if (!header_done) {
-        if (memcmp(arh.ar_name,"debian-binary   ",sizeof(arh.ar_name)))
+        if (memcmp(arh.ar_name,"debian-binary   ",sizeof(arh.ar_name)) &&
+           memcmp(arh.ar_name,"debian-binary/   ",sizeof(arh.ar_name)))
           ohshit(_("file `%.250s' is not a debian binary archive (try dpkg-split?)"),debar);
         infobuf= m_malloc(memberlen+1);
         if (fread(infobuf,1, memberlen + (memberlen&1), ar) != memberlen + (memberlen&1))
@@ -150,8 +151,10 @@ void extracthalf(const char *debar, const char *directory,
         skipmember(ar,debar,memberlen);
       } else {
         adminmember=
-          !memcmp(arh.ar_name,ADMINMEMBER,sizeof(arh.ar_name)) ? 1 :
-          !memcmp(arh.ar_name,DATAMEMBER,sizeof(arh.ar_name)) ? 0 :
+          (!memcmp(arh.ar_name,ADMINMEMBER,sizeof(arh.ar_name)) ||
+         !memcmp(arh.ar_name,ADMINMEMBER_COMPAT,sizeof(arh.ar_name))) ? 1 :
+          (!memcmp(arh.ar_name,DATAMEMBER,sizeof(arh.ar_name)) ||
+         !memcmp(arh.ar_name,DATAMEMBER_COMPAT,sizeof(arh.ar_name))) ? 0 :
           -1;
         if (adminmember == -1) {
           ohshit(_("file `%.250s' contains ununderstood data member %.*s, giving up"),