PATCH: default installation directories

Hugh Sasse hgs at dmu.ac.uk
Tue Aug 16 11:49:31 EDT 2005


On Wed, 17 Aug 2005, Doug Kearns wrote:

> On Tue, Aug 16, 2005 at 12:25:42PM +0100, Hugh Sasse wrote:
>> Oh, I see those patches aren't in the CVS yet.  OK.
>
> Well it's Gavin's installer so I was going to wait for his comments
> since this changes it's behaviour. However, it seems he might be away or
> similar so I'll commit it.

OK, I can't remember how one might reverse a single change like this
later but I think it can be done....
>
>> Reading through
>> I noticed a couple of things that may cause problems, so I've added
>> comments and express them in the form of a patch for convenience.
>>
>> I think my mods to _same_contents *may* cover macs as well now,
>> which I think used \r as a line ending.  Probably not MacOSX.
>
> Does Ruby run on 'Macs'?

I think so, but I've never used one.  Just trying to keep things
open.
>
>>         HTH
>>         Hugh
>>
         [...]
>>    def _ensure_directory_exists(path)
>>      dir = path.dirname
>>      unless dir.directory?
>> +      # <XXX> FileUtils.mkdir_p already checks if it exists and is a
>> +      # directory.  What if it exists as a file? (HGS)</XXX>
>
> Yes, I'm not sure what this indirection is about either so I'll just add
> your comment until Gavin can elucidate further.

OK. 
>
> <snip>
>
>>        Dir.glob("#{dir}/vim*").select { |d| d =~ /vim\d+/ }.sort.last
>> +      # <XXX> I think this may fail at vim version 10 or if vim
>> +      # 6.22 were replaced by Vim 7.  Not sure of a good fix at this
>> +      # time (HGS)</XXX>
>
> This code was removed by the patch.

Oh, sorry.
>
> <snip>
>
>>      # Test two files for equality of contents, ignoring line endings.
>>    def _same_contents?(p1, p2)
>> -    contents1 = p1.read.split("\n").map { |line| line.chomp }
>> -    contents2 = p2.read.split("\n").map { |line| line.chomp }
>> +    ending = /[\r\n]+/
>> +    contents1 = p1.read.split(ending).map { |line| line.chomp }
>> +    contents2 = p2.read.split(ending).map { |line| line.chomp }
>>      contents1 == contents2
>>    end
>
> Doesn't this make the 'map' call redundant too?

Yes, I think so.   I was reluctant to change too much at once
without testing it to death.
>
> FWIW, I'm not sure that silently replacing a file with one which differs
> only in it's line endings is a good idea anyway.

Possibly this is to work around past problems where Unix distros
ended up with DOS-ish files, which choked the interpreter.
>
> Regards,
> Doug

         Thank you,
         Hugh


More information about the vim-ruby-devel mailing list