[Dehs-devel] r116 - in trunk: . tpls

atomo64-guest at alioth.debian.org atomo64-guest at alioth.debian.org
Sun Mar 2 23:14:02 UTC 2008


Author: atomo64-guest
Date: 2008-03-02 23:14:01 +0000 (Sun, 02 Mar 2008)
New Revision: 116

Modified:
   trunk/dehs_pg.php
   trunk/tpls/new_version.mail.tpl
Log:


Modified: trunk/dehs_pg.php
===================================================================
--- trunk/dehs_pg.php	2008-03-01 21:28:42 UTC (rev 115)
+++ trunk/dehs_pg.php	2008-03-02 23:14:01 UTC (rev 116)
@@ -319,7 +319,7 @@
     # 183dea9ca3c2e35ffd6cf5eee9501c21          2941637 main/binary-i386/Packages.gz
 }
 
-function vers_conv($debvers) {
+function vers_conv($debvers, $extendedConv) {
     // Strip off the epoch
     $pos = strpos($debvers, ':');
     if ( $pos !== FALSE) {
@@ -332,8 +332,11 @@
         $debvers = substr($debvers, 0, $pos);
     }
 
-    // strip off repacking indicators
-    $debvers = preg_replace("/[-.+~]?(ds|dfsg|debian)(.*)/i", "", $debvers);
+    if ($extendedConv) {
+        // strip off repacking indicators
+        $debvers = preg_replace("/[-.+~]?(ds|dfsg|debian)(.*)/i", "", $debvers);
+    }
+
     return $debvers;
 }
 function check_db() {
@@ -352,7 +355,7 @@
     }
     if (!pg_table_exists($db, "events")) {
         pg_exec($db, "CREATE TABLE events (id serial PRIMARY KEY, name text,type text, dist text, stamp timestamp, content text)") or die_status('Error creating table binpkgs\n');
-        pg_exec($db, "CREATE UNIQUE INDEX idxevents on events (name,dist)") or die_status('Errore creating index - ' . pg_last_error($db));
+        pg_exec($db, "CREATE UNIQUE INDEX idxevents on events (name,dist,content)") or die_status('Errore creating index - ' . pg_last_error($db));
         pg_exec($db, "CREATE INDEX pkgxeventtype on events (name,type,dist)") or die_status('Errore creating index - ' . pg_last_error($db));
         $sw=true;
     }
@@ -449,10 +452,16 @@
 function is_updated ($up_vers,$debian_vers, $dversionAsIs = false) {
     if ($up_vers=='') return 1;
 
+    $extendedConv = true;
+
     if ($up_vers === $debian_vers) $dversionAsIs = true;
 
-    passthru("dpkg --compare-versions '".escapeshellarg($up_vers)."' le '" . escapeshellarg($dversionAsIs?$debian_vers:vers_conv($debian_vers)) . "'",$great);
+    if (strpos(strtolower($up_vers), 'dfsg') !== false && strpos(strtolower($debian_vers), 'dfsg') !== false) {
+        $extendedConv = false;
+    }
 
+    passthru("dpkg --compare-versions '".escapeshellarg($up_vers)."' le '" . escapeshellarg($dversionAsIs?$debian_vers:vers_conv($debian_vers, $extendedConv)) . "'",$great);
+
     return (int)!($great);
 }
 function db_upstream($initial='%', $checkStamps = false, $limit = null) {
@@ -492,6 +501,9 @@
             $mangle = false;
         }
 
+        $up_url=iconv("ISO-8859-1","UTF-8",$uscan_res[2]);
+        $up_version=iconv("ISO-8859-1","UTF-8",$uscan_res[0]);
+
         $updated = $uscan_res[4];
 
         /*if (!$updated)*/ {
@@ -499,7 +511,7 @@
         }
 
         if (!$updated) {
-            events::newVersion($res_array['name'], $res_array['version'], $uscan_res[0], $res_array['dist']);
+            events::newVersion($res_array['name'], $res_array['version'], $uscan_res[0], $res_array['dist'], $up_url);
         } else {
             $lastupvsdebsync = sqldate();
         }
@@ -511,9 +523,6 @@
         if ($uscan_res[0]!=$res_array[up_version]) ($keep_changes=1);
         else $keep_changes=0;
 
-        $up_url=iconv("ISO-8859-1","UTF-8",$uscan_res[2]);
-        $up_version=iconv("ISO-8859-1","UTF-8",$uscan_res[0]);
-
         $watch_warn='';
         if($uscan_res[1] != null) {
             $watch_warn=pg_escape_string(iconv("ISO-8859-1","UTF-8", $uscan_res[1]));

Modified: trunk/tpls/new_version.mail.tpl
===================================================================
--- trunk/tpls/new_version.mail.tpl	2008-03-01 21:28:42 UTC (rev 115)
+++ trunk/tpls/new_version.mail.tpl	2008-03-02 23:14:01 UTC (rev 116)
@@ -10,6 +10,9 @@
 If you are the maintainer or a co-maintainer of the package
  please consider updating the package.
 
+According to the watch file the tarball can be found at:
+#LINK#
+
 For more information please refer to the DEHS report of #PACKAGE# at:
 http://dehs.alioth.debian.org/maintainer.php?name=#PACKAGE#
 




More information about the Dehs-devel mailing list