]> gitweb @ CieloNegro.org - sugar.git/commitdiff
Still in early development...
authorPHO <pho@cielonegro.org>
Sat, 6 Dec 2008 16:57:58 +0000 (01:57 +0900)
committerPHO <pho@cielonegro.org>
Sat, 6 Dec 2008 16:57:58 +0000 (01:57 +0900)
GNUmakefile
dot-files/_screenrc [new file with mode: 0644]
tools/find-missing.pl
tools/find-outdated.pl [new file with mode: 0644]
tools/utils.pl [new file with mode: 0644]

index 42f16634569a9a8b46d511e2fe961c6ef04876d3..325e68ea29bbab8d47f1217ab5a03d32fc6749c8 100644 (file)
@@ -1,4 +1,5 @@
 lint:
-       perl ./tools/list-files.pl | perl ./tools/find-missing.pl
+       @perl ./tools/list-files.pl | perl ./tools/find-missing.pl
+       @perl ./tools/list-files.pl | perl ./tools/find-outdated.pl
 
 .PHONY: lint
\ No newline at end of file
diff --git a/dot-files/_screenrc b/dot-files/_screenrc
new file mode 100644 (file)
index 0000000..573e24a
--- /dev/null
@@ -0,0 +1,10 @@
+escape ^Z^Z
+vbell off
+
+defscrollback 50000
+defutf8 on
+defflow off
+
+shelltitle '% |zsh'
+
+hardstatus alwayslastline "[%02c] %`%-w%{=b rw}%n %t%{-}%+w"
index 552b77bc0a5e27849269c8f73dd9351c0fe4b219..829af277efd607818bd8e04151d6e488bd96f0ec 100644 (file)
@@ -1,6 +1,8 @@
 use strict;
 use warnings;
 use Smart::Comments;
+use lib 'tools';
+require 'utils.pl';
 
 sub main {
     while (defined(my $rel = <>)) {
@@ -13,11 +15,4 @@ sub main {
     }
 }
 
-sub rel2saved {
-    my $rel = shift;
-
-    $rel =~ tr/./_/;
-    return "./dot-files/$rel";
-}
-
 main();
diff --git a/tools/find-outdated.pl b/tools/find-outdated.pl
new file mode 100644 (file)
index 0000000..b7e1c8e
--- /dev/null
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+use Smart::Comments;
+use lib 'tools';
+require 'utils.pl';
+use File::stat;
+use File::Spec;
+use File::Compare;
+
+sub main {
+    while (defined(my $rel = <>)) {
+        chomp $rel;
+        my $saved = rel2saved($rel);
+        next if !-e $saved;
+
+        my $abs = File::Spec->rel2abs($rel, $ENV{HOME});
+
+        my $current_st = stat($abs);
+        my $saved_st   = stat($saved);
+
+        if ($current_st->mtime < $saved_st->mtime &&
+              compare($abs, $saved) != 0) {
+            print "U $rel\n";
+        }
+    }
+}
+
+main();
diff --git a/tools/utils.pl b/tools/utils.pl
new file mode 100644 (file)
index 0000000..02cd1fb
--- /dev/null
@@ -0,0 +1,11 @@
+use strict;
+use warnings;
+
+sub rel2saved {
+    my $rel = shift;
+
+    $rel =~ tr/./_/;
+    return "./dot-files/$rel";
+}
+
+1;