[Dehs-devel] r182 - trunk

Raphael Geissert geissert at alioth.debian.org
Thu Feb 4 01:24:48 UTC 2010


Author: geissert
Date: 2010-02-04 01:24:48 +0000 (Thu, 04 Feb 2010)
New Revision: 182

Modified:
   trunk/dehs_pg.php
Log:
Add support for bzip2-compressed 3.0 source packages


Modified: trunk/dehs_pg.php
===================================================================
--- trunk/dehs_pg.php	2010-02-02 00:47:30 UTC (rev 181)
+++ trunk/dehs_pg.php	2010-02-04 01:24:48 UTC (rev 182)
@@ -112,9 +112,9 @@
             }
         }
     }
-    elseif (substr($file,-14) == ".debian.tar.gz") {
+    elseif (preg_match('/\.debian\.tar\.(gz|bz2)$/', $file, $matches)) {
         // Format 3.0 (*)
-        $AT = new Archive_Tar($file,'gz');
+        $AT = new Archive_Tar($file,$matches[1]);
         $watch = $AT->extractInString('debian/watch');
     }
     if ($watch!=null) return $watch;
@@ -168,7 +168,7 @@
 }
 function download_diff(&$conn_id,$pkg,$version,$directory,$md5_diff,$md5_atsource,$diff_kb,$dist) {
     global $dirs,$mirrors;
-    $diffTypes = array(".diff.gz",".debian.tar.gz");
+    $diffTypes = array(".diff.gz",".debian.tar.gz",".debian.tar.bz2");
     foreach($diffTypes as $diffType) {
         $localfile=$dirs[diffs_dir] . "/$pkg" . "_" . $version . $diffType;
         $remotefile="/debian/$directory/$pkg" . "_" . "$version" . $diffType;
@@ -219,10 +219,10 @@
             $regexp .= "Format:\s(.+)[^a]";
             // [7]  : Package directory
             $regexp .= "Directory:\s(.+)[^a]";
-            // [8]  : md5sum of the .diff.gz (or .debian.tar.gz)
+            // [8]  : md5sum of the .diff.gz (or .debian.tar.(gz|bz2))
             // [9]  : Size of the file in bytes
             // [10] : Extension (.diff.gz or .debian.tar.gz)
-            $regexp .= "Files:.+\s(\S{32})\s(\d+)\s" . '\1\S+' . "(\.diff\.gz|\.debian\.tar\.gz)[^a]";
+            $regexp .= "Files:.+\s(\S{32})\s(\d+)\s" . '\1\S+' . "(\.diff\.gz|\.debian\.tar\.(?:gz|bz2))[^a]";
             // [11] : Uploaders field
             // [12] : Uploaders value
             $regexp .= "(Uploaders:\s(.+)[^a])?";




More information about the Dehs-devel mailing list