Skip to content

Commit

Permalink
remove unused ManifestSlices
Browse files Browse the repository at this point in the history
  • Loading branch information
letFunny committed Sep 30, 2024
1 parent 8445042 commit a9ee6ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
12 changes: 4 additions & 8 deletions internal/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,10 @@ func FindPaths(slices []*setup.Slice) map[string][]*setup.Slice {
type WriteOptions struct {
PackageInfo []*archive.PackageInfo
Selection []*setup.Slice
// Map manifest path to all the slices that declare it. See
// manifest.FindPaths.
ManifestSlices map[string][]*setup.Slice
Report *Report
Report *Report
}

func Write(options *WriteOptions, writer io.Writer) error {
if len(options.ManifestSlices) == 0 {
// Nothing to do.
return nil
}
dbw := jsonwall.NewDBWriter(&jsonwall.DBWriterOptions{
Schema: Schema,
})
Expand Down Expand Up @@ -270,6 +263,9 @@ func manifestAddSlices(dbw *jsonwall.DBWriter, slices []*setup.Slice) error {
}

func manifestAddReport(dbw *jsonwall.DBWriter, report *Report) error {
if report == nil {
return nil
}
for _, entry := range report.Entries {
sliceNames := []string{}
for slice := range entry.Slices {
Expand Down
4 changes: 0 additions & 4 deletions internal/manifest/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,6 @@ func (s *S) TestGenerateManifests(c *C) {
}

options := &manifest.WriteOptions{
ManifestSlices: map[string][]*setup.Slice{
"/dir/manifest.wall": {slice1},
"/other-dir/manifest.wall": {slice1},
},
PackageInfo: packageInfo,
Selection: []*setup.Slice{slice1, slice2},
Report: report,
Expand Down
7 changes: 3 additions & 4 deletions internal/slicer/slicer.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,9 @@ func generateManifests(targetDir string, selection *setup.Selection,
}
defer w.Close()
writeOptions := &manifest.WriteOptions{
ManifestSlices: manifestSlices,
PackageInfo: pkgInfos,
Selection: selection.Slices,
Report: report,
PackageInfo: pkgInfos,
Selection: selection.Slices,
Report: report,
}
err = manifest.Write(writeOptions, w)
return err
Expand Down

0 comments on commit a9ee6ac

Please sign in to comment.