autobuild 1.5.10 → 1.5.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ == Version 1.5.11
2
+ * don't sleep unnecessarily on filesystems that have sub-second modification
3
+ time resolutions. This speeds up builds.
4
+
1
5
  == Version 1.5.10
2
6
  * avoid unnecessary reconfigurations in the autotools handler
3
7
 
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.5.10" unless defined? Autobuild::VERSION
2
+ VERSION = "1.5.11" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
  require 'autobuild/config'
@@ -58,6 +58,17 @@ module Autobuild
58
58
  return File.mtime(stampfile)
59
59
  end
60
60
 
61
+ def self.hires_modification_time?
62
+ if @hires_modification_time.nil?
63
+ Tempfile.open('test') do |io|
64
+ io.flush
65
+ p_time = File.mtime(io.path)
66
+ @hires_modification_time = (p_time.tv_usec != 0)
67
+ end
68
+ end
69
+ @hires_modification_time
70
+ end
71
+
61
72
  def self.touch_stamp(stampfile)
62
73
  puts "Touching #{stampfile}" if Autobuild.debug
63
74
  dir = File.dirname(stampfile)
@@ -68,10 +79,12 @@ module Autobuild
68
79
  end
69
80
  FileUtils.touch(stampfile)
70
81
 
71
- # File modification times on most Unix filesystems have a granularity of
72
- # one second, so we (unfortunately) have to sleep 1s to make sure that
73
- # time comparisons will work as expected.
74
- sleep(1)
82
+ if !hires_modification_time?
83
+ # File modification times on most Unix filesystems have a granularity of
84
+ # one second, so we (unfortunately) have to sleep 1s to make sure that
85
+ # time comparisons will work as expected.
86
+ sleep(1)
87
+ end
75
88
  end
76
89
  end
77
90
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 10
9
- version: 1.5.10
8
+ - 11
9
+ version: 1.5.11
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sylvain Joyeux
@@ -81,8 +81,8 @@ dependencies:
81
81
  segments:
82
82
  - 2
83
83
  - 0
84
- - 3
85
- version: 2.0.3
84
+ - 4
85
+ version: 2.0.4
86
86
  type: :development
87
87
  version_requirements: *id005
88
88
  - !ruby/object:Gem::Dependency
@@ -95,8 +95,8 @@ dependencies:
95
95
  segments:
96
96
  - 2
97
97
  - 6
98
- - 0
99
- version: 2.6.0
98
+ - 1
99
+ version: 2.6.1
100
100
  type: :development
101
101
  version_requirements: *id006
102
102
  description: |-