Skip to content

Commit

Permalink
Revert "Add ParsePackageIndexFromJSON" (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanato committed Mar 8, 2024
1 parent 34ecd9e commit 591289d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 86 deletions.
13 changes: 0 additions & 13 deletions pkg/apk/apk.go
Expand Up @@ -3,7 +3,6 @@ package apk
import (
"archive/tar"
"compress/gzip"
"encoding/json"
"fmt"
"io"
"log"
Expand Down Expand Up @@ -44,18 +43,6 @@ func (c Context) GetApkPackages() (map[string]*apk.Package, error) {
return ParseApkIndex(resp.Body)
}

func ParsePackageIndexFromJSON(jsonAPKLIndex []byte) (map[string]*apk.Package, error) {
var idx apk.APKIndex
wolfiPackages := make(map[string]*apk.Package)

err := json.Unmarshal(jsonAPKLIndex, &idx)
if err != nil {
return nil, err
}

return getLatestPackagesMap(idx.Packages, wolfiPackages)
}

func ParseUnpackedApkIndex(indexData io.ReadCloser) (map[string]*apk.Package, error) {
wolfiPackages := make(map[string]*apk.Package)

Expand Down
9 changes: 0 additions & 9 deletions pkg/apk/apk_test.go
Expand Up @@ -40,12 +40,3 @@ func Test_ParseApkIndex(t *testing.T) {
assert.Equal(t, "4.33-r0", wolfiPackages["libev-doc"].Version)
assert.Equal(t, "0.19.0-r3", wolfiPackages["tini"].Version)
}

func Test_ParseApkIndexFromJSON(t *testing.T) {
f, err := os.ReadFile(filepath.Join("testdata", "APKINDEX.json"))
assert.NoError(t, err)

wolfiPackages, err := ParsePackageIndexFromJSON(f)
assert.NoError(t, err)
assert.Equal(t, "2201-r0", wolfiPackages["7zip"].Version)
}
64 changes: 0 additions & 64 deletions pkg/apk/testdata/APKINDEX.json

This file was deleted.

0 comments on commit 591289d

Please sign in to comment.