diff --git a/qubesadmin/tools/qvm_template.py b/qubesadmin/tools/qvm_template.py index cbcf158..dc68ed4 100644 --- a/qubesadmin/tools/qvm_template.py +++ b/qubesadmin/tools/qvm_template.py @@ -721,9 +721,6 @@ def install( 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 install( # 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...'