Bug#288616: use of ">" in tetex postinst errors for sites using bash noclobber
On Wed, Jan 05, 2005 at 11:25:24AM +0100, Hilmar Preusse wrote:
>On 04.01.05 George Georgalis (george@galis.org) wrote:
>
>Hi,
>
>> The use of the noclobber bash option is akin to aliasing "-i" with
>> the rm, cp and mv commands. It will stop a redirect to a file if
>> that file already exists. I don't see anything in the debian policy
>> that says root should not use this option in ~/.bashrc.
>>
>This is #275140, which was closed by the submitter. Please have a
>look at that one and tell us, if that suffice you.
>
This problem came up on an upgrade before (forget package and didn't
file bug, but maybe because I found that one). I think a fix should be
part of qa policy. Discovering the actual problem was not easy (we tend
to forget we have noclobber in .bashrc). The use of ">>" or ">|" for
writing new temp files is arbitrary, but I think the former is easier to
read, and would be a good policy for concatenating to tmp files.
Testing for noclobber would be a pain, and there are probably lots of
other options that could break things. Maybe the best solution is for
apt-get to invoke scripts with "bash --rcfile /etc/bash.bashrc -c ..."
or "bash --norc -c ..." If people using are making site changes that
apt needs, I would expect the changes to go in /etc/bash.bashrc not
/root/.bashrc, it's not clear to me why apt-get is using a login shell
anyway.
// George
--
George Georgalis, systems architect, administrator Linux BSD IXOYE
http://galis.org/george/ cell:646-331-2027 mailto:george@galis.org
Reply to: