]> gitweb @ CieloNegro.org - sugar.git/commitdiff
update.pl
authorPHO <pho@cielonegro.org>
Sun, 7 Dec 2008 12:08:28 +0000 (21:08 +0900)
committerPHO <pho@cielonegro.org>
Sun, 7 Dec 2008 12:08:28 +0000 (21:08 +0900)
GNUmakefile
tools/update.pl [new file with mode: 0644]

index 0835be7f389014a9d0e3e3a078b53416d625aa64..bf199c4d610593d8aa0aab924c20ed6199cf0a1c 100644 (file)
@@ -1,6 +1,11 @@
 lint:
-       @perl ./tools/list-files.pl | perl ./tools/find-missing.pl
-       @perl ./tools/list-files.pl | perl ./tools/find-outdated.pl
-       @perl ./tools/list-files.pl | perl ./tools/find-changed.pl
+       perl ./tools/list-files.pl | perl ./tools/find-missing.pl
+       perl ./tools/list-files.pl | perl ./tools/find-outdated.pl
+       perl ./tools/list-files.pl | perl ./tools/find-changed.pl
+
+update:
+       git pull
+       perl ./tools/list-files.pl | perl ./tools/update.pl
+       perl ./tools/list-files.pl | perl ./tools/find-outdated.pl
 
 .PHONY: lint
\ No newline at end of file
diff --git a/tools/update.pl b/tools/update.pl
new file mode 100644 (file)
index 0000000..d91e35a
--- /dev/null
@@ -0,0 +1,23 @@
+use strict;
+use warnings;
+use Smart::Comments;
+use lib 'tools';
+require 'utils.pl';
+use File::stat;
+use File::Spec;
+use File::Compare;
+use File::Copy;
+
+sub main {
+    while (defined(my $rel = <>)) {
+        chomp $rel;
+        my $saved = rel2saved($rel);
+        next if !-e $saved;
+
+        my $abs = File::Spec->rel2abs($rel, $ENV{HOME});
+
+        copy($abs, $saved) or die $!;
+    }
+}
+
+main();