[Dehs-devel] r175 - trunk

Raphael Geissert geissert at alioth.debian.org
Wed Nov 25 17:55:19 UTC 2009


Author: geissert
Date: 2009-11-25 17:55:19 +0000 (Wed, 25 Nov 2009)
New Revision: 175

Modified:
   trunk/dehs_pg.php
Log:
Add a workaround for the mutiple package versions on same Sources issue


Modified: trunk/dehs_pg.php
===================================================================
--- trunk/dehs_pg.php	2009-07-28 13:50:11 UTC (rev 174)
+++ trunk/dehs_pg.php	2009-11-25 17:55:19 UTC (rev 175)
@@ -185,6 +185,7 @@
     pg_exec($db, "CREATE UNIQUE INDEX idxbis on bin_atsrc (name,bin_name,dist)") or die_status('Error creating index on temp table bin_atsrc');
 
     foreach ($dists as $dist=>$sections) {
+        $pkgs = array();
         foreach ($sections as $section) {
             $filename=$dirs['sources_dir'] . "/$dist/$section/Sources.gz";
             print "\nI'm parsing $dist/$section => Sources.gz\n";
@@ -203,6 +204,10 @@
                         $buff1 .= $line;
                     }
                     if (preg_match($regexp,$buff1,$matches))  {
+                        if (isset($pkgs[$matches[1]]))
+                            continue;
+                        else
+                            $pkgs[$matches[1]] = 1;
                         if ($matches[5]) {
                             $matches[5]=iconv("ISO-8859-1","UTF-8",$matches[5]);
                             $matches[5]=pg_escape_string($matches[5]);




More information about the Dehs-devel mailing list