Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: kinosearch: commits

r3817 - trunk/charmonizer/bin

 

 

kinosearch commits RSS feed   Index | Next | Previous | View Threaded


marvin at rectangular

Sep 5, 2008, 10:36 PM

Post #1 of 1 (1112 views)
Permalink
r3817 - trunk/charmonizer/bin

Author: creamyg
Date: 2008-09-05 22:36:15 -0700 (Fri, 05 Sep 2008)
New Revision: 3817

Modified:
trunk/charmonizer/bin/metaquote
Log:
Add an up-to-date check to metaquote.


Modified: trunk/charmonizer/bin/metaquote
===================================================================
--- trunk/charmonizer/bin/metaquote 2008-09-06 02:39:48 UTC (rev 3816)
+++ trunk/charmonizer/bin/metaquote 2008-09-06 05:36:15 UTC (rev 3817)
@@ -6,6 +6,7 @@
use File::Spec;
use File::Find qw( find );
use File::Path qw( mkpath );
+use File::stat;

my %done;
my ( $outdir, $charm_src );
@@ -48,11 +49,21 @@
sub process_file {
my $rel_path = shift;
return if $done{$rel_path};
+
my $src_path = File::Spec->catfile( $charm_src, $rel_path );
my $content = slurp_file($src_path);
$content = replace_metaquotes($content);
my $dest_path = File::Spec->catfile( $outdir, $rel_path );
$dest_path =~ s/(\.[ch])[^.]+$/$1/ or die "No match";
+
+ # Don't generate new file if current.
+ my $stat_orig = stat($src_path);
+ my $stat_dest = stat($dest_path);
+ return
+ if ($stat_orig
+ and $stat_dest
+ and $stat_dest->mtime > $stat_orig->mtime );
+
print "Writing $dest_path\n";
spit_file( $dest_path, $content );
$done{$rel_path} = 1;


_______________________________________________
kinosearch-commits mailing list
kinosearch-commits [at] rectangular
http://www.rectangular.com/mailman/listinfo/kinosearch-commits

kinosearch commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.