summaryrefslogtreecommitdiffstats
path: root/tools/encap-util-place.sh
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 /tools/encap-util-place.sh
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
Diffstat (limited to 'tools/encap-util-place.sh')
-rwxr-xr-xtools/encap-util-place.sh42
1 files changed, 42 insertions, 0 deletions
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