[wpkg-users] [Bug 13] New: execute=always packages get added to the wpkg.xml file on every run

bugzilla-daemon at wpkg.org bugzilla-daemon at wpkg.org
Tue Jan 17 15:20:36 CET 2006


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: mangoo at mch.one.pl
        ReportedBy: ai at bsdler.de
         QAContact: wpkg-users at lists.wpkg.org


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("package[@id='" + 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.



wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users




More information about the wpkg-users mailing list