[Lsb-messages] /var/www/bzr/lsb/devel/dbadmin r266: Use history fields from Architecture table instead of hardcoded values

Denis Silakov denis.silakov at rosalab.ru
Mon Oct 8 08:12:43 UTC 2012


------------------------------------------------------------
revno: 266
committer: Denis Silakov <denis.silakov at rosalab.ru>
branch nick: dbadmin
timestamp: Mon 2012-10-08 12:12:43 +0400
message:
  Use history fields from Architecture table instead of hardcoded values
modified:
  status.inc
-------------- next part --------------
=== modified file 'status.inc'
--- a/status.inc	2012-09-12 11:46:45 +0000
+++ b/status.inc	2012-10-08 08:12:43 +0000
@@ -8,20 +8,8 @@
  */
 function is_new_arch($ver, $arch)
 {
-    if( $ver == '1.0' ) {
-        return true;
-    }
-    else if( $ver == '1.2' && ( $arch == 6 ) ) {
-        return true;
-    }
-    else if( $ver == '1.3' && ( $arch == 3 || $arch == 10 || $arch == 12 ) ) {
-        return true;
-    }
-    else if( $ver == '2.0' && ( $arch == 9 || $arch == 11 ) ) {
-        return true;
-    }
-
-    return false;
+    $app_ver = Query_value("SELECT Aappearedin FROM Architecture WHERE Aid=$arch");
+    return ($app_ver == $ver);
 }
 
 /*
@@ -29,17 +17,14 @@
  */
 function fill_arch_array($ver)
 {
-    if( ($ver == '1.0') || ($ver == '1.1') ) {
-        $arch_list = array(1,2);
-    }
-    else if( $ver == '1.2' ) {
-        $arch_list = array(1,2,6);
-    }
-    else if( $ver == '1.3' ) {
-        $arch_list = array(1,2,6,3,10,12);
-    }
-    else {
-        $arch_list = array(1,2,6,3,10,12,9,11);
+    $query="SELECT Aid FROM Architecture 
+            WHERE Aappearedin > '' AND Aappearedin <= '$ver'
+            AND (Awithdrawnin IS NULL OR Awithdrawnin > '$ver')";
+    $res=Query($query);
+
+    $arch_list = array();
+    foreach($res as $row) {
+        $arch_list[] = $row['Aid'];
     }
 
     return $arch_list;



More information about the lsb-messages mailing list