From 2c034a84b393ff8a62504bf32fa4837e15c32d0c Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 3 May 2018 10:57:33 -0300 Subject: [PATCH] =?UTF-8?q?Imprime=20arquivos=20anteriores=20na=20exporta?= =?UTF-8?q?=C3=A7=C3=A3o=20de=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/scripts/exporta_zope/exporta_zope.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sapl/legacy/scripts/exporta_zope/exporta_zope.py b/sapl/legacy/scripts/exporta_zope/exporta_zope.py index c7442654e..e84a4d13b 100755 --- a/sapl/legacy/scripts/exporta_zope/exporta_zope.py +++ b/sapl/legacy/scripts/exporta_zope/exporta_zope.py @@ -333,7 +333,9 @@ def build_salvar(repo): def salvar(fullname, conteudo): sha = hashlib.sha256() sha.update(conteudo) - if sha.hexdigest() not in hashes: + if sha.hexdigest() in hashes: + print('- hash encontrado - {}'.format(fullname)) + else: fullname = ajusta_extensao(fullname, conteudo) if os.path.exists(fullname): # destrava arquivo pré-existente (o conteúdo mudou) @@ -355,7 +357,7 @@ def dump_sapl(sigla): destino.mkdir(parents=True) repo = git.Repo.init(destino) if TAG_ZOPE in repo.tags: - info('A exportação de documentos já está feita.') + print('A exportação de documentos já está feita -- abortando') return repo_execute(repo, 'git annex init')