From: Viktor M. <mih...@us...> - 2005-04-20 17:00:37
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13876 Modified Files: Makefile.am configure.ac sfcbrepos.sh.in Added Files: sfcbunstage.sh.in Log Message: Bug 1183788: Modifications to support uninstall of providers. Index: configure.ac =================================================================== RCS file: /cvsroot/sblim/sfcb/configure.ac,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- configure.ac 19 Apr 2005 13:21:11 -0000 1.7 +++ configure.ac 20 Apr 2005 17:00:27 -0000 1.8 @@ -133,5 +133,5 @@ AC_SUBST(MOFC_DIR) fi -AC_CONFIG_FILES([Makefile sfcb.spec sfcbrepos.sh sfcbstage.sh sfcb.cfg.pre getSchema.sh.pre]) +AC_CONFIG_FILES([Makefile sfcb.spec sfcbrepos.sh sfcbstage.sh sfcbunstage.sh sfcb.cfg.pre getSchema.sh.pre]) AC_OUTPUT Index: Makefile.am =================================================================== RCS file: /cvsroot/sblim/sfcb/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.am 11 Apr 2005 23:13:34 -0000 1.9 +++ Makefile.am 20 Apr 2005 17:00:26 -0000 1.10 @@ -155,13 +155,14 @@ EXTRA_DIST=sfcb.cfg.pre.in sfcb.spec sfcbrepos.sh.in sfcbstage.sh.in \ - sfcb.init-redhat sfcb.init-suse sfcb.init-none regressionTests doc + sfcbunstage.sh.in sfcb.init-redhat sfcb.init-suse sfcb.init-none \ + regressionTests doc dist_pkgdata_SCRIPTS=genSslCert.sh getSchema.sh dist_pkgdata_DATA=default.reg -nodist_bin_SCRIPTS=sfcbrepos sfcbstage +nodist_bin_SCRIPTS=sfcbrepos sfcbstage sfcbunstage sfcbrepos: sfcbrepos.sh sed s?$$\{prefix\}?$(prefix)?g $< > $@ @@ -169,6 +170,9 @@ sfcbstage: sfcbstage.sh sed s?$$\{prefix\}?$(prefix)?g $< > $@ +sfcbunstage: sfcbunstage.sh + sed s?$$\{prefix\}?$(prefix)?g $< > $@ + sfcb.cfg: sfcb.cfg.pre sed s?$$\{prefix\}?$(prefix)?g $< > $@ @@ -207,7 +211,7 @@ rm -f $(DESTDIR)$(initdir)/sfcb clean-local: - rm -f sfcbrepos sfcbstage sfcb.cfg getSchema.sh sfcb.init + rm -f sfcbrepos sfcbstage sfcbunstage sfcb.cfg getSchema.sh sfcb.init dist-hook: test -d "$(distdir)" && rm -rf `find $(distdir) -type d -name CVS` Index: sfcbrepos.sh.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcbrepos.sh.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sfcbrepos.sh.in 1 Apr 2005 11:55:28 -0000 1.4 +++ sfcbrepos.sh.in 20 Apr 2005 17:00:27 -0000 1.5 @@ -81,15 +81,31 @@ if [ -d $stagingdir ] && [ -f $stagingdir/default.reg ] && [ -f $cimschemadir/CIM_Schema.mof ] then - if rm -rf $registrationdir/repository && + if rm -rf $registrationdir/repository.previous && + mv -f $registrationdir/repository $registrationdir/repository.previous && + mv -f $registrationdir/providerRegister $registrationdir/providerRegister.previous && mkdir -p $registrationdir/repository/root/cimv2 && - cp $stagingdir/default.reg $registrationdir/providerRegister && - cat $stagingdir/regs/*.reg >> $registrationdir/providerRegister && - sfcbmof -o $registrationdir/repository/root/cimv2/classSchemas -I $cimschemadir -i CIM_Schema.mof $stagingdir/mofs/*.mof - then + cp $stagingdir/default.reg $registrationdir/providerRegister + then + if ls $stagingdir/regs/*.reg > /dev/null 2>&1 + then + if ! cat $stagingdir/regs/*.reg >> $registrationdir/providerRegister + then + echo Failed copying the registration files. >&2 + exit 1 + fi + fi + if ls $stagingdir/mofs/*.mof > /dev/null 2>&1 + then + if ! sfcbmof -o $registrationdir/repository/root/cimv2/classSchemas -I $cimschemadir -i CIM_Schema.mof $stagingdir/mofs/*.mof + then + echo Failed compiling the MOF files. >&2 + exit 1 + fi + fi exit 0 else - echo Failed to create sfcb registration. >&2 + echo Failed to write sfcb registration files. >&2 exit 1 fi else --- NEW FILE: sfcbunstage.sh.in --- #!/bin/sh function usage() { echo "usage: $0 [-h] [ -s stagingdir] [ -r regfile ] [ mof ... ] " 1>&2 } args=`getopt hr:s: $*` if [ $? != 0 ] then usage $0 exit 1 fi set -- $args while [ -n "$1" ] do case $1 in -h) help=1; shift;; -s) stagingdir=$2 shift 2;; -r) regfile=$2 shift 2;; --) shift; break;; **) break;; esac done if [ "$help" == "1" ] then usage echo -e "\t-h display help message" echo -e "\t-s specify staging directory [@localstatedir@/lib/sfcb/stage]" echo -e "\t-r specify sfcb registration file " echo echo Use this command to remove registration files from the sfcb staging area. exit 0 fi if [ -z "$*" ] && [ -z "$regfile" ] then usage $0 exit 1 fi if [ -z "$stagingdir" ] then stagingdir=@localstatedir@/lib/sfcb/stage fi if [ -n "$regfile" ] then if test -d $stagingdir/regs then rm -f $stagingdir/regs/$regfile || echo "Error: could not remove registration file " 1>&2 fi fi if [ -n "$*" ] then if test -d $stagingdir/mofs then cd $stagingdir/mofs rm -f $* || echo "Error: could not remove schema files " 1>&2 fi fi |