[csw-devel] SF.net SVN: gar:[17411] csw/mgar/gar/v2/lib/python/package_checks.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Thu Mar 15 11:49:57 CET 2012


Revision: 17411
          http://gar.svn.sourceforge.net/gar/?rev=17411&view=rev
Author:   wahwah
Date:     2012-03-15 10:49:56 +0000 (Thu, 15 Mar 2012)
Log Message:
-----------
checkpkg: Cope with unknown machine IDs

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/package_checks.py

Modified: csw/mgar/gar/v2/lib/python/package_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks.py	2012-03-15 09:24:09 UTC (rev 17410)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2012-03-15 10:49:56 UTC (rev 17411)
@@ -951,7 +951,15 @@
     if "machine_id" not in metadata:
       continue
     logger.debug("CheckArchitecture(): %s", metadata)
-    machine_data = HACHOIR_MACHINES[metadata["machine_id"]]
+    machine_id = metadata["machine_id"]
+    if machine_id not in HACHOIR_MACHINES:
+      error_mgr.ReportError(
+          "binary-architecture-unknown",
+          "file=%s arch_id=%s" % (
+            metadata["path"],
+            metadata["machine_id"]))
+      continue
+    machine_data = HACHOIR_MACHINES[machine_id]
     cpu_type = machine_data["name"]
     # allowed_paths needs to depend on the OS release. The OS release is
     # only available from the file name.
@@ -967,7 +975,7 @@
           "binary-architecture-does-not-match-placement",
           "file=%s arch_id=%s arch_name=%s" % (
             metadata["path"],
-            metadata["machine_id"],
+            machine_id,
             cpu_type))
       messenger.OneTimeMessage(
           "binary-placement",
@@ -988,7 +996,7 @@
           "binary-disallowed-placement",
           "file=%s arch_id=%s arch_name=%s bad_path=%s" % (
             metadata["path"],
-            metadata["machine_id"],
+            machine_id,
             cpu_type,
             bad_path))
         messenger.Message(

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list