From b7a603b9fee8ea4211f6cbc8d50ce720b7d510d0 Mon Sep 17 00:00:00 2001 From: WillyPillow Date: Mon, 10 Aug 2020 01:30:31 +0800 Subject: [PATCH] qvm-template: Slight improvements to package verification. --- qubesadmin/tools/qvm_template.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qubesadmin/tools/qvm_template.py b/qubesadmin/tools/qvm_template.py index cbcf158b..dc68ed49 100644 --- a/qubesadmin/tools/qvm_template.py +++ b/qubesadmin/tools/qvm_template.py @@ -721,9 +721,6 @@ def verify(rpmfile, reponame): if not package_hdr: parser.error('Package \'%s\' verification failed.' % rpmfile) - if reponame != '@commandline': - os.rename(path, rpmfile) - package_name = package_hdr[rpm.RPMTAG_NAME] if not package_name.startswith(PACKAGE_NAME_PREFIX): parser.error( @@ -731,6 +728,9 @@ def verify(rpmfile, reponame): # Remove prefix to get the real template name name = package_name[len(PACKAGE_NAME_PREFIX):] + if path != rpmfile: + os.rename(path, rpmfile) + # Check if already installed if not override_existing and name in app.domains: print(('Template \'%s\' already installed, skipping...'