[wpkg-users] [Bug 175] Test return value of removeSettingsNode function

Chris Wilcox not_rich_yet at hotmail.com
Mon Oct 5 09:53:00 CEST 2009


> 
> 
> Starting from the beginning again :)
> 
> I adminster several small school networks and use wpkg to deploy packages to
> several machines if it is quicker to use wpkg than to go around all
> computers and do a manual install.
> 
> I want to be able to test a new package out or a modified one on an existing
> live system.
> 
> I do this by trying to allocate/modify a package on one computer.
> 
> In practice, I have found this difficult to achieve this cleanly without
> breaking something sometimes :(
> 
> Currently, WPKG will remove a package entry from WPKG.xml if it decides that
> the package is no longer required for that computer.
> 
> Even with the two exisiting flags (noremove and noforced remove) WPKG will
> still remove the package entry from WPKG.xml under certain circumstances.
> 
> If a mistake is made, and then later rectified, then WPKG thinks it hasn't
> installed a package and attempts re-install.
> 
> IF I programmed a package with checks - I could probably work around this
> but I don't. I don't use checks and I dont use remove commands. I just have
> an install command to install and an update command to update -very simple
> :)
> 
> If I could have a flag to stop WPKG from removing package entries, then when
> my mistake is rectified, wpkg would not attempt a re-install.
> 
> Its that simple :)
> 
> I don't use WPKG to keep track of everything on my network - I just use it
> if it might save me time and effort.
> 
> Obviously if I had a separate testing setup, virtual/real testing machines
> or didn't make mistooks then I wouldn't have a problem - but I dont have
> these and therefore I have a problem :)
> 
> regards
> 
> Simon
> PS
> Just for reference my basic code change proposal is
> 
> function removeSettingsNodeSW(packageNode, saveImmediately) {
> // sw modified to stop removal if no remove instructions found
> if (getPackageCmdRemove(packageNode).length > 0) {
> // make sure the settigngs node is selected
> var packageID = getPackageID(packageNode);
> dinfo("Removing package id '" + packageID + "' from settings.");
> var settingsNode = getSettingNode(packageID);
> var success = false;
> if(settingsNode != null) {
> success = removeNode(getSettings(), settingsNode);
> }
> // save settings if remove was successful
> if (success && saveImmediately) {
> saveSettings();
> }
> return success;
> } else {
> var packageID = getPackageID(packageNode);
> dinfo("package id '" + packageID + "' not removed as no remove
> instructions found.");
> var success = false;
> return success;
> }
> 
> }
> 
> and then the calling code should check the return success value

 

I also use WPKG across 16 schools.  One of the first things I did when trialling and now using wpkg live was dredge out an old and unused PC capable of running XP Pro and set this up as a test workstation for wpkg packages before I roll things out to the live networks.

 

If you don't ever want wpkg to remove an entry from the local wpkg.xml file then just leave the entry in the profile.xml.
 		 	   		  
_________________________________________________________________
View your other email accounts from your Hotmail inbox. Add them now.
http://clk.atdmt.com/UKM/go/167688463/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20091005/6f40a31b/attachment.html>


More information about the wpkg-users mailing list