Skip to content

Commit

Permalink
fix: remove unused Version field
Browse files Browse the repository at this point in the history
  • Loading branch information
letFunny committed Oct 14, 2024
1 parent 022d771 commit 8b541e6
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 28 deletions.
1 change: 0 additions & 1 deletion cmd/chisel/cmd_cut.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func (cmd *cmdCut) Execute(args []string) error {
for archiveName, archiveInfo := range release.Archives {
openArchive, err := archive.Open(&archive.Options{
Label: archiveName,
Version: archiveInfo.Version,
Arch: cmd.Arch,
Suites: archiveInfo.Suites,
Components: archiveInfo.Components,
Expand Down
1 change: 0 additions & 1 deletion cmd/chisel/cmd_find_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ var sampleRelease = &setup.Release{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy", "jammy-security"},
Components: []string{"main", "other"},
},
Expand Down
1 change: 0 additions & 1 deletion internal/setup/fetch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func (s *S) TestFetch(c *C) {

archive := release.Archives["ubuntu"]
c.Assert(archive.Name, Equals, "ubuntu")
c.Assert(archive.Version, Equals, "22.04")

// Fetch multiple times and use a marker file inside
// the release directory to check if caching is both
Expand Down
6 changes: 0 additions & 6 deletions internal/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ type Release struct {
// Archive is the location from which binary packages are obtained.
type Archive struct {
Name string
Version string
Suites []string
Components []string
PubKeys []*packet.PublicKey
Expand Down Expand Up @@ -371,7 +370,6 @@ type yamlRelease struct {
}

type yamlArchive struct {
Version string `yaml:"version"`
Suites []string `yaml:"suites"`
Components []string `yaml:"components"`
Default bool `yaml:"default"`
Expand Down Expand Up @@ -514,9 +512,6 @@ func parseRelease(baseDir, filePath string, data []byte) (*Release, error) {
}

for archiveName, details := range yamlVar.Archives {
if details.Version == "" {
return nil, fmt.Errorf("%s: archive %q missing version field", fileName, archiveName)
}
if len(details.Suites) == 0 {
return nil, fmt.Errorf("%s: archive %q missing suites field", fileName, archiveName)
}
Expand Down Expand Up @@ -544,7 +539,6 @@ func parseRelease(baseDir, filePath string, data []byte) (*Release, error) {
}
release.Archives[archiveName] = &Archive{
Name: archiveName,
Version: details.Version,
Suites: details.Suites,
Components: details.Components,
PubKeys: archiveKeys,
Expand Down
18 changes: 0 additions & 18 deletions internal/setup/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy", "jammy-security"},
Components: []string{"main", "other"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -122,7 +121,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -184,7 +182,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -445,7 +442,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -660,7 +656,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -700,7 +695,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -741,7 +735,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -797,14 +790,12 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"foo": {
Name: "foo",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
},
"bar": {
Name: "bar",
Version: "22.04",
Suites: []string{"jammy-updates"},
Components: []string{"universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -866,7 +857,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy", "jammy-security"},
Components: []string{"main", "other"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -924,14 +914,12 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"foo": {
Name: "foo",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{extraTestKey.PubKey},
},
"bar": {
Name: "bar",
Version: "22.04",
Suites: []string{"jammy-updates"},
Components: []string{"universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey, extraTestKey.PubKey},
Expand Down Expand Up @@ -1045,7 +1033,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -1098,7 +1085,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -1168,7 +1154,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -1340,7 +1325,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -1390,7 +1374,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down Expand Up @@ -1482,7 +1465,6 @@ var setupTests = []setupTest{{
Archives: map[string]*setup.Archive{
"ubuntu": {
Name: "ubuntu",
Version: "22.04",
Suites: []string{"jammy"},
Components: []string{"main", "universe"},
PubKeys: []*packet.PublicKey{testKey.PubKey},
Expand Down
1 change: 0 additions & 1 deletion internal/slicer/slicer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,6 @@ func (s *S) TestRun(c *C) {
archive := &testutil.TestArchive{
Opts: archive.Options{
Label: setupArchive.Name,
Version: setupArchive.Version,
Suites: setupArchive.Suites,
Components: setupArchive.Components,
Arch: test.arch,
Expand Down

0 comments on commit 8b541e6

Please sign in to comment.