From b00c767c75ffe316e161b44e65a08381369e7ec5 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sat, 21 Jan 2023 12:52:24 +0100 Subject: reload GPG key only if it is expired --- mageiaSync/mageiaSyncExt.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mageiaSync/mageiaSyncExt.py b/mageiaSync/mageiaSyncExt.py index 37db330..b57fef8 100644 --- a/mageiaSync/mageiaSyncExt.py +++ b/mageiaSync/mageiaSyncExt.py @@ -194,9 +194,13 @@ def rename(directory,oldRelease,newRelease, nbf, nbr): entry=os.path.join(directory,entry) if os.path.isfile(entry): if name.startswith(oldRelease): - newPath = os.path.join( os.path.dirname(entry) , name.replace(oldRelease, newRelease,1)) - os.rename(entry, newPath) - nbf = nbf + 1 + # gpg keys are no more valid + if name.endswith('.gpg'): + os.remove(entry) + else: + newPath = os.path.join( os.path.dirname(entry) , name.replace(oldRelease, newRelease,1)) + os.rename(entry, newPath) + nbf = nbf + 1 if os.path.isdir(entry): nbf, nbr = rename(entry,oldRelease,newRelease, nbf, nbr) if name.startswith(oldRelease) : -- cgit v1.2.1