~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to debian/patches/940_test_file_exhaustive_fails_as_root.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2009-07-30 19:06:31 UTC
  • Revision ID: james.westby@ubuntu.com-20090730190631-3x30w2mtev71ah62
Tags: 1.9.1.243-0ubuntu1
* Upload snapshot from Debian's pkg-ruby SVN repository to karmic.
  SVN revision: 235.
  Likely to be similar to the final package uploaded to Debian.
  Known issues:
  + lintian warnings/errors (nothing important)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 940_test_file_exhaustive_fails_as_root.dpatch by Lucas Nussbaum <lucas@lucas-nussbaum.net>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: several tests fail when building as root.
 
6
## DP: see http://redmine.ruby-lang.org/issues/show/1170
 
7
 
 
8
@DPATCH@
 
9
diff -urNad ruby1.9-1.9.1.0~/test/ruby/test_file_exhaustive.rb ruby1.9-1.9.1.0/test/ruby/test_file_exhaustive.rb
 
10
--- ruby1.9-1.9.1.0~/test/ruby/test_file_exhaustive.rb  2009-01-12 14:33:08.000000000 +0100
 
11
+++ ruby1.9-1.9.1.0/test/ruby/test_file_exhaustive.rb   2009-02-18 14:52:37.000000000 +0100
 
12
@@ -142,6 +142,7 @@
 
13
 
 
14
   def test_readable_p
 
15
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
16
+    return if Process.euid == 0
 
17
     File.chmod(0200, @file)
 
18
     assert(!(File.readable?(@file)))
 
19
     File.chmod(0600, @file)
 
20
@@ -151,6 +152,7 @@
 
21
 
 
22
   def test_readable_real_p
 
23
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
24
+    return if Process.euid == 0
 
25
     File.chmod(0200, @file)
 
26
     assert(!(File.readable_real?(@file)))
 
27
     File.chmod(0600, @file)
 
28
@@ -171,6 +173,7 @@
 
29
 
 
30
   def test_writable_p
 
31
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
32
+    return if Process.euid == 0
 
33
     File.chmod(0400, @file)
 
34
     assert(!(File.writable?(@file)))
 
35
     File.chmod(0600, @file)
 
36
@@ -180,6 +183,7 @@
 
37
 
 
38
   def test_writable_real_p
 
39
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
40
+    return if Process.euid == 0
 
41
     File.chmod(0400, @file)
 
42
     assert(!(File.writable_real?(@file)))
 
43
     File.chmod(0600, @file)
 
44
@@ -238,6 +242,7 @@
 
45
 
 
46
   def test_owned_p ## xxx
 
47
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
48
+    return if Process.euid == 0 # only needed on HPPA?
 
49
     assert(File.owned?(@file))
 
50
     assert(File.grpowned?(@file))
 
51
   end
 
52
@@ -611,6 +616,7 @@
 
53
 
 
54
   def test_stat_readable_p
 
55
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
56
+    return if Process.euid == 0
 
57
     File.chmod(0200, @file)
 
58
     assert(!(File::Stat.new(@file).readable?))
 
59
     File.chmod(0600, @file)
 
60
@@ -619,6 +625,7 @@
 
61
 
 
62
   def test_stat_readable_real_p
 
63
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
64
+    return if Process.euid == 0
 
65
     File.chmod(0200, @file)
 
66
     assert(!(File::Stat.new(@file).readable_real?))
 
67
     File.chmod(0600, @file)
 
68
@@ -637,6 +644,7 @@
 
69
 
 
70
   def test_stat_writable_p
 
71
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
72
+    return if Process.euid == 0
 
73
     File.chmod(0400, @file)
 
74
     assert(!(File::Stat.new(@file).writable?))
 
75
     File.chmod(0600, @file)
 
76
@@ -645,6 +653,7 @@
 
77
 
 
78
   def test_stat_writable_real_p
 
79
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
80
+    return if Process.euid == 0
 
81
     File.chmod(0400, @file)
 
82
     assert(!(File::Stat.new(@file).writable_real?))
 
83
     File.chmod(0600, @file)
 
84
@@ -696,6 +705,7 @@
 
85
 
 
86
   def test_stat_owned_p ## xxx
 
87
     return if /cygwin|mswin|bccwin|mingw|emx/ =~ RUBY_PLATFORM
 
88
+    return if Process.euid == 0 # only needed on HPPA?
 
89
     assert(File::Stat.new(@file).owned?)
 
90
     assert(File::Stat.new(@file).grpowned?)
 
91
   end