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-place.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 tools/encap-util-place.sh (limited to 'tools/encap-util-place.sh') 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 -- cgit v1.2.3-1-g7c22