本文档翻译自:https://docs.conan.io/en/latest/reference/commands/output/search.html
:::success
Warning
这是一项实验性功能,可能会在将来的发行版中进行重大更改。
:::
conan search
提供--json
参数来生成包含搜索过程信息的文件。
输出JSON包含两个第一级密钥:
- error:如果上传完成没有错误,则为True,否则为False。
- results:包含软件包的遥控器列表。 每个元素包含:
- remote:远端名称。
- items:在该遥控器中找到的项目列表。 对于每个项目,总会有一个配方,还可以在搜索时打包。
- recipe:代表上载配方的文档。
- id:参考,例如“ openssl / 1.0.2u”
- packages:代表为配方找到的二进制包的元素列表。
- id:包ID,例如“ 8018a4df6e7d2b4630a814fa40c81b85b9182d2b”
- options:软件包选项的字典。
- settings:字典与包的设置。
- require:软件包的需求列表。
- outdated:布尔值,用于显示包装是否已从配方中过期。
- recipe:代表上载配方的文档。
Examples:
在所有远程服务器中搜索引用: conan search eigen* -r all
{
"error": false,
"results": [{
"remote": "conan-center",
"items": [{
"recipe": {
"id": "eigen/3.3.4@conan/stable"
}
}, {
"recipe": {
"id": "eigen/3.3.5@conan/stable"
}
}, {
"recipe": {
"id": "eigen/3.3.7"
}
}, {
"recipe": {
"id": "eigen/3.3.7@conan/stable"
}
}]
}, {
"remote": "conan-community",
"items": [{
"recipe": {
"id": "eigen/3.3.4@conan/stable"
}
}, {
"recipe": {
"id": "eigen/3.3.5@conan/stable"
}
}, {
"recipe": {
"id": "eigen/3.3.7@conan/stable"
}
}]
}]
}
在远程中搜索引用的软件包:conan search paho-c/1.2.0@conan/stable -r conan-center --json search.json
{
"error":false,
"results":[
{
"remote":"conan-center",
"items":[
{
"recipe":{
"id":"paho-c/1.2.0@conan/stable"
},
"packages":[
{
"id":"0000193ac313953e78a4f8e82528100030ca70ee",
"options":{
"shared":"False",
"asynchronous":"False",
"SSL":"False"
},
"settings":{
"os":"Linux",
"arch":"x86_64",
"compiler":"gcc",
"build_type":"Debug",
"compiler.version":"4.9"
},
"requires":[
],
"outdated":false
},
{
"id":"014be746b283391f79d11e4e8af3154344b58223",
"options":{
"shared":"False",
"asynchronous":"False",
"SSL":"False"
},
"settings":{
"os":"Windows",
"compiler.threads":"posix",
"compiler.exception":"seh",
"arch":"x86_64",
"compiler":"gcc",
"build_type":"Debug",
"compiler.version":"5"
},
"requires":[
],
"outdated":false
},
{
"id":"0188020dbfd167611b967ad2fa0e30710d23e920",
"options":{
"shared":"True",
"asynchronous":"False",
"SSL":"False"
},
"settings":{
"os":"Macos",
"arch":"x86_64",
"compiler":"apple-clang",
"build_type":"Debug",
"compiler.version":"9.1"
},
"requires":[
],
"outdated":false
},
{
"id":"03369b0caf8c0c8d4bb84d5136112596bde4652d",
"options":{
"shared":"True",
"asynchronous":"False",
"SSL":"False"
},
"settings":{
"os":"Linux",
"arch":"x86",
"compiler":"gcc",
"build_type":"Release",
"compiler.version":"5"
},
"requires":[
],
"outdated":false
}
]
}
]
}
]
}
在本地缓存中搜索引用:conan search paho-c* --json search.json
{
"error":false,
"results":[
{
"remote":"None",
"items":[
{
"recipe":{
"id":"paho-c/1.2.0@danimtb/testing"
}
}
]
}
]
}
在本地缓存中搜索引用的软件包:**conan search paho-c/1.2.0@danimtb/testing --json search.json**
{
"error":false,
"results":[
{
"remote":"None",
"items":[
{
"recipe":{
"id":"paho-c/1.2.0@danimtb/testing"
},
"packages":[
{
"id":"6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7",
"options":{
"SSL":"False",
"asynchronous":"False",
"shared":"False"
},
"settings":{
"arch":"x86_64",
"build_type":"Release",
"compiler":"Visual Studio",
"compiler.runtime":"MD",
"compiler.version":"15",
"os":"Windows"
},
"requires":[
],
"outdated":false
},
{
"id":"95cd13dfc3f6b80d3ccb2a38441e3a1ad88e5a15",
"options":{
"SSL":"False",
"asynchronous":"True",
"shared":"True"
},
"settings":{
"arch":"x86_64",
"build_type":"Release",
"compiler":"Visual Studio",
"compiler.runtime":"MD",
"compiler.version":"15",
"os":"Windows"
},
"requires":[
],
"outdated":true
},
{
"id":"970e773c5651dc2560f86200a4ea56c23f568ff9",
"options":{
"SSL":"False",
"asynchronous":"False",
"shared":"True"
},
"settings":{
"arch":"x86_64",
"build_type":"Release",
"compiler":"Visual Studio",
"compiler.runtime":"MD",
"compiler.version":"15",
"os":"Windows"
},
"requires":[
],
"outdated":true
},
{
"id":"c4c0a49b09575515ce1dd9841a48de0c508b9d7c",
"options":{
"SSL":"True",
"asynchronous":"False",
"shared":"True"
},
"settings":{
"arch":"x86_64",
"build_type":"Release",
"compiler":"Visual Studio",
"compiler.runtime":"MD",
"compiler.version":"15",
"os":"Windows"
},
"requires":[
"openssl/1.0.2n@conan/stable:606fdb601e335c2001bdf31d478826b644747077",
"zlib/1.2.11@conan/stable:6cc50b139b9c3d27b3e9042d5f5372d327b3a9f7"
],
"outdated":true
},
{
"id":"db9d6ba7004592ed2598f2c369484d4a01269110",
"options":{
"SSL":"True",
"asynchronous":"False",
"shared":"True"
},
"settings":{
"arch":"x86_64",
"build_type":"Release",
"compiler":"gcc",
"compiler.exception":"seh",
"compiler.threads":"posix",
"compiler.version":"7",
"os":"Windows"
},
"requires":[
"openssl/1.0.2n@conan/stable:f761d91cef7988eafb88c6b6179f4cf261609f26",
"zlib/1.2.11@conan/stable:6dc82da13f94df549e60f9c1ce4c5d11285a4dff"
],
"outdated":true
}
]
}
]
}
]
}