#!/bin/bash WORKDIR="$(git rev-parse --show-toplevel)" TEMPLATES="Documentation/maintainers/templates" pushd "${WORKDIR}/${TEMPLATES}" 1> /dev/null || exit 1 function generate_qtsdk() { local category=${1#./} local category=${category%.template} local app=${category#*/} local last_ebuild="" mkdir -p "${WORKDIR}/${category}" &> /dev/null rm -rf ${WORKDIR}/${category}/*.ebuild for current_version in `cat ${WORKDIR}/${TEMPLATES}/${category}.versions` do cp -f "${WORKDIR}/${TEMPLATES}/${category}.template" ${WORKDIR}/${category}/${app}-${current_version}.ebuild cp -f "${WORKDIR}/${TEMPLATES}/dev-qt/metadata.xml" ${WORKDIR}/${category}/ last_ebuild="${WORKDIR}/${category}/${app}-${current_version}.ebuild" done ebuild "${last_ebuild}" manifest } for category in `find . -iname *.template`; do generate_qtsdk "${category}" & done wait popd 1> /dev/null