我为repo(或git-repo,Gerrit Repo,谷歌的Repo,根据你喜欢的名字命名)编写了一个清单XML文件。为了帮助检查我的语法,我试图根据repo Manifest Format text document生成一个文档类型定义(DTD)文件。当我在清单XML文件中包含<!DOCTYPE manifest SYSTEM "manifest.dtd">
行时,repo默默无法拉入存储库。
是否可以在Repo清单XML文件中包含对DTD的DOCTYPE引用,并且repo仍然有效?
我真的在检查我的语法是否有可能做错了什么或者repo在XML解析能力方面有一些限制。没有其他更改,我写的清单wot工作时省略DOCTYPE行。
我相对确信XML和DTD语法是正确的,因为当DOCTYPE行存在时我可以在文件上调用xmllint
并看到它根据DTD验证XML。当我第一次运行lint循环时,它遇到了一些拼写错误,这正是我希望能够通过定义DTD文件来做的事情。
以下是有问题的DTD文件:
<!ELEMENT manifest (notice?,
remote*,
default?,
manifest-server?,
remove-project*,
project*,
extend-project*,
repo-hooks?,
include*)>
<!ELEMENT notice (#PCDATA)>
<!ELEMENT remote EMPTY>
<!ATTLIST remote name ID #REQUIRED>
<!ATTLIST remote alias CDATA #IMPLIED>
<!ATTLIST remote fetch CDATA #REQUIRED>
<!ATTLIST remote pushurl CDATA #IMPLIED>
<!ATTLIST remote review CDATA #IMPLIED>
<!ATTLIST remote revision CDATA #IMPLIED>
<!ELEMENT default EMPTY>
<!ATTLIST default remote IDREF #IMPLIED>
<!ATTLIST default revision CDATA #IMPLIED>
<!ATTLIST default dest-branch CDATA #IMPLIED>
<!ATTLIST default sync-j CDATA #IMPLIED>
<!ATTLIST default sync-c CDATA #IMPLIED>
<!ATTLIST default sync-s CDATA #IMPLIED>
<!ELEMENT manifest-server EMPTY>
<!ATTLIST manifest-server url CDATA #REQUIRED>
<!ELEMENT project (annotation*,
project*,
copyfile*,
linkfile*)>
<!ATTLIST project name CDATA #REQUIRED>
<!ATTLIST project path CDATA #IMPLIED>
<!ATTLIST project remote IDREF #IMPLIED>
<!ATTLIST project revision CDATA #IMPLIED>
<!ATTLIST project dest-branch CDATA #IMPLIED>
<!ATTLIST project groups CDATA #IMPLIED>
<!ATTLIST project sync-c CDATA #IMPLIED>
<!ATTLIST project sync-s CDATA #IMPLIED>
<!ATTLIST project upstream CDATA #IMPLIED>
<!ATTLIST project clone-depth CDATA #IMPLIED>
<!ATTLIST project force-path CDATA #IMPLIED>
<!ELEMENT annotation EMPTY>
<!ATTLIST annotation name CDATA #REQUIRED>
<!ATTLIST annotation value CDATA #REQUIRED>
<!ATTLIST annotation keep CDATA "true">
<!ELEMENT copyfile EMPTY>
<!ATTLIST copyfile src CDATA #REQUIRED>
<!ATTLIST copyfile dest CDATA #REQUIRED>
<!ELEMENT linkfile EMPTY>
<!ATTLIST linkfile src CDATA #REQUIRED>
<!ATTLIST linkfile dest CDATA #REQUIRED>
<!ELEMENT extend-project EMPTY>
<!ATTLIST extend-project name CDATA #REQUIRED>
<!ATTLIST extend-project path CDATA #IMPLIED>
<!ATTLIST extend-project groups CDATA #IMPLIED>
<!ELEMENT remove-project EMPTY>
<!ATTLIST remove-project name CDATA #REQUIRED>
<!ELEMENT repo-hooks EMPTY>
<!ATTLIST repo-hooks in-project CDATA #REQUIRED>
<!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
<!ELEMENT include EMPTY>
<!ATTLIST include name CDATA #REQUIRED>
我正在为Yocto工作区编写清单,因此最小的演示manifest.xml文件是:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE manifest SYSTEM "manifest.dtd">
<manifest>
<remote name="yoctop" fetch="git://git.yoctoproject.org/"/>
<remote name="oe" fetch="git://github.com/openembedded"/>
<default sync-j="4" revision="krogoth"/>
<project name="poky" remote="yoctop" path="./"/>
<project name="meta-openembedded" remote="oe" path="meta-openembedded"/>
</manifest>
在DOCTYPE线路到位的情况下,我发现repo版本v1.12.37在其启动和后续同步中无声地失败。如果没有DOCTYPE行,您将获得基本的Yocto工作区设置。
您需要将清单提交给Git存储库,以便repo使用它。