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

           Summary: execute=always packages get added to the wpkg.xml file
                    on every run
           Product: WPKG
           Version: 0.9.2-test1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P3
         Component: wpkg.js
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
         QAContact: [email protected]


When a package is tagged as execute=always, it will be appended to the wpkg.xml
(settings file) everytime it gets executed. IMHO this is not like intended as a
execute=always package won't change from run to run and the entries in wpkg.xml
will be just duplicates of the others runs. 

I've made a patch wich works nice for me to avoid this, by just searching in the
settings for the given package-id and removing it if found before appending the
new entry. Here is the udiff to 0.9.2-test1:

--- wpkg_orig.js    Wed Nov 30 23:13:48 2005
+++ wpkg.js     Tue Jan 17 15:03:28 2006
@@ -1025,6 +1025,7 @@
  */
 function executeOnce(packageNode) {
     var packageName = packageNode.getAttribute("name");
+    var packageId = packageNode.getAttribute("id");
     
     info("Executing commands for " + packageName + "...");
         
@@ -1084,7 +1085,15 @@
                 e.description);       
         }
     }
-    
+
+    // check for old node and remove it if there, to avoid duplicate setttings
+    // file entries when execution=always
+    var nodeOld = settings.selectSingleNode("[EMAIL PROTECTED]'" + packageId + 
"']");
+    if (nodeOld != null) {
+       info("Replacing settings entry " + packageName);
+       settings.removeChild(nodeOld);
+    }
+
     // append new node to local xml
     settings.appendChild(packageNode);
     saveXml(settings, settings_file);

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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
wpkg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wpkg-users

Reply via email to