[wpkg-users] wpkg-0.9.6-test1 released

Dr. F. Lee rl201 at cam.ac.uk
Wed Mar 8 19:40:23 CET 2006


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
>>
>>
>
>

wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users




More information about the wpkg-users mailing list