Need to use manifest file mentioned in repo init

主宰稳场 提交于 2021-01-29 16:01:11

问题


I have a repo init command of the format repo init -u url -m manifest.xml. This manifest file name will vary. After repo init and repo sync, I need to use that manifest name in my shell script. Any environment variable exists for that?


回答1:


You can find the name of your current manifest file in .repo/manifest.xml.

You will find such a file:

<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT EDIT THIS FILE!  It is generated by repo and changes will be discarded.
If you want to use a different manifest, use `repo init -m <file>` instead.

If you want to customize your checkout by overriding manifest settings, use
the local_manifests/ directory instead.

For more information on repo manifests, check out:
https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
-->
<manifest>
  <include name="default.xml" />
</manifest>

This correspond to repo init -u url -m default.xml.


To get the value in your terminal you can use xmllint (libxml2-utils package):

xmllint --xpath "string(//include/@name)" .repo/manifest.xml


来源:https://stackoverflow.com/questions/61006956/need-to-use-manifest-file-mentioned-in-repo-init

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!