From af281db655ec1badaa28b991724e4084a809375f Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Tue, 4 Oct 2005 17:03:47 +0000 Subject: [167982] Service Pack framework Ported the patch making code from Directory71RtmBranch to the trunk. --- ldap/cm/Makefile | 7 +++-- ldap/cm/fedora-patch.inf | 2 +- ldap/cm/newinst/setup | 77 ++++++++++++++++++++++++++++++++++++++++++------ ldap/cm/redhat-patch.inf | 3 +- 4 files changed, 75 insertions(+), 14 deletions(-) diff --git a/ldap/cm/Makefile b/ldap/cm/Makefile index 02256a76..70bb9f55 100644 --- a/ldap/cm/Makefile +++ b/ldap/cm/Makefile @@ -749,15 +749,18 @@ endif # BUILD_RPM ifdef BUILD_PATCH mkdir -p $(PATCHINSTDIR)/$(SLAPDSP) + cp $(INSTDIR)/setup $(PATCHINSTDIR)/dssetup + cp $(INSTDIR)/unzip_wrapper.pl $(PATCHINSTDIR) cp $(INSTDIR)/LICENSE.txt $(PATCHINSTDIR) cp $(INSTDIR)/README.txt $(PATCHINSTDIR) + cp $(BUILD_ROOT)/ldap/cm/newinst/setup.patch $(PATCHINSTDIR)/setup # prepare the main inf file: setup.inf pointing inf file $(SLAPDS)/$(SLAPD).inf sed -e "s/Components.*=/Components = $(SLAPDSP)/" $(INSTDIR)/setup.inf > $(PATCHINSTDIR)/setup.inf echo "" >> $(PATCHINSTDIR)/setup.inf echo "[$(SLAPDSP)]" >> $(PATCHINSTDIR)/setup.inf echo "ComponentInfoFile = $(SLAPDSP)/$(SLAPDSP).inf" >> $(PATCHINSTDIR)/setup.inf # create a zip file based upon the $(PATCHINF) file - cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); zip -r $(PATCHINSTDIR)/$(SLAPDSP)/ns$(SLAPDSP).zip `egrep file: $(PATCHINF) | awk -F: '{print $$3}'` + cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); zip -r $(PATCHINSTDIR)/$(SLAPDSP)/ns$(SLAPDSP).zip `egrep "^file:" $(PATCHINF) | awk -F: '{print $$3}'` # put ns-config and needed libs in the $(PATCHINSTDIR)/$(SLAPDSP) directory $(INSTALL) -m 755 $(RELDIR_32)/bin/slapd/admin/bin/ns-config $(PATCHINSTDIR)/$(SLAPDSP) -@for file in $(PACKAGE_SETUP_LIBS_32) ; \ @@ -767,7 +770,7 @@ ifdef BUILD_PATCH done # create patch inf file: $(SLAPD).inf cp $(OBJDIR)/slapd-patch.inf $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf - cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); ls `egrep file: $(PATCHINF) | egrep -v "setup/setup" | awk -F: '{print $$3}'` > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp + cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); ls `egrep "^file:" $(PATCHINF) | egrep -v "setup/setup" | awk -F: '{print $$3}'` > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp echo `cat $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp` | sed -e "s/ /,/g" > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2 echo "BackupFiles="`cat $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2`>> $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf rm -f $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2 diff --git a/ldap/cm/fedora-patch.inf b/ldap/cm/fedora-patch.inf index be5c87a6..9cc6e2d8 100644 --- a/ldap/cm/fedora-patch.inf +++ b/ldap/cm/fedora-patch.inf @@ -43,5 +43,5 @@ base: /share/dev4/fedora-ds/fds71/ships/20050526.1 file: 000001: README.txt -file: 000002: COPYRIGHT.txt +file: 000002: lib/libback-ldbm.* diff --git a/ldap/cm/newinst/setup b/ldap/cm/newinst/setup index 3d7819ed..f71a6fdb 100755 --- a/ldap/cm/newinst/setup +++ b/ldap/cm/newinst/setup @@ -130,6 +130,13 @@ getFQDN() { echo $maxhost } +getValFromAdminConf() { + cattr=$1 + cfile=$2 + rval=`grep -i $cattr $sroot/admin-serv/config/$cfile | awk '{print $2}'` + echo $rval +} + logfile=`doMktmp log` myargs= silent= @@ -188,6 +195,61 @@ if ! [ $silent ]; then askYN "Continue?" fi +# check whether it is an in-place installation +if [ -f $sroot/admin-serv/config/adm.conf ]; then + dsinst=`getValFromAdminConf "ldapStart:" "adm.conf" | awk -F/ '{print $1}'` + if [ -f $sroot/$dsinst/config/dse.ldif ]; then + # it is an in=place installation + ldaphost=`getValFromAdminConf "ldapHost:" "adm.conf"` + ldapport=`getValFromAdminConf "ldapPort:" "adm.conf"` + adminport=`getValFromAdminConf "\ $inffile + echo "FullMachineName= $ldaphost" >> $inffile + echo "SuiteSpotUserID= $suitespotuser" >> $inffile + echo "SuitespotGroup= $suitespotgroup" >> $inffile + echo "ServerRoot= $sroot" >> $inffile + echo "ConfigDirectoryLdapURL= ldap://$ldaphost:$ldapport/o=NetscapeRoot" >> $inffile + echo "ConfigDirectoryAdminID= $siepid" >> $inffile + echo "AdminDomain= $admindomain" >> $inffile + echo "ConfigDirectoryAdminPwd= $siepasswd" >> $inffile + echo "" >> $inffile + echo "[admin]" >> $inffile + echo "ServerAdminID= $siepid" >> $inffile + echo "ServerAdminPwd= $siepasswd" >> $inffile + echo "SysUser= $sysuser" >> $inffile + echo "Port= $adminport" >> $inffile + echo "ServerIpAddress=" >> $inffile + + # set silent mode + silent=1 + fi +fi + # dsktune if ! [ $silent ]; then bin/slapd/server/dsktune | tee -a $logfile @@ -251,13 +313,10 @@ if ! [ $silent ]; then # check if ds instance directory exists or not # if it does, run ns-config with the reconfigure option doreconfig="" - for x in `ls -d slapd-*` - do - if [ -d $x ]; then - doreconfig="-r" - break - fi - done + ls -d slapd-* > /dev/null 2>&1 + if [ $? -eq 0 ]; then + doreconfig="-r" + fi # first, run ds cd bin/slapd/admin/bin @@ -266,7 +325,7 @@ if ! [ $silent ]; then # next, run admin cd bin/admin - ./ns-config -f $inffile -l $logfile -m $installmode || doExit + ./ns-config -f $inffile -l $logfile -m $installmode $doreconfig || doExit cd ../.. fi @@ -278,7 +337,7 @@ fi `pwd`/bin/slapd/admin/bin/ns-update $silentarg $myargs -f $inffile | tee -a $logfile || doExit -`pwd`/bin/admin/ns-update $silentarg $myargs -f $inffile | tee -a $logfile || doExit +`pwd`/bin/admin/ns-update $doreconfig $silentarg $myargs -f $inffile | tee -a $logfile || doExit echo "INFO Finished with setup, logfile is setup/setup.log" | tee -a $logfile if [ -f setup/setup.log ] ; then diff --git a/ldap/cm/redhat-patch.inf b/ldap/cm/redhat-patch.inf index be5c87a6..5c48aa09 100644 --- a/ldap/cm/redhat-patch.inf +++ b/ldap/cm/redhat-patch.inf @@ -43,5 +43,4 @@ base: /share/dev4/fedora-ds/fds71/ships/20050526.1 file: 000001: README.txt -file: 000002: COPYRIGHT.txt - +file: 000002: lib/libback-ldbm.* -- cgit