/usr/local/bin in $PATH in system scripts?

Micah Cowan micahcowan at ubuntu.com
Thu May 10 15:59:19 UTC 2007


Fergal Daly wrote:
> On 10/05/07, Forest Bond <forest at alittletooquiet.net> wrote:
>> On Wed, May 09, 2007 at 07:03:30PM -0400, Jim Doherty wrote:
>>> Sorry, I have no idea what ubuntu policy is.   But good defensive
>>> scripting practice includes setting your $PATH to something safe.  A
>>> good script should always not trust the environment it was handed along
>>> with many other things that people don't always do.
>> I have to disagree.  The environment is precisely the tool available to users to
>> change the behavior of your script externally.  It's not nice to stomp on user
>> preferences.
>>
>> The original problem is user error.  Installing an upgraded perl in /usr/local
>> without installing all of the needed perl libraries or removing /usr/local/bin
>> from the default system PATH is incorrect usage.  Don't break features to avoid
>> user error, please.
> 
> You have 2 assertions in one sentence, I'm splitting them up.
> 
> 1 - "Installing an upgraded perl in /usr/local without installing all
> of the needed perl libraries is incorrect usage"
> 
> This directly contradicts the debian policy I quoted which essentially
> says that the contents of /usr/local should have no impact on whether
> your system works or not. I know Debian is not Ubuntu but in the
> absence of Ubuntu policy docs, I'm assuming that the Debian policy is
> a sane starting point.

Yes, but that's not actually what it states (repasted):
> "However, because /usr/local and its contents are for exclusive use of
> the local administrator, a package must not rely on the presence or
> absence of files or directories in /usr/local for normal operation."

It is not relying on the presence or absence of any files. It is relying
on your PATH to give it a good perl. That /perl/ is relying on the
presence or absence of various files. I don't think that this paragraph
was ever meant to be applied to such indirect reliance.

> You are also implying that everything in /usr/bin that start with
> 
> #! /usr/bin/{perl,python,...}
> 
> is wrong and should actually start with
> 
> #! {perl,python,...}

That doesn't work. #! requires a path.

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-devel-discuss/attachments/20070510/4eba5a86/attachment.sig>


More information about the Ubuntu-devel-discuss mailing list