From d10e050a2b8a2392db55366d74017ed36fbf9f15 Mon Sep 17 00:00:00 2001 From: crouzet Date: Mon, 5 Jul 2021 14:52:19 +0200 Subject: [PATCH] =?utf8?q?evite=20de=20dater=20avec=20touch,=20si=20le=20g?= =?utf8?q?it=20clone=20a=20=C3=A9chou=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/system.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system.py b/src/system.py index b7cc6c2..c54452b 100644 --- a/src/system.py +++ b/src/system.py @@ -98,7 +98,9 @@ def git_extract(from_what, tag, git_options, where, logger, environment=None): cmd = r""" set -x git clone %(git_options)s %(remote)s %(where)s -touch -d "$(git --git-dir=%(where_git)s log -1 --format=date_format)" %(where)s +res=$? +if [ $res -eq 0 ]; then touch -d "$(git --git-dir=%(where_git)s log -1 --format=date_format)" %(where)s;fi +exit $res """ cmd = cmd % {'git_options': git_options, 'remote': from_what, 'tag': tag, 'where': str(where), 'where_git': where_git} else: @@ -115,7 +117,7 @@ git clone %(git_options)s %(remote)s %(where)s && \ git --git-dir=%(where_git)s --work-tree=%(where)s checkout %(tag)s res=$? git --git-dir=%(where_git)s status|grep HEAD -if [ $? -ne 0 ]; then touch -d "$(git --git-dir=%(where_git)s log -1 --format=date_format)" %(where)s;fi +if [ $res -eq 0 -a $? -ne 0 ]; then touch -d "$(git --git-dir=%(where_git)s log -1 --format=date_format)" %(where)s;fi exit $res """ cmd = cmd % {'git_options': git_options, -- 2.39.2