145 |
print $out $_; |
print $out $_; |
146 |
} |
} |
147 |
$in->close; |
$in->close; |
148 |
unlink ($from) || fatal "cannot not remove $from: $!"; |
unlink ($from) || fatal "cannot remove $from: $!"; |
149 |
return; |
return; |
150 |
} |
} |
151 |
|
|
154 |
# File didn't change, so don't update its mod time. |
# File didn't change, so don't update its mod time. |
155 |
msg 'note', "`$to' is unchanged"; |
msg 'note', "`$to' is unchanged"; |
156 |
unlink ($from) |
unlink ($from) |
157 |
or fatal "cannot not remove $from: $!"; |
or fatal "cannot remove $from: $!"; |
158 |
return |
return |
159 |
} |
} |
160 |
|
|
162 |
{ |
{ |
163 |
# Back up and install the new one. |
# Back up and install the new one. |
164 |
move ("$to", "$to$SIMPLE_BACKUP_SUFFIX") |
move ("$to", "$to$SIMPLE_BACKUP_SUFFIX") |
165 |
or fatal "cannot not backup $to: $!"; |
or fatal "cannot backup $to: $!"; |
166 |
move ("$from", "$to") |
move ("$from", "$to") |
167 |
or fatal "cannot not rename $from as $to: $!"; |
or fatal "cannot rename $from as $to: $!"; |
168 |
msg 'note', "`$to' is updated"; |
msg 'note', "`$to' is updated"; |
169 |
} |
} |
170 |
else |
else |
171 |
{ |
{ |
172 |
move ("$from", "$to") |
move ("$from", "$to") |
173 |
or fatal "cannot not rename $from as $to: $!"; |
or fatal "cannot rename $from as $to: $!"; |
174 |
msg 'note', "`$to' is created"; |
msg 'note', "`$to' is created"; |
175 |
} |
} |
176 |
} |
} |