[Dehs-devel] r92 - trunk
atomo64-guest at alioth.debian.org
atomo64-guest at alioth.debian.org
Fri Jan 4 21:57:27 UTC 2008
Author: atomo64-guest
Date: 2008-01-04 21:57:27 +0000 (Fri, 04 Jan 2008)
New Revision: 92
Modified:
trunk/dehs_pg.php
Log:
Added a hack so the dversionmangled field isn't set back to 'version' on Sources update
Modified: trunk/dehs_pg.php
===================================================================
--- trunk/dehs_pg.php 2008-01-03 21:36:32 UTC (rev 91)
+++ trunk/dehs_pg.php 2008-01-04 21:57:27 UTC (rev 92)
@@ -209,7 +209,17 @@
@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]')") ;
if (!$rst) {
- $rst=@pg_exec($db, "UPDATE pkgs SET name='$matches[1]',version='$matches[4]',dversionmangled='$matches[4]',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");
+ $rsql=pg_exec($db, "SELECT pkgs.version FROM pkgs WHERE name='$matches[1]' AND dist='$dist';");
+ $version = $matches[4]; // just for safety
+ while ($res_array=pg_fetch_array($rsql)) {
+ $version = $res_array['version'];
+ }
+ $extra = '';
+ if ($version != $matches[4]) {
+ // only update the dversionmangled field if the versions differ
+ $extra = ",dversionmangled='$matches[4]'";
+ }
+ $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");
}
$bin_names=split(",", $matches[2]);
foreach ($bin_names as $bin_name) {
More information about the Dehs-devel
mailing list