Skip to content

Commit

Permalink
qvm-template: Slight improvements to package verification.
Browse files Browse the repository at this point in the history
  • Loading branch information
WillyPillow committed Aug 9, 2020
1 parent ed8fca6 commit b7a603b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qubesadmin/tools/qvm_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,16 +721,16 @@ 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(
'Illegal package name for package \'%s\'.' % rpmfile)
# 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...'
Expand Down

0 comments on commit b7a603b

Please sign in to comment.