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

2009-10-07 Thread simplesi


Rainer Meier wrote:
 
 Hi Simon,
 
 Well this warning is justified I think because this is a profile/package
 inconsistency where the administrator schould have a look at
 ...
 
 Regarding the fact of profile inconsistency I prefer to send at least a
 warning-level notification to the administrator.
 
 
No problem - just letting you know what it did :)

regards

Simon

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

-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


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

2009-10-06 Thread Rainer Meier
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:
-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


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

2009-10-05 Thread Chris Wilcox

 
 
 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/-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


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

2009-10-05 Thread simplesi


Chris Wilcox wrote:
 
 
 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.
 
:) 
I know all the workarounds - I'm trying to not have to do them as none are
the same as the real world :)

regards

Simon


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

-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


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

2009-10-04 Thread simplesi

I hadn't realised that WPKG removed an wpkg.xml entry before upgrading it -
(e.g line 614) so my initial modification request is no longer valid :(

I'll have to learn more and try again in the future :)



 If this is not what you want to achieve please explain your use-case in
 more detail.
 
I am trying to stop WPKG removing wpkg.xml entries if there are no remove
instructions in a package



  For this to work you might have to modify the addSettingsNode function
 too since it first uses
 removeSettingsNode to make sure the node is not already inserted 
 
Yes - thats one way of doing it.



 What exactly do you try to achieve by this modification? I was under the
 impression that you might like to have an XML file which includes the
 history
 of installations - don't you?
 
No - just trying to make WPKG simpler :)

regards

Simon

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

-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


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

2009-10-04 Thread Falko Trojahn
Hello Simplesi,

 If you add a few if/else statements (I'm more than willing to supply the
 code changes from my modded version) then all I'd have to do everytime the
 main codebase changes is to redo my mods for the removeSettingsNode
 function
 itself.

please let us have a look at your changes or send a patch, so we can
see what and why you need a modded version.

Thanx,
Falko
-- 
Falko Trojahn fon +49-341-3581294
Dipl-Ingenieur Netzwerke/Support  fax +49-341-3581295

SMI Softmark Informationstechnologien GmbH
Sitz: D-04416 Markkleeberg, Friedrich-Ebert-Str. 51
Registergericht: Amtsgericht Leipzig HRB 164
Geschäftsführer: Andreas Griesmann

-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


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

2009-10-04 Thread simplesi

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.

-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


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

2009-10-04 Thread simplesi


Rainer Meier wrote:
 
 
 Could you explain this certain circumstances in a bit more detail
 because it
 might be a bug. I've checked the code and wpkg.xml entries are only
 removed in
 the removePackage function. And all of them are completely skipped if the
 /noremove flag (or noremove config) is set. In this case no remove
 commands are
 executed at all and wpkg.xml is not touched at all.
 
Are you saying the documentation is wrong and that /noremove will not remove
packages under any circumstances?
from wpkg.js 1.1.2


 
 /noremove \n + 
  Disable the removal of all packages. If used in conjunction with the \n
 + 
  /synchronize parameter it will just add packages but never remove them.
 \n + 
  Instead of removing a list of packages which would have been removed \n
 + 
  during that session is printed on exit. Packages are not removed from
 \n + 
  the local settings database (wpkg.xml). Therefore it will contain a list
 \n + 
  of all packages ever installed. \n + 
 
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 
 

regards

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

-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


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

2009-10-04 Thread Rainer Meier
Hi Simon,

simplesi wrote:
 Are you saying the documentation is wrong and that /noremove will not remove
 packages under any circumstances?
 from wpkg.js 1.1.2

Which part of the documentation is wrong? The one you quote below...


 /noremove \n + 
 Disable the removal of all packages. If used in conjunction with the \n
 + 
 /synchronize parameter it will just add packages but never remove them.
 \n + 
 Instead of removing a list of packages which would have been removed \n
 + 
 during that session is printed on exit. Packages are not removed from
 \n + 
 the local settings database (wpkg.xml). Therefore it will contain a list
 \n + 
 of all packages ever installed. \n + 

 and this is the bit that causes me problems

I don't think this causes any problem - this is just the printout of the usage
screen ;-)
Well I think you want to point out something within the text. Which parts do you
think are wrong?
I was under the impression that you would like WPKG not to remove any package at
any point in time. This is what the /noremove flag is supposed to do I think
(unless there is some other misunderstanding).
Especially it reads Packages are not removed from the local settings database
(wpkg.xml). Therefore it will contain a list of all packages ever installed.
Which seems to be what you like to achieve, isn't it?


br,
Rainer
-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users


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

2009-10-04 Thread simplesi

I don't know how you are viewing my message but when I view it on Nabble - it
shows the relavent part of the documentation in bold :)

Please just look at the documentation in wpkg.js about noremove especially
the last bit

regards

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

-
wpkg-users mailing list archives  http://lists.wpkg.org/pipermail/wpkg-users/
___
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users