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-04-21 16:02:12 +0200
commitbf9f8023e823a0bac6ce66744f94c7e077e446f1 (patch)
tree0ebaf1d76f113647060781f28fbdd116e3ef1190 /data
parent400ba1a166ca82acc9c2f645a2faa6781c60180f (diff)
downloadbugzilla-triage-bf9f8023e823a0bac6ce66744f94c7e077e446f1.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 2e6cf3d..3cffbb9 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" ],
@@ -218,9 +218,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 = "";
@@ -229,7 +230,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');
}
@@ -265,17 +272,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
},
});
}
@@ -324,15 +348,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);
}