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

simplesi siwalters at hotmail.com
Sun Oct 4 22:35:05 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


-- 
View this message in context: http://www.nabble.com/-Bug-175--New%3A-Test-return-value-of-removeSettingsNode-function-tp25737803p25741942.html
Sent from the WPKG - Users mailing list archive at Nabble.com.




More information about the wpkg-users mailing list