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

Rainer Meier r.meier at wpkg.org
Tue Oct 6 09:04:20 CEST 2009


Hi Simon,

simplesi wrote:
> and this is the bit that causes me problems
> 
> 
>> "	Note that each package which is requested to be removed (manually or by
>> \n" + 
>> "	a synchronization request) will be checked for its state by executing
>> its \n" + 
>> "	included package checks. If the package has been removed manually it
>> will \n" + 
>> "	also be removed from the settings database. Due to the fact that
>> packages \n" + 
>> "	whithout checks always return 'false' for during the install-status
>> check \n" + 
>> "	these packages will disappear from the local wpkg.xml. \n" + 
>> "\n" 
>>

I thought about this again and noticed that the documentation is actually
correct. WPKG was removing packages from the local settings file even in case of
/noremove flag usage in a very specific case. The case is, that if a package is
detected NOT to be installed any more on the system.
However WPKG always assumes that a package without checks is in state "not
installed" which made WPKG think that your packages have been removed manually
before since I ought to remember you said you don't use any checks.

I've changed the algorithm slightly to make the remove procedure think that a
package without checks is always assumed to be in "still installed correctly"
state. So WPKG will not remove it from the settings database any more.

Along with that change I have been able to fix a typo which most probably would
have lead to an exception and early termination in your special case.

Here is the change log:

FIX: Fixed package removal procedure in case /noremove flag is set. WPKG would
     have failed (exception thrown) in case /notemove was used and a package
     is detected NOT to be installed.
FIX: In case /noremove is used and the package does not define any checks WPKG
     is unable to detect if the package is still installed or not. Previously
     WPKG was assuming that the package is not installed and removed it from
     the local settings file. This has been changed. The package will now only
     be removed from the settings file if it defines some checks which allow
     WPKG to clearly detect that the package is not installed on the system.
     So if the package does not define any checks WPKG assumes it's still
     installed on the systme and does not remove its entry from the local
     settings file (wpkg.xml).

<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.1/wpkg.js?revision=117>

So now it should fit perfectly the use case you described in case you use the
/noremove flag.
As long as you're not using any checks WPKG will not remove anything from the
local settings file unless it is able to clearly detec that the software is not
installed any more (by checks). Since you don't use checks WPKG will never ever
remove this package from wpkg.xml as long as you use the /noremove flag.

Note: WPKG 1.1.3-RC2 is completely untested (I am on the road currently, no test
environment). So if it does not work I will fix it this evening ;-)
Feel free to try it on your site too.

Note2: I've updated the documentation too:



More information about the wpkg-users mailing list