Skip to content

Commit

Permalink
Skips loaded plugins line
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelKazi committed Jul 3, 2020
1 parent 3b1fa8e commit 370deeb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Binary file added packages/.yum.go.swp
Binary file not shown.
Binary file added parse/.yum.go.swp
Binary file not shown.
5 changes: 3 additions & 2 deletions parse/yum.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (

func ParseYumListFromStdIn(stdin []string) (projectList ProjectList) {
for _, pkg := range stdin {

if strings.TrimSpace(pkg) == "Installed Packages" {
if strings.Contains(pkg, "Loaded plugins:") {
log.Println("Skipping loaded plugins")
} else if strings.TrimSpace(pkg) == "Installed Packages" {
log.Println("Found beginning line of Yum Install List")
} else {
projectList.Projects = append(projectList.Projects, doYumParseStdIn(pkg))
Expand Down
3 changes: 2 additions & 1 deletion testyum.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Loaded plugins: fastestmirror, ovl
Installed Packages
acl.x86_64 2.2.51-14.el7 @CentOS
audit-libs.x86_64 2.8.4-4.el7 @CentOS
Expand Down Expand Up @@ -144,4 +145,4 @@ yum-metadata-parser.x86_64
yum-plugin-fastestmirror.noarch 1.1.31-50.el7 @CentOS
yum-plugin-ovl.noarch 1.1.31-50.el7 @CentOS
yum-utils.noarch 1.1.31-50.el7 @CentOS
zlib.x86_64 1.2.7-18.el7 @CentOS
zlib.x86_64 1.2.7-18.el7 @CentOS

0 comments on commit 370deeb

Please sign in to comment.