From 5af643009f0cb1adc410ce4827b06a9645e4ce56 Mon Sep 17 00:00:00 2001 From: PHO Date: Sun, 7 Dec 2008 21:08:28 +0900 Subject: [PATCH] update.pl --- GNUmakefile | 11 ++++++++--- tools/update.pl | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 tools/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(); -- 2.40.0