[36031] trunk/dports/devel/bugzilla/Portfile

Rainer Müller raimue at macports.org
Thu Apr 17 09:45:28 PDT 2008


Ryan Schmidt wrote:
>>  post-patch {
>> -    cd ${worksrcpath}
>> +    system "cd ${worksrcpath}"
>>      foreach item [exec find . -type f -name .cvsignore] {
>>          file delete -force ${item}
>>      }
>> @@ -99,7 +107,7 @@
>>
>>      set docPath "${prefix}/share/doc/${name}"
>>      xinstall -d -m 0755 ${destroot}${docPath}
>> -    cd ${worksrcpath}
>> +    system "cd ${worksrcpath}"
>>      xinstall -m 0644 \
>>          README QUICKSTART UPGRADING UPGRADING-pre-2.8 \
>>          ${destroot}${docPath}/
> 
> That change isn't going to work, is it? I mean, the reason why the tcl
> "cd" command was deprecated is because we don't want portfiles changing
> the working directory. Using 'system "cd"' won't change the working
> directory, so e.g. the subsequent tcl "file delete" commands won't find
> the files to delete. To fix the post-patch phase, you'd have to "exec
> find ${worksrcpath} ..." instead. Haven't looked at the second bit.

No, this is not going to work. The system command spawns a new shell in
which the directory is changed but that does not change the current
directory of the Tcl interpreter.

Use absolute paths or xinstall -W ${worksrcpath} instead. To avoid the
use of constructs like "exec find", there is fs-traverse which does what
you probably want there.

Rainer


More information about the macports-dev mailing list