[Bug 21] New: add /debug:<number> to intensify debug reporting

bugzilla-daemon at wpkg.org bugzilla-daemon at wpkg.org
Wed Mar 22 04:37:24 CET 2006


Please reply using this URL only: http://bugs.wpkg.org/show_bug.cgi?id=21

           Summary: add /debug:<number> to intensify debug reporting
           Product: WPKG
           Version: 0.9.6-test2
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: wpkg.js
        AssignedTo: mangoo at mch.one.pl
        ReportedBy: bill at shirleyfamily.net
         QAContact: wpkg-users at lists.wpkg.org


Modify /debug to accept /debug:<number> to enable selective debug reporting
patch included
test with:
cscript \\server\locationOfWPKG\wpkg.js /synchronize /dryrun /debug:3
and
cscript \\server\locationOfWPKG\wpkg.js /synchronize /dryrun /debug:8

notice more debugging info in scanUninstallKeys routine @ /debug:8 

patch (beware of the line wraps imposed by this form):
--- orig.wpkg.js        2006-03-14 13:36:00.000000000 -0500
+++ wpkg.js     2006-03-21 22:06:12.000000000 -0500
@@ -63,6 +63,9 @@
  * /verbose
  *     Prints some debugging info.
  *
+ * /debug:<number>
+ *     Prints debugging info. The higher the number, more info is printed.
+ *
  * /dryrun
  *     Does not execute any action. Assumes /debug on.
  *
@@ -82,6 +85,7 @@
 var forceInstall; // forces instalation over existing packages
 
 var debug;  
+var debugNum;     // number after the : in /debug:<number>
 var dryrun;
 
 var quiet;
@@ -156,9 +160,14 @@
     // process property named arguments that set values
     if (isArgSet(argv, "/debug") || isArgSet(argv, "/verbose")) {
         debug = true;
+        debugNum = 1;
     } else {
         debug = false;
     }  
+    if (argn("debug") != null) {
+        debugNum = argn("debug").slice(0);
+        info("Debug=" + debugNum);
+    }
     
     // process property named arguments that set values
     if (isArgSet(argv, "/dryrun")) {
@@ -875,6 +884,7 @@
     var dName;
     try
     {  
+if (debugMe(3)) info("scanUninstallKeys searching for=/" + nameSearched + "/");
         oLoc = new ActiveXObject("WbemScripting.SWbemLocator");
         oSvc = oLoc.ConnectServer(null, "root\\default");
         oReg = oSvc.Get("StdRegProv");
@@ -892,6 +902,7 @@
             dName = getRegistryValue("HKLM\\" + sRegPath + "\\" + aNames[i] +
"\\DisplayName");
 
             if (null != dName) {
+               if (debugMe(7)) info("scanUninstallKeys found=/" + dName + "/");
                 if (dName == nameSearched) {
                     return true;
                 }
@@ -2288,3 +2299,13 @@
     info(message);   
 }
  
+/**
+ * Return true of false according to debug setting
+ */
+function debugMe(debugLvl) {
+    if (debugLvl <= debugNum) {
+        return true;
+    } else {
+        return false;
+    }
+}

-- 
Configure bugmail: http://bugs.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wpkg-users mailing list