[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATCH] Fix #1079 by ripping out pathname expansio

From: Jim Ursetto
Subject: Re: [Chicken-hackers] [PATCH] Fix #1079 by ripping out pathname expansion and putting it into an egg [Was: Re: [PATCH] add pathname-expand]
Date: Mon, 7 Jul 2014 11:43:20 -0500

Thanks Peter!
Does this egg work with older Chicken versions? I.e. can I safely replace 
##sys#expand-home-path in sql-de-lite with pathname-expand across the board?

> On Jun 22, 2014, at 6:43, Peter Bex <address@hidden> wrote:
>> On Wed, Nov 13, 2013 at 01:05:55PM +0000, Mario Domenech Goulart wrote:
>> Hi Felix and all,
>> Getting rid of [pathname expansion] is the simplest approach.
>> There are other ones, though.  Here are some of them:
>> * move pathname-expand to an egg.  From users standpoint, I think it
>>  won't make a big difference between having pathname-expand in the core
>>  or in an egg.  It's something new anyway.  Having it as an egg can
>>  actually be a win in the end: it would be available to older chickens
>>  (although it wouldn't do anything, since pathname expansion is
>>  implicit).  But at least applications wouldn't break on an "Unbound
>>  variable: pathname-expand" error.  If pathname-expand is in the core,
>>  programs that use it will have a hard dependency on CHICKEN 4.9.0.
> I have now implemented Felix's "pathname-expand" patch as an egg (see
>  I've made a few small
> modifications:
> - The strings "~" and "~~" are also expanded, as are strings with a
>   prefix of "~/" and "~~/" (but NOT "~~foo", and "~foo" has the
>   existing meaning of expanding too user foo's homedir)
> - The homedir is determined whenever it's required.  This allows
>   privilege dropping and user switching to work "correctly",
>   in that the actual user id determines which homedir you get.
> - In case no user is found, we still raise an error, but I've added
>   a specific exception subtype so that it can be caught more easily.
> - In case the repository path is undefined (can this be?), we raise
>   an exception instead of using the current directory.
> I think we don't need to detect when it's running in an older CHICKEN,
> because in most situations when directories are expanded multiple times,
> they will be identical to the strings you get after only one expansion.
> By not stubbing out the procedures with no-ops, we nail down the
> behaviour more exactly, even in older CHICKENs.
> It's an egg, so if you disagree on the specifics, feel free to fix it
> and tag a new release.
> Attached is an updated version of Florian's patch to remove all implicit
> expansion from CHICKEN core.
> Cheers,
> Peter
> -- 
> <0001-Remove-sys-expand-home-path-as-shell-expansion-has-n.patch>
> _______________________________________________
> Chicken-hackers mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]