diff options
Diffstat (limited to '')
-rw-r--r-- | src/conditionfiletime.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/conditionfiletime.cpp b/src/conditionfiletime.cpp index 43df53b..82d147c 100644 --- a/src/conditionfiletime.cpp +++ b/src/conditionfiletime.cpp | |||
@@ -10,7 +10,7 @@ using namespace Bu; | |||
10 | 10 | ||
11 | #include <bu/plugger.h> | 11 | #include <bu/plugger.h> |
12 | PluginInterface3( pluginConditionFileTime, fileTime, ConditionFileTime, | 12 | PluginInterface3( pluginConditionFileTime, fileTime, ConditionFileTime, |
13 | Condition, "Mike Buland", 0, 1 ); | 13 | Condition, "Mike Buland", 0, 1 ); |
14 | 14 | ||
15 | ConditionFileTime::ConditionFileTime() | 15 | ConditionFileTime::ConditionFileTime() |
16 | { | 16 | { |
@@ -22,59 +22,59 @@ ConditionFileTime::~ConditionFileTime() | |||
22 | 22 | ||
23 | bool ConditionFileTime::shouldExec( class Runner &r, Target &rTarget ) | 23 | bool ConditionFileTime::shouldExec( class Runner &r, Target &rTarget ) |
24 | { | 24 | { |
25 | for( StrList::const_iterator j = rTarget.getOutputList().begin(); j; j++ ) | 25 | for( StrList::const_iterator j = rTarget.getOutputList().begin(); j; j++ ) |
26 | { | 26 | { |
27 | if( access( (*j).getStr(), F_OK ) ) | 27 | if( access( (*j).getStr(), F_OK ) ) |
28 | { | 28 | { |
29 | //sio << "-- Target processed because '" << *j << "' doesn't exist." | 29 | //sio << "-- Target processed because '" << *j << "' doesn't exist." |
30 | // << sio.nl; | 30 | // << sio.nl; |
31 | // Output doesn't exist | 31 | // Output doesn't exist |
32 | rTarget.buildRequires( r ); | 32 | rTarget.buildRequires( r ); |
33 | return true; | 33 | return true; |
34 | } | 34 | } |
35 | } | 35 | } |
36 | 36 | ||
37 | time_t tOut = 0; | 37 | time_t tOut = 0; |
38 | struct stat s; | 38 | struct stat s; |
39 | for( StrList::const_iterator j = rTarget.getOutputList().begin(); | 39 | for( StrList::const_iterator j = rTarget.getOutputList().begin(); |
40 | j; j++ ) | 40 | j; j++ ) |
41 | { | 41 | { |
42 | stat( (*j).getStr(), &s ); | 42 | stat( (*j).getStr(), &s ); |
43 | if( tOut == 0 || tOut > s.st_mtime ) | 43 | if( tOut == 0 || tOut > s.st_mtime ) |
44 | { | 44 | { |
45 | tOut = s.st_mtime; | 45 | tOut = s.st_mtime; |
46 | } | 46 | } |
47 | } | 47 | } |
48 | for( StrList::const_iterator j = rTarget.getInputList().begin(); | 48 | for( StrList::const_iterator j = rTarget.getInputList().begin(); |
49 | j; j++ ) | 49 | j; j++ ) |
50 | { | 50 | { |
51 | stat( (*j).getStr(), &s ); | 51 | stat( (*j).getStr(), &s ); |
52 | if( tOut < s.st_mtime ) | 52 | if( tOut < s.st_mtime ) |
53 | { | 53 | { |
54 | //sio << "-- Target processed because '" << *j | 54 | //sio << "-- Target processed because '" << *j |
55 | // << "' is newer than output." << sio.nl; | 55 | // << "' is newer than output." << sio.nl; |
56 | rTarget.buildRequires( r ); | 56 | rTarget.buildRequires( r ); |
57 | return true; | 57 | return true; |
58 | } | 58 | } |
59 | } | 59 | } |
60 | rTarget.gatherRequires( r ); | 60 | rTarget.gatherRequires( r ); |
61 | for( StrList::const_iterator j = rTarget.getRequiresList().begin(); | 61 | for( StrList::const_iterator j = rTarget.getRequiresList().begin(); |
62 | j; j++ ) | 62 | j; j++ ) |
63 | { | 63 | { |
64 | stat( (*j).getStr(), &s ); | 64 | stat( (*j).getStr(), &s ); |
65 | if( tOut < s.st_mtime ) | 65 | if( tOut < s.st_mtime ) |
66 | { | 66 | { |
67 | //sio << "-- Target processed because '" << *j | 67 | //sio << "-- Target processed because '" << *j |
68 | // << "' is newer than output." << sio.nl; | 68 | // << "' is newer than output." << sio.nl; |
69 | rTarget.buildRequires( r ); | 69 | rTarget.buildRequires( r ); |
70 | return true; | 70 | return true; |
71 | } | 71 | } |
72 | } | 72 | } |
73 | return false; | 73 | return false; |
74 | } | 74 | } |
75 | 75 | ||
76 | Condition *ConditionFileTime::clone() | 76 | Condition *ConditionFileTime::clone() |
77 | { | 77 | { |
78 | return new ConditionFileTime(); | 78 | return new ConditionFileTime(); |
79 | } | 79 | } |
80 | 80 | ||