问题
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