From dc175a023bf6761d7a9015d83ea4678d60ebc3db Mon Sep 17 00:00:00 2001 From: Daniel Joseph Barnhart Clark Date: Thu, 19 Jul 2007 22:30:26 +0000 Subject: Add tools for managing encaps git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3509 ce84e21b-d406-0410-9b95-82705330c041 --- tools/encap-util-xml.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 tools/encap-util-xml.sh (limited to 'tools/encap-util-xml.sh') diff --git a/tools/encap-util-xml.sh b/tools/encap-util-xml.sh new file mode 100755 index 000000000..0fdd75fe4 --- /dev/null +++ b/tools/encap-util-xml.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# $Id$ + +# This builds the XML Pkgmgr files for the encap directory +# structure created by the place script. It assumes the +# directory has a *.run file in it (from the bcfg2 encap build) + +SITEBASEURI="http://example.com/encaps" + +for RUN in $(find * -type f | grep run$); do + DIR="$(dirname $RUN)" + FILE="$(basename $RUN)" + ARCH="$(printf "$FILE" | awk -F\- '{print $4}')" + OS="$(printf "$FILE" | awk -F\- '{print $5}' | sed s:\.run$::g)" + case $OS in + *aix*) OSDIR="aix/$(printf "$OS" | sed s:aix::g)" ;; + *solaris*) OSDIR="solaris/$(printf "$OS" | sed s:solaris::g)" ;; + *linux*) OSDIR="$(printf "$OS" | sed s:\_:\/:g)" ;; + *) exit 1 + esac + XML="./xml/site-encaps-${ARCH}-${OS}.xml" + printf " $XML + printf " type='encap'\n" >> $XML + printf " uri='${SITEBASEURI}/%s/%s'>\n" "$OSDIR" "$ARCH" >> $XML + printf " \n" "$ARCH" "$OS" >> $XML + for FILE in `(cd ./$DIR && ls *-encap-*.tar.gz) | sort`; do + printf " \n" "$FILE" >> $XML + done + printf " \n" >> $XML + printf "\n" >> $XML +done + +exit 0 -- cgit v1.2.3-1-g7c22