summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Joseph Barnhart Clark <dclark@pobox.com>2007-07-19 22:30:26 +0000
committerDaniel Joseph Barnhart Clark <dclark@pobox.com>2007-07-19 22:30:26 +0000
commitdc175a023bf6761d7a9015d83ea4678d60ebc3db (patch)
treed6bbe72eaf65e5f4fe6f668cc34262f79dd60dec
parent2fbb9258d1bd069ff4ba07fd1765201da1afa669 (diff)
downloadbcfg2-dc175a023bf6761d7a9015d83ea4678d60ebc3db.tar.gz
bcfg2-dc175a023bf6761d7a9015d83ea4678d60ebc3db.tar.bz2
bcfg2-dc175a023bf6761d7a9015d83ea4678d60ebc3db.zip
Add tools for managing encaps
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3509 ce84e21b-d406-0410-9b95-82705330c041
-rwxr-xr-xtools/encap-util-count.sh15
-rwxr-xr-xtools/encap-util-expand.sh11
-rwxr-xr-xtools/encap-util-place.sh42
-rwxr-xr-xtools/encap-util-xml.sh33
4 files changed, 101 insertions, 0 deletions
diff --git a/tools/encap-util-count.sh b/tools/encap-util-count.sh
new file mode 100755
index 000000000..848a8d648
--- /dev/null
+++ b/tools/encap-util-count.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# $Id$
+
+# This shows a count of encap packages per directory
+# Can be useful to make sure you have everything
+# built for all platforms. It assumes the directory
+# has a *.run file in it (from the bcfg2 encap build)
+
+for RUN in $(find . -type f | grep run$); do
+ DIR="$(dirname $RUN)"
+ printf "${DIR}: "
+ (cd $DIR && ls | wc -l)
+done
+
+exit 0
diff --git a/tools/encap-util-expand.sh b/tools/encap-util-expand.sh
new file mode 100755
index 000000000..2bb3f7f62
--- /dev/null
+++ b/tools/encap-util-expand.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# $Id$
+
+# This gets the encaps out of a makeself .run file
+
+for RUN in $(find . -type f | grep run$); do
+ DIR="$(dirname $RUN)"
+ $RUN --noexec --keep --target $DIR
+done
+
+exit 0
diff --git a/tools/encap-util-place.sh b/tools/encap-util-place.sh
new file mode 100755
index 000000000..c3e96ebd8
--- /dev/null
+++ b/tools/encap-util-place.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+# $Id$
+
+# This puts encaps in the right directories, creating the
+# directories if needed.
+
+getdir(){
+ case $1 in
+ *"ix86-linux_debian_etch"*) printf "linux/debian/etch/ix86/" ;;
+ *"ix86-linux_redhat_60"*) printf "linux/redhat/60/ix86/" ;;
+ *"ix86-linux_redhat_72"*) printf "linux/redhat/72/ix86/" ;;
+ *"ix86-linux_redhat_rhel4"*) printf "linux/redhat/rhel4/ix86/" ;;
+ *"ix86-linux_suse_sles10"*) printf "linux/suse/sles10/ix86/" ;;
+ *"ix86-linux_suse_sles8"*) printf "linux/suse/sles8/ix86/" ;;
+ *"rs6000-aix4.3.1"*) printf "aix/4.3.1/rs6000/" ;;
+ *"rs6000-aix4.3.3"*) printf "aix/4.3.3/rs6000/" ;;
+ *"rs6000-aix5.2.0"*) printf "aix/5.2.0/rs6000/" ;;
+ *"rs6000-aix5.3.0"*) printf "aix/5.3.0/rs6000/" ;;
+ *"sparc-solaris10"*) printf "solaris/10/sparc/" ;;
+ *"sparc-solaris8"*) printf "solaris/8/sparc/" ;;
+ *"sparc-solaris9"*) printf "solaris/9/sparc/" ;;
+ *"sparc-solaris2.6"*) printf "solaris/2.6/sparc/" ;;
+ *"x86_64-linux_suse_sles10"*) printf "linux/suse/sles10/x86_64/" ;;
+ *"-encap-share.tar.gz") printf "share/" ;;
+ *) printf "ERROR" ;;
+ esac
+}
+
+for ep in $(find . -type f | grep -v \.sh$ \
+ | grep -v epkg\.tar$ \
+ | grep -v "^\.\/xml\/"); do
+ DIR="$(getdir $ep)"
+ EPNAME="$(basename $ep)"
+ if [ "${DIR}x" != "ERRORx" ]; then
+ if [ ! -d $DIR ]; then mkdir -p $DIR; fi
+ mv $ep $DIR 2>&1 | grep -v "are the same file"
+ else
+ printf "ERROR: Don't know where to put $ep\n"
+ fi
+done
+
+exit 0
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 "<PackageList priority='0'\n" > $XML
+ printf " type='encap'\n" >> $XML
+ printf " uri='${SITEBASEURI}/%s/%s'>\n" "$OSDIR" "$ARCH" >> $XML
+ printf " <Group name='%s-%s'>\n" "$ARCH" "$OS" >> $XML
+ for FILE in `(cd ./$DIR && ls *-encap-*.tar.gz) | sort`; do
+ printf " <Package file='%s'/>\n" "$FILE" >> $XML
+ done
+ printf " </Group>\n" >> $XML
+ printf "</PackageList>\n" >> $XML
+done
+
+exit 0