From 84a90e22907dfbf662a42a1fa1c6bb0c054fa02d Mon Sep 17 00:00:00 2001 From: PHO Date: Sun, 7 Dec 2008 21:16:59 +0900 Subject: [PATCH] Auto commit by The Sugar System. --- GNUmakefile | 6 ++++++ dot-files/_zshrc | 1 - tools/update.pl | 9 ++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index bf199c4..d79d0fa 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -7,5 +7,11 @@ update: git pull perl ./tools/list-files.pl | perl ./tools/update.pl perl ./tools/list-files.pl | perl ./tools/find-outdated.pl + git status + +commit: + git add -A + git commit -m 'Auto commit by The Sugar System.' + git push .PHONY: lint \ No newline at end of file diff --git a/dot-files/_zshrc b/dot-files/_zshrc index b6d2207..85bdc4b 100644 --- a/dot-files/_zshrc +++ b/dot-files/_zshrc @@ -33,7 +33,6 @@ setopt auto_remove_slash setopt c_bases setopt chase_links setopt complete_aliases -# setopt correct_all setopt correct setopt equals setopt glob_complete diff --git a/tools/update.pl b/tools/update.pl index d91e35a..624b3eb 100644 --- a/tools/update.pl +++ b/tools/update.pl @@ -16,7 +16,14 @@ sub main { my $abs = File::Spec->rel2abs($rel, $ENV{HOME}); - copy($abs, $saved) or die $!; + my $current_st = stat($abs); + my $saved_st = stat($saved); + + if ($current_st->mtime > $saved_st->mtime && + compare($abs, $saved) != 0) { + print "Copying $abs to $saved...\n"; + copy($abs, $saved) or die $!; + } } } -- 2.40.0