From 76300a5e7626ed2d53aafdcadc1330c0680c1e52 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Tue, 25 Feb 2014 15:24:48 +0400 Subject: [PATCH] ajout de testupdated() --- ulib/.ulib_version | 2 +- ulib/base | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ulib/.ulib_version b/ulib/.ulib_version index a45fd52..7273c0f 100644 --- a/ulib/.ulib_version +++ b/ulib/.ulib_version @@ -1 +1 @@ -24 +25 diff --git a/ulib/base b/ulib/base index 1432947..731f22c 100644 --- a/ulib/base +++ b/ulib/base @@ -1154,6 +1154,14 @@ function testsame() { function testdiff() { ! quietdiff "$@" } +function testupdated() { +# test si $2 n'existe pas ou si $1 est différent de $2 + if [ -f "$2" ]; then + testdiff "$1" "$2" + else + return 0 + fi +} function testnewer() { # test si $2 n'existe pas ou si $1 est plus récent que $2 test ! -e "$2" -o "$1" -nt "$2"