tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1142001 - in /tomcat/trunk: build.xml res/confinstall/server_1.xml res/confinstall/server_2.xml res/confinstall/server_3.xml res/tomcat.nsi
Date Fri, 01 Jul 2011 17:35:09 GMT
Author: markt
Date: Fri Jul  1 17:35:09 2011
New Revision: 1142001

URL: http://svn.apache.org/viewvc?rev=1142001&view=rev
Log:
Build server.xml for the installer by search and replace rather than combining fragments.
No ore work to keep the original and the fragments in sync and esy to expand to add additional
search/replace as well as insertions etc.

Removed:
    tomcat/trunk/res/confinstall/server_1.xml
    tomcat/trunk/res/confinstall/server_2.xml
    tomcat/trunk/res/confinstall/server_3.xml
Modified:
    tomcat/trunk/build.xml
    tomcat/trunk/res/tomcat.nsi

Modified: tomcat/trunk/build.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1142001&r1=1142000&r2=1142001&view=diff
==============================================================================
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Fri Jul  1 17:35:09 2011
@@ -438,7 +438,6 @@
         <exclude name="modules/**"/>
         <exclude name="**/*.mdl"/>
         <exclude name="**/*_2.xml"/>
-        <exclude name="**/*_3.xml"/>
         <exclude name="res/checkstyle/header-al2.txt"/>
         <!-- Exclude auto-generated files -->
         <exclude name="java/org/apache/el/parser/ELParser*.java" />

Modified: tomcat/trunk/res/tomcat.nsi
URL: http://svn.apache.org/viewvc/tomcat/trunk/res/tomcat.nsi?rev=1142001&r1=1142000&r2=1142001&view=diff
==============================================================================
--- tomcat/trunk/res/tomcat.nsi (original)
+++ tomcat/trunk/res/tomcat.nsi Fri Jul  1 17:35:09 2011
@@ -154,9 +154,6 @@ Var ServiceInstallLog
 
   ReserveFile "${NSISDIR}\Plugins\System.dll"
   ReserveFile "${NSISDIR}\Plugins\nsDialogs.dll"
-  ReserveFile confinstall\server_1.xml
-  ReserveFile confinstall\server_2.xml
-  ReserveFile confinstall\server_3.xml
   ReserveFile confinstall\tomcat-users_1.xml
   ReserveFile confinstall\tomcat-users_2.xml
 
@@ -802,8 +799,36 @@ FunctionEnd
 ; Writes server.xml and tomcat-users.xml
 ;
 Function configure
-  StrCpy $R4 'port="$TomcatPortHttp"'
-  StrCpy $R6 'port="$TomcatPortAjp"'
+  ; Build final server.xml
+  DetailPrint "Creating server.xml.new"
+
+  FileOpen $R1 "$INSTDIR\conf\server.xml" r
+  FileOpen $R2 "$INSTDIR\conf\server.xml.new" w
+
+  SERVER_XML_LOOP:
+    FileRead $R1 $R3
+    IfErrors SERVER_XML_LEAVELOOP
+    ${StrRep} $R4 $R3 "8080" "$TomcatPortHttp"
+    ${StrRep} $R3 $R4 "8009" "$TomcatPortAjp"
+    FileWrite $R2 $R3
+  Goto SERVER_XML_LOOP
+  SERVER_XML_LEAVELOOP:
+
+  FileClose $R1
+  FileClose $R2
+
+  ; Replace server.xml with server.xml.new
+  Delete "$INSTDIR\conf\server.xml"
+  FileOpen $R9 "$INSTDIR\conf\server.xml" w
+  Push "$INSTDIR\conf\server.xml.new"
+  Call copyFile
+  FileClose $R9
+  Delete "$INSTDIR\conf\server.xml.new"
+  
+  DetailPrint 'HTTP/1.1 Connector configured on port "$TomcatPortHttp"'
+  DetailPrint 'AJP/1.3 Connector configured on port "$TomcatPortAjp"'
+  DetailPrint "server.xml written"
+
   StrCpy $R5 ''
 
   ${If} $TomcatAdminEnable == "1"
@@ -824,36 +849,14 @@ Function configure
     DetailPrint 'Admin user added: "$TomcatAdminUsername"'
   ${EndIf}
 
-  DetailPrint 'HTTP/1.1 Connector configured on port "$TomcatPortHttp"'
-  DetailPrint 'AJP/1.3 Connector configured on port "$TomcatPortAjp"'
 
   ; Extract these fragments to $PLUGINSDIR. That is a temporary directory,
   ; that is automatically deleted when the installer exits.
   InitPluginsDir
   SetOutPath $PLUGINSDIR
-  File confinstall\server_1.xml
-  File confinstall\server_2.xml
-  File confinstall\server_3.xml
   File confinstall\tomcat-users_1.xml
   File confinstall\tomcat-users_2.xml
 
-  ; Build final server.xml
-  Delete "$INSTDIR\conf\server.xml"
-  DetailPrint "Writing server.xml"
-  FileOpen $R9 "$INSTDIR\conf\server.xml" w
-
-  Push "$PLUGINSDIR\server_1.xml"
-  Call copyFile
-  FileWrite $R9 $R4
-  Push "$PLUGINSDIR\server_2.xml"
-  Call copyFile
-  FileWrite $R9 $R6
-  Push "$PLUGINSDIR\server_3.xml"
-  Call copyFile
-
-  FileClose $R9
-  DetailPrint "server.xml written"
-
   ; Build final tomcat-users.xml
   Delete "$INSTDIR\conf\tomcat-users.xml"
   DetailPrint "Writing tomcat-users.xml"
@@ -875,9 +878,6 @@ Function configure
   FileClose $R9
   DetailPrint "tomcat-users.xml written"
 
-  Delete "$PLUGINSDIR\server_1.xml"
-  Delete "$PLUGINSDIR\server_2.xml"
-  Delete "$PLUGINSDIR\server_3.xml"
   Delete "$PLUGINSDIR\tomcat-users_1.xml"
   Delete "$PLUGINSDIR\tomcat-users_2.xml"
 FunctionEnd



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message