translate maps to sequences in pkg metadata (#2553)

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman
2024-02-01 11:58:10 -05:00
committed by GitHub
parent fef0e54c0f
commit 6107e5e2ad
19 changed files with 3153 additions and 543 deletions
+187 -160
View File
@@ -21,82 +21,82 @@ func TestParseConanlock(t *testing.T) {
Type: pkg.ConanPkg,
Metadata: pkg.ConanLockEntry{
Ref: "mfast/1.2.2@my_user/my_channel#c6f6387c9b99780f0ee05e25f99d0f39",
Options: map[string]string{
"fPIC": "True",
"shared": "False",
"with_sqlite3": "False",
"boost:addr2line_location": "/usr/bin/addr2line",
"boost:asio_no_deprecated": "False",
"boost:buildid": "None",
"boost:bzip2": "True",
"boost:debug_level": "0",
"boost:diagnostic_definitions": "False",
"boost:error_code_header_only": "False",
"boost:extra_b2_flags": "None",
"boost:fPIC": "True",
"boost:filesystem_no_deprecated": "False",
"boost:header_only": "False",
"boost:i18n_backend": "deprecated",
"boost:i18n_backend_iconv": "libc",
"boost:i18n_backend_icu": "False",
"boost:layout": "system",
"boost:lzma": "False",
"boost:magic_autolink": "False",
"boost:multithreading": "True",
"boost:namespace": "boost",
"boost:namespace_alias": "False",
"boost:numa": "True",
"boost:pch": "True",
"boost:python_executable": "None",
"boost:python_version": "None",
"boost:segmented_stacks": "False",
"boost:shared": "False",
"boost:system_no_deprecated": "False",
"boost:system_use_utf8": "False",
"boost:visibility": "hidden",
"boost:with_stacktrace_backtrace": "True",
"boost:without_atomic": "False",
"boost:without_chrono": "False",
"boost:without_container": "False",
"boost:without_context": "False",
"boost:without_contract": "False",
"boost:without_coroutine": "False",
"boost:without_date_time": "False",
"boost:without_exception": "False",
"boost:without_fiber": "False",
"boost:without_filesystem": "False",
"boost:without_graph": "False",
"boost:without_graph_parallel": "True",
"boost:without_iostreams": "False",
"boost:without_json": "False",
"boost:without_locale": "False",
"boost:without_log": "False",
"boost:without_math": "False",
"boost:without_mpi": "True",
"boost:without_nowide": "False",
"boost:without_program_options": "False",
"boost:without_python": "True",
"boost:without_random": "False",
"boost:without_regex": "False",
"boost:without_serialization": "False",
"boost:without_stacktrace": "False",
"boost:without_system": "False",
"boost:without_test": "False",
"boost:without_thread": "False",
"boost:without_timer": "False",
"boost:without_type_erasure": "False",
"boost:without_wave": "False",
"boost:zlib": "True",
"boost:zstd": "False",
"bzip2:build_executable": "True",
"bzip2:fPIC": "True",
"bzip2:shared": "False",
"libbacktrace:fPIC": "True",
"libbacktrace:shared": "False",
"tinyxml2:fPIC": "True",
"tinyxml2:shared": "False",
"zlib:fPIC": "True",
"zlib:shared": "False",
Options: pkg.KeyValues{
{Key: "fPIC", Value: "True"},
{Key: "shared", Value: "False"},
{Key: "with_sqlite3", Value: "False"},
{Key: "boost:addr2line_location", Value: "/usr/bin/addr2line"},
{Key: "boost:asio_no_deprecated", Value: "False"},
{Key: "boost:buildid", Value: "None"},
{Key: "boost:bzip2", Value: "True"},
{Key: "boost:debug_level", Value: "0"},
{Key: "boost:diagnostic_definitions", Value: "False"},
{Key: "boost:error_code_header_only", Value: "False"},
{Key: "boost:extra_b2_flags", Value: "None"},
{Key: "boost:fPIC", Value: "True"},
{Key: "boost:filesystem_no_deprecated", Value: "False"},
{Key: "boost:header_only", Value: "False"},
{Key: "boost:i18n_backend", Value: "deprecated"},
{Key: "boost:i18n_backend_iconv", Value: "libc"},
{Key: "boost:i18n_backend_icu", Value: "False"},
{Key: "boost:layout", Value: "system"},
{Key: "boost:lzma", Value: "False"},
{Key: "boost:magic_autolink", Value: "False"},
{Key: "boost:multithreading", Value: "True"},
{Key: "boost:namespace", Value: "boost"},
{Key: "boost:namespace_alias", Value: "False"},
{Key: "boost:numa", Value: "True"},
{Key: "boost:pch", Value: "True"},
{Key: "boost:python_executable", Value: "None"},
{Key: "boost:python_version", Value: "None"},
{Key: "boost:segmented_stacks", Value: "False"},
{Key: "boost:shared", Value: "False"},
{Key: "boost:system_no_deprecated", Value: "False"},
{Key: "boost:system_use_utf8", Value: "False"},
{Key: "boost:visibility", Value: "hidden"},
{Key: "boost:with_stacktrace_backtrace", Value: "True"},
{Key: "boost:without_atomic", Value: "False"},
{Key: "boost:without_chrono", Value: "False"},
{Key: "boost:without_container", Value: "False"},
{Key: "boost:without_context", Value: "False"},
{Key: "boost:without_contract", Value: "False"},
{Key: "boost:without_coroutine", Value: "False"},
{Key: "boost:without_date_time", Value: "False"},
{Key: "boost:without_exception", Value: "False"},
{Key: "boost:without_fiber", Value: "False"},
{Key: "boost:without_filesystem", Value: "False"},
{Key: "boost:without_graph", Value: "False"},
{Key: "boost:without_graph_parallel", Value: "True"},
{Key: "boost:without_iostreams", Value: "False"},
{Key: "boost:without_json", Value: "False"},
{Key: "boost:without_locale", Value: "False"},
{Key: "boost:without_log", Value: "False"},
{Key: "boost:without_math", Value: "False"},
{Key: "boost:without_mpi", Value: "True"},
{Key: "boost:without_nowide", Value: "False"},
{Key: "boost:without_program_options", Value: "False"},
{Key: "boost:without_python", Value: "True"},
{Key: "boost:without_random", Value: "False"},
{Key: "boost:without_regex", Value: "False"},
{Key: "boost:without_serialization", Value: "False"},
{Key: "boost:without_stacktrace", Value: "False"},
{Key: "boost:without_system", Value: "False"},
{Key: "boost:without_test", Value: "False"},
{Key: "boost:without_thread", Value: "False"},
{Key: "boost:without_timer", Value: "False"},
{Key: "boost:without_type_erasure", Value: "False"},
{Key: "boost:without_wave", Value: "False"},
{Key: "boost:zlib", Value: "True"},
{Key: "boost:zstd", Value: "False"},
{Key: "bzip2:build_executable", Value: "True"},
{Key: "bzip2:fPIC", Value: "True"},
{Key: "bzip2:shared", Value: "False"},
{Key: "libbacktrace:fPIC", Value: "True"},
{Key: "libbacktrace:shared", Value: "False"},
{Key: "tinyxml2:fPIC", Value: "True"},
{Key: "tinyxml2:shared", Value: "False"},
{Key: "zlib:fPIC", Value: "True"},
{Key: "zlib:shared", Value: "False"},
},
Context: "host",
PackageID: "9d1f076b471417647c2022a78d5e2c1f834289ac",
@@ -112,77 +112,77 @@ func TestParseConanlock(t *testing.T) {
Type: pkg.ConanPkg,
Metadata: pkg.ConanLockEntry{
Ref: "boost/1.75.0#a9c318f067216f900900e044e7af4ab1",
Options: map[string]string{
"addr2line_location": "/usr/bin/addr2line",
"asio_no_deprecated": "False",
"buildid": "None",
"bzip2": "True",
"debug_level": "0",
"diagnostic_definitions": "False",
"error_code_header_only": "False",
"extra_b2_flags": "None",
"fPIC": "True",
"filesystem_no_deprecated": "False",
"header_only": "False",
"i18n_backend": "deprecated",
"i18n_backend_iconv": "libc",
"i18n_backend_icu": "False",
"layout": "system",
"lzma": "False",
"magic_autolink": "False",
"multithreading": "True",
"namespace": "boost",
"namespace_alias": "False",
"numa": "True",
"pch": "True",
"python_executable": "None",
"python_version": "None",
"segmented_stacks": "False",
"shared": "False",
"system_no_deprecated": "False",
"system_use_utf8": "False",
"visibility": "hidden",
"with_stacktrace_backtrace": "True",
"without_atomic": "False",
"without_chrono": "False",
"without_container": "False",
"without_context": "False",
"without_contract": "False",
"without_coroutine": "False",
"without_date_time": "False",
"without_exception": "False",
"without_fiber": "False",
"without_filesystem": "False",
"without_graph": "False",
"without_graph_parallel": "True",
"without_iostreams": "False",
"without_json": "False",
"without_locale": "False",
"without_log": "False",
"without_math": "False",
"without_mpi": "True",
"without_nowide": "False",
"without_program_options": "False",
"without_python": "True",
"without_random": "False",
"without_regex": "False",
"without_serialization": "False",
"without_stacktrace": "False",
"without_system": "False",
"without_test": "False",
"without_thread": "False",
"without_timer": "False",
"without_type_erasure": "False",
"without_wave": "False",
"zlib": "True",
"zstd": "False",
"bzip2:build_executable": "True",
"bzip2:fPIC": "True",
"bzip2:shared": "False",
"libbacktrace:fPIC": "True",
"libbacktrace:shared": "False",
"zlib:fPIC": "True",
"zlib:shared": "False",
Options: pkg.KeyValues{
{Key: "addr2line_location", Value: "/usr/bin/addr2line"},
{Key: "asio_no_deprecated", Value: "False"},
{Key: "buildid", Value: "None"},
{Key: "bzip2", Value: "True"},
{Key: "debug_level", Value: "0"},
{Key: "diagnostic_definitions", Value: "False"},
{Key: "error_code_header_only", Value: "False"},
{Key: "extra_b2_flags", Value: "None"},
{Key: "fPIC", Value: "True"},
{Key: "filesystem_no_deprecated", Value: "False"},
{Key: "header_only", Value: "False"},
{Key: "i18n_backend", Value: "deprecated"},
{Key: "i18n_backend_iconv", Value: "libc"},
{Key: "i18n_backend_icu", Value: "False"},
{Key: "layout", Value: "system"},
{Key: "lzma", Value: "False"},
{Key: "magic_autolink", Value: "False"},
{Key: "multithreading", Value: "True"},
{Key: "namespace", Value: "boost"},
{Key: "namespace_alias", Value: "False"},
{Key: "numa", Value: "True"},
{Key: "pch", Value: "True"},
{Key: "python_executable", Value: "None"},
{Key: "python_version", Value: "None"},
{Key: "segmented_stacks", Value: "False"},
{Key: "shared", Value: "False"},
{Key: "system_no_deprecated", Value: "False"},
{Key: "system_use_utf8", Value: "False"},
{Key: "visibility", Value: "hidden"},
{Key: "with_stacktrace_backtrace", Value: "True"},
{Key: "without_atomic", Value: "False"},
{Key: "without_chrono", Value: "False"},
{Key: "without_container", Value: "False"},
{Key: "without_context", Value: "False"},
{Key: "without_contract", Value: "False"},
{Key: "without_coroutine", Value: "False"},
{Key: "without_date_time", Value: "False"},
{Key: "without_exception", Value: "False"},
{Key: "without_fiber", Value: "False"},
{Key: "without_filesystem", Value: "False"},
{Key: "without_graph", Value: "False"},
{Key: "without_graph_parallel", Value: "True"},
{Key: "without_iostreams", Value: "False"},
{Key: "without_json", Value: "False"},
{Key: "without_locale", Value: "False"},
{Key: "without_log", Value: "False"},
{Key: "without_math", Value: "False"},
{Key: "without_mpi", Value: "True"},
{Key: "without_nowide", Value: "False"},
{Key: "without_program_options", Value: "False"},
{Key: "without_python", Value: "True"},
{Key: "without_random", Value: "False"},
{Key: "without_regex", Value: "False"},
{Key: "without_serialization", Value: "False"},
{Key: "without_stacktrace", Value: "False"},
{Key: "without_system", Value: "False"},
{Key: "without_test", Value: "False"},
{Key: "without_thread", Value: "False"},
{Key: "without_timer", Value: "False"},
{Key: "without_type_erasure", Value: "False"},
{Key: "without_wave", Value: "False"},
{Key: "zlib", Value: "True"},
{Key: "zstd", Value: "False"},
{Key: "bzip2:build_executable", Value: "True"},
{Key: "bzip2:fPIC", Value: "True"},
{Key: "bzip2:shared", Value: "False"},
{Key: "libbacktrace:fPIC", Value: "True"},
{Key: "libbacktrace:shared", Value: "False"},
{Key: "zlib:fPIC", Value: "True"},
{Key: "zlib:shared", Value: "False"},
},
Context: "host",
PackageID: "dc8aedd23a0f0a773a5fcdcfe1ae3e89c4205978",
@@ -198,9 +198,15 @@ func TestParseConanlock(t *testing.T) {
Type: pkg.ConanPkg,
Metadata: pkg.ConanLockEntry{
Ref: "zlib/1.2.12#c67ce17f2e96b972d42393ce50a76a1a",
Options: map[string]string{
"fPIC": "True",
"shared": "False",
Options: pkg.KeyValues{
{
Key: "fPIC",
Value: "True",
},
{
Key: "shared",
Value: "False",
},
},
Context: "host",
PackageID: "dfbe50feef7f3c6223a476cd5aeadb687084a646",
@@ -216,10 +222,19 @@ func TestParseConanlock(t *testing.T) {
Type: pkg.ConanPkg,
Metadata: pkg.ConanLockEntry{
Ref: "bzip2/1.0.8#62a8031289639043797cf53fa876d0ef",
Options: map[string]string{
"build_executable": "True",
"fPIC": "True",
"shared": "False",
Options: []pkg.KeyValue{
{
Key: "build_executable",
Value: "True",
},
{
Key: "fPIC",
Value: "True",
},
{
Key: "shared",
Value: "False",
},
},
Context: "host",
PackageID: "c32092bf4d4bb47cf962af898e02823f499b017e",
@@ -235,9 +250,15 @@ func TestParseConanlock(t *testing.T) {
Type: pkg.ConanPkg,
Metadata: pkg.ConanLockEntry{
Ref: "libbacktrace/cci.20210118#76e40b760e0bcd602d46db56b22820ab",
Options: map[string]string{
"fPIC": "True",
"shared": "False",
Options: []pkg.KeyValue{
{
Key: "fPIC",
Value: "True",
},
{
Key: "shared",
Value: "False",
},
},
Context: "host",
PackageID: "dfbe50feef7f3c6223a476cd5aeadb687084a646",
@@ -253,9 +274,15 @@ func TestParseConanlock(t *testing.T) {
Type: pkg.ConanPkg,
Metadata: pkg.ConanLockEntry{
Ref: "tinyxml2/9.0.0#9f13a36ebfc222cd55fe531a0a8d94d1",
Options: map[string]string{
"fPIC": "True",
"shared": "False",
Options: []pkg.KeyValue{
{
Key: "fPIC",
Value: "True",
},
{
Key: "shared",
Value: "False",
},
},
Context: "host",
// intentionally remove to test missing PackageID and Prev