Skip to content

Commit

Permalink
Add os-packages file to list all package/srpms in build
Browse files Browse the repository at this point in the history
This file is intended to be used by validation tooling to identify
orphaned packages and verify there are no file collisions in the build.

Signed-off-by: Matthew Johnson <[email protected]>
  • Loading branch information
matthewrsj committed Mar 14, 2018
1 parent 0321404 commit d587622
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion builder/bundles.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,28 @@ src=%s
}

// install all bundles in the set (including os-core) to the full chroot
return buildFullChroot(cfg, b, &set, packagerCmd, buildVersionDir, version)
err = buildFullChroot(cfg, b, &set, packagerCmd, buildVersionDir, version)
if err != nil {
return err
}

// create os-packages file for validation tools
return createOsPackagesFile(buildVersionDir)
}

// createOsPackagesFile creates a file that contains all the packages mapped to their
// srpm names for use by validation tooling to identify orphaned packages and verify
// there are no file collisions in the build.
func createOsPackagesFile(buildVersionDir string) error {
fullChroot := filepath.Join(buildVersionDir, "full")
packages, err := helpers.RunCommandOutput(
"rpm", "--root="+fullChroot, "-qa", "--queryformat", "%{NAME}\t%{SOURCERPM}\n",
)
if err != nil {
return err
}

return ioutil.WriteFile(filepath.Join(buildVersionDir, "os-packages"), packages.Bytes(), 0644)
}

// createVersionsFile creates a file that contains all the packages available for a specific
Expand Down

0 comments on commit d587622

Please sign in to comment.