mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
update split in py package_cataloger to cap at 2 (#549)
Signed-off-by: Christopher Angelo Phillips <christopher.phillips@anchore.com>
This commit is contained in:
parent
7d13fbf0d4
commit
9ea6330ebc
@ -78,6 +78,8 @@ func TestPythonPackageWheelCataloger(t *testing.T) {
|
|||||||
{Path: "Pygments-2.6.1.dist-info/RECORD"},
|
{Path: "Pygments-2.6.1.dist-info/RECORD"},
|
||||||
{Path: "pygments/__pycache__/__init__.cpython-38.pyc"},
|
{Path: "pygments/__pycache__/__init__.cpython-38.pyc"},
|
||||||
{Path: "pygments/util.py", Digest: &pkg.PythonFileDigest{"sha256", "586xXHiJGGZxqk5PMBu3vBhE68DLuAe5MBARWrSPGxA"}, Size: "10778"},
|
{Path: "pygments/util.py", Digest: &pkg.PythonFileDigest{"sha256", "586xXHiJGGZxqk5PMBu3vBhE68DLuAe5MBARWrSPGxA"}, Size: "10778"},
|
||||||
|
|
||||||
|
{Path: "pygments/x_util.py", Digest: &pkg.PythonFileDigest{"sha256", "qpzzsOW31KT955agi-7NS--90I0iNiJCyLJQnRCHgKI="}, Size: "10778"},
|
||||||
},
|
},
|
||||||
TopLevelPackages: []string{"pygments", "something_else"},
|
TopLevelPackages: []string{"pygments", "something_else"},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/anchore/syft/internal/log"
|
||||||
"github.com/anchore/syft/syft/pkg"
|
"github.com/anchore/syft/syft/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -38,10 +39,10 @@ func parseWheelOrEggRecord(reader io.Reader) ([]pkg.PythonFileRecord, error) {
|
|||||||
if item == "" {
|
if item == "" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fields := strings.Split(item, "=")
|
fields := strings.SplitN(item, "=", 2)
|
||||||
|
|
||||||
if len(fields) != 2 {
|
if len(fields) != 2 {
|
||||||
return nil, fmt.Errorf("unexpected python record digest: %q", item)
|
log.Warnf("unexpected python record digest: %q", item)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
record.Digest = &pkg.PythonFileDigest{
|
record.Digest = &pkg.PythonFileDigest{
|
||||||
|
|||||||
@ -32,6 +32,7 @@ func TestParseWheelEggRecord(t *testing.T) {
|
|||||||
{Path: "Pygments-2.6.1.dist-info/RECORD"},
|
{Path: "Pygments-2.6.1.dist-info/RECORD"},
|
||||||
{Path: "pygments/__pycache__/__init__.cpython-38.pyc"},
|
{Path: "pygments/__pycache__/__init__.cpython-38.pyc"},
|
||||||
{Path: "pygments/util.py", Digest: &pkg.PythonFileDigest{"sha256", "586xXHiJGGZxqk5PMBu3vBhE68DLuAe5MBARWrSPGxA"}, Size: "10778"},
|
{Path: "pygments/util.py", Digest: &pkg.PythonFileDigest{"sha256", "586xXHiJGGZxqk5PMBu3vBhE68DLuAe5MBARWrSPGxA"}, Size: "10778"},
|
||||||
|
{Path: "pygments/x_util.py", Digest: &pkg.PythonFileDigest{"sha256", "qpzzsOW31KT955agi-7NS--90I0iNiJCyLJQnRCHgKI="}, Size: "10778"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,4 +2,5 @@
|
|||||||
Pygments-2.6.1.dist-info/AUTHORS,sha256=PVpa2_Oku6BGuiUvutvuPnWGpzxqFy2I8-NIrqCvqUY,8449
|
Pygments-2.6.1.dist-info/AUTHORS,sha256=PVpa2_Oku6BGuiUvutvuPnWGpzxqFy2I8-NIrqCvqUY,8449
|
||||||
Pygments-2.6.1.dist-info/RECORD,,
|
Pygments-2.6.1.dist-info/RECORD,,
|
||||||
pygments/__pycache__/__init__.cpython-38.pyc,,
|
pygments/__pycache__/__init__.cpython-38.pyc,,
|
||||||
pygments/util.py,sha256=586xXHiJGGZxqk5PMBu3vBhE68DLuAe5MBARWrSPGxA,10778
|
pygments/util.py,sha256=586xXHiJGGZxqk5PMBu3vBhE68DLuAe5MBARWrSPGxA,10778
|
||||||
|
pygments/x_util.py,sha256=qpzzsOW31KT955agi-7NS--90I0iNiJCyLJQnRCHgKI=,10778
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user