aboutsummaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-04-21 16:01:16 +0200
committerMatěj Cepl <mcepl@redhat.com>2011-06-05 14:45:52 +0200
commit15c6a56eba1600ed23c29c6d769e49221fb000ce (patch)
treee2428c2dd53ef71bea83880fff04073cd175f1ee /data
parent197e98076352809946aabc2c8f042374f2af549e (diff)
downloadbugzilla-triage-15c6a56eba1600ed23c29c6d769e49221fb000ce.tar.gz
Fixing "Fixing Magic" for nvidia.
Diffstat (limited to 'data')
-rw-r--r--data/lib/rhbzpage.js38
1 files changed, 35 insertions, 3 deletions
diff --git a/data/lib/rhbzpage.js b/data/lib/rhbzpage.js
index d8f5727..e0c5cec 100644
--- a/data/lib/rhbzpage.js
+++ b/data/lib/rhbzpage.js
@@ -2,7 +2,7 @@
// http://www.opensource.org/licenses/mit-license.php
// Are we debugging?
-var debugFlag = true;
+var debugFlag = false;
// For identification of graphics card
var manuChipStrs = [ [ "ATI Radeon", "ATI", "1002" ],
@@ -220,9 +220,10 @@ function addCheckXorgLogLink(attList) {
*
* @param PCIidArrObj object with two fields
* id Array manufacturer-ID and product-ID (PCI IDs)
- * chipsetLine RE
+ * chipsetLine whole line containing PCI ID.
* @param driverStr String with the driver name
* @return None
+ *
*/
function fillInWhiteBoard(PCIidArrObj) {
var outStr = "";
@@ -231,7 +232,13 @@ function fillInWhiteBoard(PCIidArrObj) {
var cardName = "";
var PCIid = (PCIidArrObj.id[0] + "," + PCIidArrObj.id[1]).toUpperCase();
+ console.myDebug("PCIidArrObj = " + PCIidArrObj.toSource());
+ console.myDebug("PCIid = " + PCIid);
+
+ // Nvidia driver provides good code in the
if (PCIidArrObj.id[0].toLowerCase() == "10de") {
+ // The following is wrong ... chipsetLine is String, not an array
+ console.myDebug("fillInWhiteBoard: chipsetLine = " + PCIidArrObj.chipsetLine);
cardName = PCIidArrObj.chipsetLine[2].replace(/\s*nvidia\s*/ig,"").
replace('"','','g');
}
@@ -267,17 +274,34 @@ function fillInChipMagic(XlogID) {
analyzeXorgLog(XlogID, "AnalyzeInterestingLine");
}
+/**
+ * Creates a button to change summary by adding a graphic chip label
+ *
+ * @param Array with matching results of re.exec()
+ */
function chipsetMagic (interestingLineArr) {
// parse Xorg.0.log
+ var chipsetLine = "";
+ console.myDebug("interestingLineArr = " + interestingLineArr.toSource());
+ console.myDebug("interestingLineArr[1] = " + interestingLineArr[1]);
if (interestingLineArr.length >0) {
var interestingArray = interestingLineArr[0];
if (interestingArray.length > 1) {
var interestingPCIID = interestingArray[2].trim().split(":");
+ // If we have Chipset line, we should parse it as well and
+ // add to the button
+ if (interestingLineArr.length > 1) {
+ chipsetLine = interestingLineArr[1];
+ console.myDebug("chipsetLine = " + chipsetLine.toSource());
+ } else {
+ chipsetLine = null;
+ console.myDebug("chipsetLine = " + chipsetLine);
+ }
createNewButton("short_desc_nonedit_display", false, {
"name": "Fill In",
"chipMagic": {
"id": interestingPCIID,
- "chipsetLine": interestingLineArr[1]
+ "chipsetLine": chipsetLine
},
});
}
@@ -326,15 +350,23 @@ function findInterestingLine(wholeLog, backMsg) {
return new RegExp(reone);
});
}
+ console.myDebug("Current REs:");
+ REarr.forEach(function (re) {
+ console.myDebug("re: " + re.source);
+ });
+
var results = [];
wholeLog.split("\n").
forEach(function(line) {
REarr.forEach(function (re, reIdx) {
if (re.test(line)) {
+ console.myDebug("Found match on line:\n" + line);
+ console.myDebug("Result: " + re.exec(line).toSource());
results.push(re.exec(line));
}
});
});
+ console.myDebug("results = " + results.toSource());
logAnalyzeLogic[backMsg].func(results);
}