0

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?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
deeps8us
  • 75
  • 1
  • 9

1 Answers1

0

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
Hugo y
  • 1,421
  • 10
  • 20