File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,24 @@ def format=(format)
46
46
# @return [Boolean] Returns true if the output is up-to-date or false if not.
47
47
def up_to_date? ( outputdir )
48
48
f = effective_output_path ( outputdir )
49
- Puppet ::FileSystem ::exist? ( f ) && ( Puppet ::FileSystem ::stat ( @path ) <=> Puppet ::FileSystem ::stat ( f ) ) <= 0
49
+ # Check the fast-path scenarios first.
50
+ unless Puppet ::FileSystem ::exist? ( f )
51
+ Puppet . debug ( "#{ f } does not exist." )
52
+ return false
53
+ end
54
+ unless ( Puppet ::FileSystem ::stat ( @path ) <=> Puppet ::FileSystem ::stat ( f ) ) <= 0
55
+ Puppet . debug ( "#{ @path } is newer than #{ f } " )
56
+ return false
57
+ end
58
+ # Check for updates to any module lib files.
59
+ module_lib_files = Dir . glob ( @base + "/lib/**/*.rb" )
60
+ module_lib_files . each do |lib |
61
+ unless ( Puppet ::FileSystem ::stat ( lib ) <=> Puppet ::FileSystem ::stat ( f ) ) <= 0
62
+ Puppet . debug ( "#{ lib } is newer than #{ f } " )
63
+ return false
64
+ end
65
+ end
66
+ return true
50
67
end
51
68
52
69
# Gets the filename of the output file.
You can’t perform that action at this time.
0 commit comments