#!/bin/bash

# this is used to update xml files without doing a full rebuild
# this works for any? change to XML, but only meant for devel use
# for production use, do a regular rebuild

# when adding / removing RPMs, need to do a full rebuild

ROCKS_VERSION=`rocks list attr | awk '/rocks_version/ {print $2}'`

srcdir=/export/rocks/install/site-profiles/${ROCKS_VERSION}
destdir=/export/rocks/install/rocks-dist/x86_64/build

cp ${srcdir}/graphs/default/*.xml ${destdir}/graphs/default
cp ${srcdir}/nodes/*.xml ${destdir}/nodes

# include, can have multiple directory levels
# first remove, then cp -r
for aname in `ls ${srcdir}/include`
do
  rm -rf ${destdir}/include/${aname}
  cp -r ${srcdir}/include/${aname} ${destdir}/include
done