xsdgen 1.43 KB
Newer Older
1
#! /bin/sh
2 3
#
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
23
#
24

25 26
TRANGCMD="java -jar ${TRANG:-/usr/local/share/java/classes/trang.jar}"

27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
# Delete all xsd files which are around
if [ -e "top.xsd" ]; then 
  rm top.xsd 
fi
if [ -e "ptop.xsd" ]; then
  rm ptop.xsd
fi
if [ -e "vtop.xsd" ]; then
  rm vtop.xsd
fi
if [ -e "ptop-top.xsd" ]; then
  rm ptop-top.xsd
fi
if [ -e "vtop-top.xsd" ]; then
  rm vtop-top.xsd
fi

# Create the ptop file
45
$TRANGCMD ptop.rnc ptop.xsd
46 47 48 49 50
mv top.xsd ptop-top.xsd
sed 's/top.xsd/ptop-top.xsd/' ptop.xsd > ptop.tmp
mv ptop.tmp ptop.xsd

# Create the vtop file
51
$TRANGCMD vtop.rnc vtop.xsd
52 53 54
mv top.xsd vtop-top.xsd
sed 's/top.xsd/vtop-top.xsd/' vtop.xsd > vtop.tmp
mv vtop.tmp vtop.xsd