[wpkg-users] Internal Variables Not Working in Remove Commands

Chris Allen callen at katmairesearch.com
Tue Jun 9 03:17:10 CEST 2009


I just noticed that my example had an environment variable in the path
definition for the internal wpkg variable.  The problem remains even if I
don't contain the environment variable in the wpkg variable.  ie.  <variable
name='cygroot' value='c:\cygwin' />

On Mon, Jun 8, 2009 at 5:55 PM, Chris Allen <callen at katmairesearch.com>wrote:

> For some reason I can't seem to use wpkg variables in my remove commands.
> Install, and upgrade commands work fine for me.
>
> To give you all an example of this problem below I pasted my cygwin install
> script, notice the part at the end:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!-- Tested on: XP 32, Vista 64 -->
>
> <packages>
>
> <package id="cygwin"
>     name="Cygwin"
>     revision="1"
>     priority="10"
>     reboot="false">
>
>  <check type="file" condition="exists"
> path="%SYSTEMDRIVE%\cygwin\cygwin.bat" />
>  <variable name='cygroot' value='%SYSTEMDRIVE%\cygwin' />
>  <install cmd='cmd /c "%WPKG%\tools\robocopy.exe"
> "%SOFTWARE%\bundled\cygwin\cygwin" %cygroot% /E /R:0 /W:0 /NFL /NDL /NP /NJH
> /NJS' >
>    <exit code="1" />
>    <exit code="2" />
>    <exit code="4" />
>    <exit code="8" />
>  </install>
>  <install cmd='cmd /c %cygroot%\bin\mount -s -f %cygroot% /' />
>  <install cmd='cmd /c %cygroot%\bin\mount -s -f %cygroot%\bin /usr/bin' />
>  <install cmd='cmd /c %cygroot%\bin\mount -s -f %cygroot%\lib /usr/lib' />
>  <install cmd='cmd /c "%cygroot%\bin\mkpasswd -ld > %cygroot%\etc\passwd"'
> />
>  <install cmd='cmd /c "%cygroot%\bin\mkgroup -ld > %cygroot%\etc\group"' />
>
>  <upgrade cmd='cmd /c "%WPKG%\tools\robocopy.exe"
> "%SOFTWARE%\bundled\cygwin\cygwin" %cygroot% /E /R:0 /W:0 /NFL /NDL /NP /NJH
> /NJS' >
>    <exit code="1" />
>    <exit code="2" />
>    <exit code="4" />
>    <exit code="8" />
>  </upgrade>
>  <upgrade cmd='cmd /c "%cygroot%\bin\mkpasswd -ld > %cygroot%\etc\passwd"'
> />
>  <upgrade cmd='cmd /c "%cygroot%\bin\mkgroup -ld > %cygroot%\etc\group"' />
>
> <!-- do not use variables in remove commands
>   <remove cmd="cmd /c rmdir /s /q %cygroot% />  will FAIL -->
>
>  <remove cmd="cmd /c rmdir /s /q C:\cygwin" />
> </package>
>
> </packages>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20090608/f51da8dd/attachment-0002.html>


More information about the wpkg-users mailing list