[Dehs-devel] r128 - trunk

atomo64-guest at alioth.debian.org atomo64-guest at alioth.debian.org
Sat Apr 12 20:42:39 UTC 2008


Author: atomo64-guest
Date: 2008-04-12 20:42:37 +0000 (Sat, 12 Apr 2008)
New Revision: 128

Modified:
   trunk/dehs_pg.php
Log:
Strict the md5sum size to 32, which is the correct lenght used
Also attempt to parse the Homepage, and Vcs-* entries (eating, when present: Dm-Upload-Allowed, 
and Checksums-*)


Modified: trunk/dehs_pg.php
===================================================================
--- trunk/dehs_pg.php	2008-04-12 20:22:03 UTC (rev 127)
+++ trunk/dehs_pg.php	2008-04-12 20:42:37 UTC (rev 128)
@@ -185,7 +185,7 @@
             $filename=$dirs['sources_dir'] . "/$dist/$section/Sources.gz";
             print "\nI'm parsing $dist/$section => Sources.gz\n";
             # 1 Pacchetto - 2 versione - 3 np - 4 Directory - 5 md5
-            $regexp="/Package:\s($initial.*)[^a]Binary:\s(.+)[^a]Version:\s(\d+:)?(.+)[^a]Priority.+Maintainer:.+<([^>]+)>[^a].+Directory:\s(.+)[^a]Files:.+\s(\S{33})\s(\d+)\s" . '\1\S+' . "\.diff\.gz[^a](Uploaders:\s(.+)[^a])?/Ssi";
+            $regexp="/Package:\s($initial.*)[^a]Binary:\s(.+)[^a]Version:\s(\d+:)?(.+)[^a]Priority.+Maintainer:.+<([^>]+)>[^a].+Directory:\s(.+)[^a]Files:.+\s(\S{32})\s(\d+)\s" . '\1\S+' . "\.diff\.gz[^a](Uploaders:\s(.+)[^a])?(Dm-Upload-Allowed:\s(.+)[^a])?(Homepage:\s(.+)[^a])?(Vcs-Browser:\s(.+)[^a])?(Vcs-([A-Z][a-z]+)):\s(.+)[^a])?(Checksums-\S+:\s(.+)[^a])?/Ssi";
             $zp = gzopen($filename, "r") or die_status("Could not open $filename");
             $extracted=tempnam("/tmp/", "$dist_$section_Sources");
             exec("gzip -c -d $filename > $extracted");
@@ -208,7 +208,7 @@
                             $matches[10]=pg_escape_string($matches[10]);
                         }
                         @pg_exec($db,"INSERT INTO pkgs_atsrc (name,dist) VALUES ('$matches[1]','$dist')") OR die_status("Temp table pkgs_atsrc query error");
-                        $rst=@pg_exec($db, "INSERT INTO pkgs (name,version,dversionmangled,maint,dir,md5_atsource,bytes,dist,section,uploaders) VALUES ('$matches[1]','$matches[4]','$matches[4]','$matches[5]','$matches[6]','$matches[7]','$matches[8]','$dist','$section','$matches[10]')");
+                        $rst=@pg_exec($db, "INSERT INTO pkgs (name,version,dversionmangled,maint,dir,md5_atsource,bytes,dist,section,uploaders,homepage,vcs_browser,vcs_type,vcs) VALUES ('$matches[1]','$matches[4]','$matches[4]','$matches[5]','$matches[6]','$matches[7]','$matches[8]','$dist','$section','$matches[10]','$matches[14]','$matches[16]','$matches[18]','$matches[19]')");
                         if (!$rst) {
                             $rsql=pg_exec($db, "SELECT pkgs.version FROM pkgs WHERE name='$matches[1]' AND dist='$dist';");
                             $version = $matches[4]; // just for safety
@@ -222,7 +222,7 @@
                                 // and reset wwiz_type
                                 $extra = ",wwiz_type=NULL";
                             }
-                            $rst=@pg_exec($db, "UPDATE pkgs SET name='$matches[1]',version='$matches[4]'$extra,maint='$matches[5]',dir='$matches[6]',md5_atsource='$matches[7]',bytes='$matches[8]',dist='$dist',section='$section',uploaders='$matches[10]' WHERE name='$matches[1]' AND dist='$dist'") OR die_status("\nDb adding error =>" . pg_last_error() . "\n");
+                            $rst=@pg_exec($db, "UPDATE pkgs SET name='$matches[1]',version='$matches[4]'$extra,maint='$matches[5]',dir='$matches[6]',md5_atsource='$matches[7]',bytes='$matches[8]',dist='$dist',section='$section',uploaders='$matches[10]',homepage='$matches[14]',vcs_browser='$matches[16]',vcs_type='$matches[18]',vcs='$matches[19]' WHERE name='$matches[1]' AND dist='$dist'") OR die_status("\nDb adding error =>" . pg_last_error() . "\n");
                         }
                         $bin_names=split(",", $matches[2]);
                         foreach ($bin_names as $bin_name) {




More information about the Dehs-devel mailing list