[Rubygems-developers] [rubygems] Build still broken (#1111)

Eric Hodel drbrain at segment7.net
Mon Dec 4 13:41:56 EST 2006


On Dec 2, 2006, at 23:51 , Anatol Pomozov wrote:

> Look at test code at test_gem_source_info_cache.rb:80 . Chmod and  
> stat functions are very limited on Windows platform.
>
> I have added code that shows us what permission file has after we  
> try to set 0222 mode
>     FileUtils.chmod 0222, @sic.system_cache_file
>     puts sprintf("%o", File.stat(@sic.system_cache_file).mode)
>
> It returns me
> 100644
>
> It means that "real" file mode is 644. So RubyGems engine could  
> read cache data.

How about this patch:

Index: test/test_gem_source_info_cache.rb
===================================================================
--- test/test_gem_source_info_cache.rb  (revision 1111)
+++ test/test_gem_source_info_cache.rb  (working copy)
@@ -79,6 +79,8 @@
    def test_cache_data_none_readable
      FileUtils.chmod 0222, @sic.system_cache_file
      FileUtils.chmod 0222, @sic.user_cache_file
+    return if (File.stat(@sic.system_cache_file).mode & 0222) != 0222
+    return if (File.stat(@sic.user_cache_file).mode & 0222) != 0222
      assert_equal({}, @sic.cache_data)
    end

-- 
Eric Hodel - drbrain at segment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!



More information about the Rubygems-developers mailing list