2

I have written a manifest XML file for repo (or git-repo, Gerrit Repo, Google's Repo depending on how you like to name it). To help check my syntax, I attempted to generate a Document Type Definition (DTD) file to go with it based on the repo Manifest Format text document. When I include a <!DOCTYPE manifest SYSTEM "manifest.dtd"> line in my manifest XML file, repo silently fails to pull in the repositories.

Is it possible to include a DOCTYPE reference to a DTD inside a Repo manifest XML file and have repo still work?

Really I am checking if, I am likely to have done something wrong in my syntax or repo has some limitation int its XML parsing abilities. With no other changes in place, the manifest wot I wrote works when the DOCTYPE line is omitted.

I am relatively confident that the XML and DTD syntax is correct as I can call xmllint on the file when the DOCTYPE line is present and see it validate the XML against the DTD. It caught a couple of typos when I first ran the lint cycle, which is exactly the kind of thing I would like to be able to do by having the DTD file defined.

Here is the DTD file in question:

<!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>

I am writing a manifest for a Yocto work area so a minimal demonstration manifest.xml file is:

<?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>

With the DOCTYPE line in place, I find that repo version v1.12.37 fails silently in its initiation and subsequent syncs. Without the DOCTYPE line, you get a basic Yocto work area set up.

You need to have the manifest committed to a Git repository for repo to be happy using it.

TafT
  • 2,764
  • 6
  • 33
  • 51

0 Answers0