#!/bin/sh

BINDIR=$(dirname $0)
DEB_VERSION=$(dpkg-parsechangelog -SVersion)
TMP=/tmp/repo_help2man
manpage_path=$(realpath ${BINDIR}/..)

mkdir -p $TMP
cd $TMP
repo --time init -q --depth=1 -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
for cmd in init sync; do
	help2man -N -n "repo $cmd" -S "repo $cmd" -m "Repo Manual" -o ${manpage_path}/repo-${cmd}.1 repo -h "help $cmd"
done
help2man -N -n repo -S "repo" -m "Repo Manual" -o ${manpage_path}/repo.1 repo -h help
cd -
rm -rf $TMP
