如何在Apt引脚定义中包含逗号?
我想创建一个Apt首选项文件,其引脚定义与源自Google, Inc.
。的软件包相匹配。
以下定义似乎没有做任何事情:
Package: * Pin: release o=Google, Inc. Pin-priority: 900
我怀疑逗号引起了问题。 我该怎么逃避呢?
以下都没有奏效:
-
release o="Google, Inc."
-
release o='Google, Inc.'
-
release o=Google\, Inc.
-
release o=Google\\, Inc.
奇怪的是,以下内容确实与Google, Inc.
成功匹配:
-
release o=Google? Inc.
但这不是我正在寻找的解决方案。 我想知道如何在不诉诸(不稳定)通配符的情况下匹配Google, Inc.
..
更多信息:
$ apt-cache policy | grep -C 1 'Google, Inc.' 500 http://dl.google.com/linux/earth/deb/ stable/main amd64 Packages release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main origin dl.google.com 500 http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main origin dl.google.com $ grep Origin /var/lib/apt/lists/dl.google.com_*_Release /var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_Release:Origin: Google, Inc. /var/lib/apt/lists/dl.google.com_linux_earth_deb_dists_stable_Release:Origin: Google, Inc.
不是你想要做的,但它可能对你有效,尝试:
Pin: origin dl.google.com
放弃尝试通过发布将其固定后,我决定使用此function,只要您没有来自此主机的任何其他回购,它就会产生相同的效果……
如果你逃避逗号,空格也应该被转义,如:
o = Google \,\ Inc.