Hi All,
I am not sure if the logic is all correct but it worked for the simple
test I did.
Hmm. I should have commented on this (having introduced the bug!).
Some checkPaths can be null! I've tried to defer the checking until the
subroutine checkCondition so there's probably no need to throw the error
in this function. I like giving the user info here, but perhaps that
should be moved to checkCondition too to allow for nested conditions?
Yours,
Frank
---------cut here ----
diff -u wpkg-orig.js wpkg.js
--- wpkg-orig.js Wed Mar 8 13:31:04 2006
+++ wpkg.js Wed Mar 8 13:29:38 2006
@@ -1234,20 +1234,33 @@
// loop over every condition check
// if all are successful, we consider package as installed
- for (var i = 0; i < checkNodes.length; i++) {
- if (! checkCondition(checkNodes[i])) {
- info("Checking presence of " + packageName +
- "; " + checkType + " check condition failed !");
- installed = false;
- //break;
- } else {
- info("Checking presence of " + packageName +
- "; " + checkType + " check condition met.");
- }
- }
- return installed;
+ for (var i = 0; i < checkNodes.length; i++) {
+ var checkNode = checkNodes(i);
+ var checkType = checkNode.getAttribute("type");
+ var checkCond = checkNode.getAttribute("condition");
+ var checkPath = checkNode.getAttribute("path");
+
+ if (checkType == null ||
+ checkCond == null ||
+ checkPath == null) {
+ throw new Error("Invalid check condition on package " +
+ packageName + ", aborting.");
+ } else if (! checkCondition(checkNodes[i])) {
+ info("Checking presence of " + packageName +
+ "; " + checkType + " check condition failed !");
+
+ installed = false;
+ //break;
+ } else {
+ info("Checking presence of " + packageName +
+ "; " + checkType + " check condition met.");
+ }
+ }
+
+ return installed;
}
--------------- cut here -------------------------------
On Tue, Mar 07, 2006 at 09:40:55PM +0100, Tomasz Chmielewski wrote:
WPKG 0.9.6-test1 has been released.
This is a testing release.
Applied three patches (well, one huge, really), which implement:
* "logical tests" - http://wpkg.org/index.php/Logical_tests
* "version checking" - http://wpkg.org/index.php/Version_checking
* "package dependencies" - http://wpkg.org/index.php/Package_dependencies
Thanks to Frank Lee for all new features!
You can find original patches and descriptions here:
http://www.sp.phy.cam.ac.uk/~rl201/wpkg/
--
Tomasz Chmielewski
http://wpkg.org
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
wpkg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wpkg-users
--
Frank Lee
Sidney Sussex College, Cambridge. http://www.sid.cam.ac.uk/
Semiconductor Physics, Cavendish Laboratory http://www.sp.phy.cam.ac.uk/
CRL, Toshiba Research Europe http://www.toshiba-europe.com/research/
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
wpkg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wpkg-users