blob: a582322e1f98b1725cc6dbb06eb8dba3163556ca [file] [log] [blame]
Zack Williams3ed9f712017-05-03 12:29:17 -07001#!/usr/bin/env bash
2# validate_manifest.sh
3#
4# Validates the repo manifest, per the DTD format given here:
5# https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.txt
6
7echo "Verifying default.xml using manifest.dtd"
8
9# check that xmllint is available
10if ! [ -x "$(command -v xmllint)" ]
11then
12 echo "Please install 'xmllint' to use this script"
13 exit 1
14fi
15
16# run the verification
17xmllint --noout --dtdvalid manifest.dtd default.xml
18status=$?
19
20if [ $status -ne 0 ]
21then
22 echo "FAILURE: default.xml isn't valid - exit status: $status"
23 exit $status
24else
25 echo "SUCCESS: default.xml validated correctly"
26 exit 0
27fi