From: PHO Date: Sun, 7 Dec 2008 12:08:28 +0000 (+0900) Subject: update.pl X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=5af643009f0cb1adc410ce4827b06a9645e4ce56;p=sugar.git update.pl --- diff --git a/GNUmakefile b/GNUmakefile index 0835be7..bf199c4 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -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 index 0000000..d91e35a --- /dev/null +++ b/tools/update.pl @@ -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();