[WIP] feat(report): show repository of affected pkgs (#713)
feat(report): show repository of affected pkgs
This commit is contained in:
		@@ -709,9 +709,17 @@ func setChangelogLayout(g *gocui.Gui) error {
 | 
			
		||||
		for _, affected := range vinfo.AffectedPackages {
 | 
			
		||||
			// packages detected by OVAL may not be actually installed
 | 
			
		||||
			if pack, ok := currentScanResult.Packages[affected.Name]; ok {
 | 
			
		||||
				lines = append(lines,
 | 
			
		||||
					"* "+pack.FormatVersionFromTo(
 | 
			
		||||
						affected.NotFixedYet, affected.FixState))
 | 
			
		||||
				var line string
 | 
			
		||||
				if pack.Repository != "" {
 | 
			
		||||
					line = fmt.Sprintf("* %s (%s)",
 | 
			
		||||
						pack.FormatVersionFromTo(affected.NotFixedYet, affected.FixState),
 | 
			
		||||
						pack.Repository)
 | 
			
		||||
				} else {
 | 
			
		||||
					line = fmt.Sprintf("* %s",
 | 
			
		||||
						pack.FormatVersionFromTo(affected.NotFixedYet, affected.FixState),
 | 
			
		||||
					)
 | 
			
		||||
				}
 | 
			
		||||
				lines = append(lines, line)
 | 
			
		||||
 | 
			
		||||
				if len(pack.AffectedProcs) != 0 {
 | 
			
		||||
					for _, p := range pack.AffectedProcs {
 | 
			
		||||
 
 | 
			
		||||
@@ -203,8 +203,18 @@ No CVE-IDs are found in updatable packages.
 | 
			
		||||
		vuln.AffectedPackages.Sort()
 | 
			
		||||
		for _, affected := range vuln.AffectedPackages {
 | 
			
		||||
			if pack, ok := r.Packages[affected.Name]; ok {
 | 
			
		||||
				data = append(data, []string{"Affected PKG",
 | 
			
		||||
					pack.FormatVersionFromTo(affected.NotFixedYet, affected.FixState)})
 | 
			
		||||
				var line string
 | 
			
		||||
				if pack.Repository != "" {
 | 
			
		||||
					line = fmt.Sprintf("%s (%s)",
 | 
			
		||||
						pack.FormatVersionFromTo(affected.NotFixedYet, affected.FixState),
 | 
			
		||||
						pack.Repository)
 | 
			
		||||
				} else {
 | 
			
		||||
					line = fmt.Sprintf("%s",
 | 
			
		||||
						pack.FormatVersionFromTo(affected.NotFixedYet, affected.FixState),
 | 
			
		||||
					)
 | 
			
		||||
				}
 | 
			
		||||
				data = append(data, []string{"Affected Pkg", line})
 | 
			
		||||
 | 
			
		||||
				if len(pack.AffectedProcs) != 0 {
 | 
			
		||||
					for _, p := range pack.AffectedProcs {
 | 
			
		||||
						data = append(data, []string{"",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user