[wpkg-users] Extended hosts matches

Falko Trojahn nospam_ft at smi-softmark.de
Tue Jun 8 10:11:17 CEST 2010


Bonjour Daniel,

> Falko Trojahn <nospam_ft at smi-softmark.de> writes:
>
>
> [...]
>
>   
>> Well, up to now, all command line parameters have had their counterpart
>> in config.xml, so no need to specify command line parameters.
>>     
> No, the /host, /query, /install, /remove, /upgrade does not have
> config.xml couterpart, they have no meaning here.
>
>   
So, the standard command line parameters in "testone.cmd" ("
/synchronize /noforcedremove /nonotify") do not make sense together with
your options, do they?

Up to now, wpkg-tests did behave as standard Wpkg Client would do, but
for sure we'll be a lot more flexible if we like to test other command
line options as well.
>> If you really need 'em, you can put a "cmdlineparams.txt" in a test dir
>> and I'll have a look at "testone.cmd", how to read this file (if it
>> exists) into a variable.
>>     
> Maybe a call on a cmdlineparams.cmd to define a variable ?
>
> - Use SETLOCAL/ENDLOCAL to avoid environnement pollution
> - a cmdlineparams.cmd define a variable, like %WPKG_CMD_PARAMS%
> - in testone.cmd: 
>   * IF EXIST "%1\%2\cmdlineparams.cmd" CALL "%1\%2\cmdlineparams.cmd"
>   * cscript [...] %WPKG_CMD_PARAMS%
>   
Apart from the "_" in the variable, this is a good idea.

For flexibility, in revision 120 I've introduced two calls:

IF EXIST "%1\customparams.cmd" CALL "%1\customparams.cmd" %1 %2
IF EXIST "%1\%2\customparams.cmd" CALL "%1\%2\customparams.cmd" %1 %2

Additionally, the parameters %1 %2 are given to cmdlineparams.cmd for
further use.

Perhaps the actual system of comparing the resulting wpkg.xml is not
enough. So I introduced another two calls to

CALL "%1\customcompare.cmd %1 %2"
CALL "%1\%2\customcompare.cmd %1 %2"

If it returns errorlevel 0 -> ok, errorlevel >0 -> fail.

Here is an example of two custom cmds, doing nearly the same as
testone.cmd normally does:

// customparams.cmd
echo calling %1 %2 %0
set WPKGCMDPARAMS=/synchronize /notify

// customcompare.cmd
echo calling %1 %2 %0
fc /L /N ..\..\wpkg.xml ..\..\compare\%1\%2\wpkg.xml

Be aware, that the working directory changes.

Bon journee,
Falko



More information about the wpkg-users mailing list