Subject: Re: changing directories in INSTALL/DEINSTALL scripts
To: None <tech-pkg@NetBSD.org>
From: Johnny C. Lam <jlam@pkgsrc.org>
List: tech-pkg
Date: 07/02/2007 17:43:41
Klaus Heinz wrote:
> I wrote:
>
>> among other problems I just noticed that print/tex-hugelatex has an
>> INSTALL script where the current directory is changed. This leads to
>> a problem in the "footer" section because +INSTALL cannot be found.
>>
>> Instead of prohibiting the "cd" command I propose to fix this kind of
>> problem in pkgsrc and insert "cd ${CURDIR}" at the top of
>>
>> deinstall-pre
>> deinstall
>> install
>> install-post
>> footer
>>
>> This is a simple change fixing a real problem and should be done
>> despite the freeze, IMO.
>
> Nobody had an opinion about this, so binary packages of
> print/tex-hugelatex are still broken in pkgsrc-2007Q2.
I apologize for missing this proposal earlier.
I think that actions within the script shouldn't change the current
working directory, and that consequently, ones that do should be invoked
from within a sub-shell. The "source" bits that are concatenated into a
final +INSTALL or +DEINSTALL script can be hard to predict, so I think
it's reasonable that each bit enforce the post-condition that the
working directory isn't changed.
Cheers,
-- Johnny Lam <jlam@pkgsrc.org>