@@ -973,14 +973,19 @@ func (o *redhatBase) parseNeedsRestarting(stdout string) (procs []models.NeedRes
973973// procPathToFQPN returns Fully-Qualified-Package-Name from the command
974974func (o * redhatBase ) procPathToFQPN (execCommand string ) (string , error ) {
975975 execCommand = strings .ReplaceAll (execCommand , "\x00 " , " " ) // for CentOS6.9
976- path := strings .Fields (execCommand )[0 ]
977- cmd := `LANGUAGE=en_US.UTF-8 rpm -qf --queryformat "%{NAME}-%{EPOCH}:%{VERSION}-%{RELEASE}\n" ` + path
978- r := o .exec (cmd , noSudo )
976+ cmd := fmt .Sprintf ("%s %s" , o .rpmQf (), strings .Fields (execCommand )[0 ])
977+ r := o .exec (util .PrependProxyEnv (cmd ), noSudo )
979978 if ! r .isSuccess () {
980979 return "" , xerrors .Errorf ("Failed to SSH: %s" , r )
981980 }
982- fqpn := strings .TrimSpace (r .Stdout )
983- return strings .ReplaceAll (fqpn , "-(none):" , "-" ), nil
981+ pack , ignroed , err := o .parseRpmQfLine (r .Stdout )
982+ if err != nil {
983+ return "" , xerrors .Errorf ("Failed to parse rpm -qf line: %s, err: %+v" , r .Stdout , err )
984+ }
985+ if ignroed {
986+ return "" , xerrors .Errorf ("Failed to return FQPN. line: %s, err: ignore line" , r .Stdout )
987+ }
988+ return pack .FQPN (), nil
984989}
985990
986991func (o * redhatBase ) getOwnerPkgs (paths []string ) (names []string , _ error ) {
0 commit comments