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

Re: isn't sed s,x,x, one big no-op?



On 2010-05-06 05:23 +0200, Andrew Sackville-West wrote:

> On Thu, May 06, 2010 at 08:52:39AM +0800, jidanni@jidanni.org wrote:
>> In /etc/grub.d/00_header we see
>> 
>>   transform="s,x,x,"
>>   grub_prefix=`echo /boot/grub | sed ${transform}`
>>   locale_dir=`echo /boot/grub/locale | sed ${transform}`
>> 
>> Isn't that sed line one big no-op?
>
> looks like it to me. 
>
>> Should I file a bug to have it removed or at least have a comment added
>> as to its purpose, or have them use a better way to achieve what they
>> are trying to do?
>
> maybe a question is better than a bug report. I imagine it's just a
> convenience variable in case someone needs to transform paths for some
> reason.

Yes, actually you can do it at build time by using the configure option
--program-transform-name.  Say you want grub to be named grub2 to
distinguish it from grub-legacy, then you can run

$ ./configure --program-transform-name=s/grub/grub2/

and 00_header will have the transform line look like this

transform="s/grub/grub2/"

This somewhat obscure feature is not used in the Debian package,
hence the no-ops.

Sven


Reply to: