Tags 863061 +patch
Thanks

After some more hacking I got a fix that works. It seems that the "ar" code 
doesn't support reading a member more than once, so it is necessary to retry the whole 
process in uncompressed mode rather than just retrying reading the data member.

Debdiff attatched, no intent to NMU.

diff -Nru reprepro-5.1.1/debian/changelog reprepro-5.1.1/debian/changelog
--- reprepro-5.1.1/debian/changelog     2017-01-08 12:21:09.000000000 +0000
+++ reprepro-5.1.1/debian/changelog     2017-05-21 03:27:45.000000000 +0000
@@ -1,3 +1,10 @@
+reprepro (5.1.1-1~bpo8+1+test) UNRELEASED; urgency=medium
+
+  * If data tar extraction fails try again as uncompressed.
+    Some packages have an uncompressed data.tar.gz 
+
+ -- root <r...@bytemark2017.raspbian.org>  Sun, 21 May 2017 03:07:25 +0000
+
 reprepro (5.1.1-1~bpo8+1) jessie-backports; urgency=medium
 
   * Rebuild for jessie-backports.
diff -Nru reprepro-5.1.1/debian/patches/series 
reprepro-5.1.1/debian/patches/series
--- reprepro-5.1.1/debian/patches/series        1970-01-01 00:00:00.000000000 
+0000
+++ reprepro-5.1.1/debian/patches/series        2017-05-21 03:09:07.000000000 
+0000
@@ -0,0 +1 @@
+uncompression.diff
diff -Nru reprepro-5.1.1/debian/patches/uncompression.diff 
reprepro-5.1.1/debian/patches/uncompression.diff
--- reprepro-5.1.1/debian/patches/uncompression.diff    1970-01-01 
00:00:00.000000000 +0000
+++ reprepro-5.1.1/debian/patches/uncompression.diff    2017-05-21 
12:51:43.000000000 +0000
@@ -0,0 +1,43 @@
+ If data tar extraction fails try again as uncompressed.
+    Some packages have an uncompressed data.tar.gz.
+
+Index: reprepro-5.1.1/debfilecontents.c
+===================================================================
+--- reprepro-5.1.1.orig/debfilecontents.c
++++ reprepro-5.1.1/debfilecontents.c
+@@ -137,8 +137,10 @@ static retvalue read_data_tar(/*@out@*/c
+ retvalue getfilelist(/*@out@*/char **filelist, size_t *size, const char 
*debfile) {
+       struct ar_archive *ar;
+       retvalue r;
+-      bool hadcandidate = false;
+-
++      bool hadcandidate;
++      bool uncompressedretry = false;
++      retrylabel:
++      hadcandidate = false;
+       r = ar_open(&ar, debfile);
+       if (RET_WAS_ERROR(r))
+               return r;
+@@ -163,6 +165,7 @@ retvalue getfilelist(/*@out@*/char **fil
+                               free(filename);
+                               continue;
+                       }
++                      if (uncompressedretry) c = c_none;
+                       ar_archivemember_setcompression(ar, c);
+                       if (uncompression_supported(c)) {
+                               struct archive *tar;
+@@ -194,7 +197,13 @@ retvalue getfilelist(/*@out@*/char **fil
+                               if (r != RET_NOTHING) {
+                                       ar_close(ar);
+                                       free(filename);
+-                                      return r;
++                                      if ((r == RET_ERROR) && 
(!uncompressedretry)) {
++                                              uncompressedretry = true;
++                                              fprintf(stderr,"retrying 
uncompressed\n");
++                                              goto retrylabel;
++                                      } else {
++                                              return r;
++                                      }
+                               }
+ 
+                       }

Reply via email to