@@ -59,19 +59,18 @@ def sign_rpm_package(
5959 sign_cmd_parts .extend (['-D' , f"'_gpg_name { keyid } '" , path ])
6060 sign_cmd = ' ' .join (sign_cmd_parts )
6161 final_cmd = f'/bin/bash -c "{ sign_cmd } "'
62- logging .info ('Deleting previous signatures' )
63- for pkg_path in path .split (' ' ):
64- logging .debug ('Deleting signature from %s' , pkg_path )
65- code , out , err = plumbum .local ['rpmsign' ].run (
66- args = ('--delsign' , pkg_path ),
67- retcode = None ,
62+ pkg_paths = path .split (' ' )
63+ logging .info ('Deleting previous signatures from %d package(s)' , len (pkg_paths ))
64+ code , out , err = plumbum .local ['rpmsign' ].run (
65+ args = ['--delsign' ] + pkg_paths ,
66+ retcode = None ,
67+ )
68+ logging .debug ('Command result: %d, %s\n %s' , code , out , err )
69+ if code != 0 :
70+ full_out = '\n ' .join ((out , err ))
71+ raise PackageSignError (
72+ f'Cannot delete package signature: { full_out } '
6873 )
69- logging .debug ('Command result: %d, %s\n %s' , code , out , err )
70- if code != 0 :
71- full_out = '\n ' .join ((out , err ))
72- raise PackageSignError (
73- f'Cannot delete package signature: { full_out } '
74- )
7574 with exclusive_lock (locks_dir_path , keyid ):
7675 out , status = pexpect .run (
7776 command = final_cmd ,
0 commit comments