Browse Source

[167982] Service Pack framework
Ported the patch making code from Directory71RtmBranch to the trunk.

Noriko Hosoi 20 years ago
parent
commit
af281db655
4 changed files with 75 additions and 14 deletions
  1. 5 2
      ldap/cm/Makefile
  2. 1 1
      ldap/cm/fedora-patch.inf
  3. 68 9
      ldap/cm/newinst/setup
  4. 1 2
      ldap/cm/redhat-patch.inf

+ 5 - 2
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

+ 1 - 1
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.*
 

+ 68 - 9
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 "\<port:" "adm.conf"`
+		siepid=`getValFromAdminConf "siepid:" "adm.conf"`
+		sysuser=`getValFromAdminConf "nsSuiteSpotUser:" "local.conf"`
+		suitespotuser=`ls -l $sroot/$dsinst/config/dse.ldif | awk '{print $3}'`
+		suitespotgroup=`ls -l $sroot/$dsinst/config/dse.ldif | awk '{print $4}'`
+		admindomain=`echo $ldaphost | awk -F. '{print $5 ? $2 "." $3 "." $4 "." $5: $4 ? $2 "." $3 "." $4 : $3 ? $2 "." $3 : $2 ? $2 : ""}'`
+		if [ "$admindomain" = "" ]; then
+    		admindomain=`domainname`
+		fi
+
+		echo "In order to reconfigure your installation, the Configuration Directory"
+		echo "Administrator password is required.  Here is your current information:"
+		echo ""
+		echo "Configuration Directory: ldap://$ldaphost:$ldapport/o=NetscapeRoot"
+		echo "Configuration Administrator ID: $siepid"
+		echo ""
+		echo "At the prompt, please enter the password for the Configuration Administrator."
+		echo ""
+		echo "administrator ID: $siepid"
+		siepasswd=""
+		while [ "$siepasswd" = "" ]; do
+    		printf "Password: "
+    		read siepasswd
+		done
+
+		inffile=$sroot/setup/myinstall.inf
+		echo "[General]" > $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

+ 1 - 2
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.*