xmake-io / xrepo

🗂️ A cross-platform C/C++ package manager based on Xmake
https://xrepo.xmake.io
Apache License 2.0
354 stars 18 forks source link

Question: `xrepo install -f "name=val"` vs `xrepo install -f "name='val'"` #20

Closed Rinkaa closed 2 years ago

Rinkaa commented 2 years ago

Describe the bug

-f "someconfig" makes no effect for xrepo install; In the following commands, the config -f "glfw_include=es3" is ignored and makes no effect.

> xrepo install -f "glfw_include=es3" glfw
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo-dev:
  -> glfw 3.3.4 
please input: y (y/n/m)
y
  => install glfw 3.3.4 .. ok
> xrepo scan glfw
scanning packages ..
glfw-3.3.4:
  -> 58b838c9240946ef80fade0f66a356e9: linux, x86_64
    -> {debug=false,shared=false,glfw_include="none",pic=true}

Expected behavior

Package with the given configs should be installed, eg. providing {glfw_include="es3"}

Related Environment

Rinkaa commented 2 years ago
> xrepo install -f "glfw_include='es3'" glfw
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo-dev:
  -> glfw 3.3.4 [glfw_include:es3]
please input: y (y/n/m)

哦……原来需要个引号括起来 OTZ||| 但是xrepo --help和文档里面都有xrepo install -f "vs_runtime=MD" zlib这个例子,这里MD没用引号是因为MD是个变量么

waruqi commented 2 years ago
> xrepo install -f "glfw_include='es3'" glfw
note: install or modify (m) these packages (pass -y to skip confirm)?
in xmake-repo-dev:
  -> glfw 3.3.4 [glfw_include:es3]
please input: y (y/n/m)

哦……原来需要个引号括起来 OTZ||| 但是xrepo --help和文档里面都有xrepo install -f "vs_runtime=MD" zlib这个例子,这里MD没用引号是因为MD是个变量么

文档里面也是不对的,可以帮忙修复下

目前解析直接依赖 lua ,所以就是 {xxx="foo"} 的table解析,string value 要有 ""

Rinkaa commented 2 years ago

备忘: 另一个相似的命令是 xmake f --vs_runtime=MD, 不过这里的参数不带引号也会被识别成字符串