From c4104a9e80d096dcca1719dd71f1f99020c9e39b Mon Sep 17 00:00:00 2001
From: david_williams <david_williams>
Date: Sun, 27 May 2007 03:50:35 +0000
Subject: [PATCH] small improvements

---
 .../build-home/copyToRelease-SiteFiles.sh     | 15 ++++---
 .../build-home/copyToRelease-code.sh          |  4 +-
 .../build-home/runCreateDigests.sh            |  2 +-
 .../build-home/runCreatePack200s.sh           |  2 +-
 .../runUpdateAllEnablingFeatures.sh           | 32 ++++++-------
 .../build-home/runUpdateAllEuropaProjects.sh  | 10 ++---
 .../build-home/runUpdateAllProjects.sh        | 12 +++--
 .../build-home/runUpdateProjects.sh           | 10 ++---
 .../build-home/runUpdateSiteXmlFile.sh        |  7 ++-
 .../tools/genUpdates.sh                       | 45 -------------------
 10 files changed, 48 insertions(+), 91 deletions(-)
 delete mode 100644 org.eclipse.wtp.releng.webupdatesite/tools/genUpdates.sh

diff --git a/org.eclipse.wtp.releng.webupdatesite/build-home/copyToRelease-SiteFiles.sh b/org.eclipse.wtp.releng.webupdatesite/build-home/copyToRelease-SiteFiles.sh
index 61c9625df..9644a7c76 100644
--- a/org.eclipse.wtp.releng.webupdatesite/build-home/copyToRelease-SiteFiles.sh
+++ b/org.eclipse.wtp.releng.webupdatesite/build-home/copyToRelease-SiteFiles.sh
@@ -5,19 +5,20 @@
 source ./parseSiteArg.shsource
 
 # important: make sure digest is updated same time as site.xml's
-# TODO: digest should be recreated on final site?
-cp -f -p -r -v --update ${fromDir}/digest.zip --target-directory=${toDir}/
+# TODO: should digest be recreated on final site? No for "exact" sites, yes, if "merged" sites. 
+rsync -v -p ${fromDir}/digest.zip ${toDir}
 
 
-cp -f -p -r -v --update ${fromDir}/*html --target-directory=${toDir}/ 
-cp -f -p -r -v --update ${fromDir}/*.gif  --target-directory=${toDir}/
-cp -f -p -r -v --update ${fromDir}/web  --target-directory=${toDir}/    2>/dev/null
-cp -f -p -r -v --update ${fromDir}/*.xml --target-directory=${toDir}/   
+rsync -v -p ${fromDir}/*.html ${toDir}
+rsync -v -p ${fromDir}/*.gif ${toDir}
+rsync -v -p ${fromDir}/*.jpg ${toDir}
+rsync -v -p ${fromDir}/*.xml ${toDir}
 
 # Typically, as of this writing
 # Europa: 'declaredUpdates' to 'milestones' 
 # Callisto: 'testUpdates' to 'updates'
 
+# compute last segment in directory names, as a heurisic to update internal URL links
 fromLastSegment=${fromDir##*/}
 toLastSegment=${toDir##*/}
 
@@ -28,7 +29,7 @@ echo "      to: ${toLastSegment}"
 echo ""
 
 fromString="webtools/${fromLastSegment}"
-toString="webtools/$toLastSegment"
+toString="webtools/${toLastSegment}"
 replaceCommand="s!${fromString}!${toString}!g"
 
 #echo ${replaceCommand};
diff --git a/org.eclipse.wtp.releng.webupdatesite/build-home/copyToRelease-code.sh b/org.eclipse.wtp.releng.webupdatesite/build-home/copyToRelease-code.sh
index 0e8b775c2..f31db4246 100644
--- a/org.eclipse.wtp.releng.webupdatesite/build-home/copyToRelease-code.sh
+++ b/org.eclipse.wtp.releng.webupdatesite/build-home/copyToRelease-code.sh
@@ -22,8 +22,8 @@ echo "        from  ${fromDir}"
 echo "          to  ${toDir}"
 echo ""
 
-rsync ${doit}  --ignore-existing -rv ${fromDir}/features ${toDir}
-rsync ${doit}  --ignore-existing -rv ${fromDir}/plugins ${toDir}
+rsync ${doit}  --ignore-existing -rv -p ${fromDir}/features ${toDir}
+rsync ${doit}  --ignore-existing -rv -p ${fromDir}/plugins ${toDir}
 
 if [ "${doit}" = "--dry-run" ] ; then
    echo ""
diff --git a/org.eclipse.wtp.releng.webupdatesite/build-home/runCreateDigests.sh b/org.eclipse.wtp.releng.webupdatesite/build-home/runCreateDigests.sh
index 09bdb45a5..48c1951a3 100644
--- a/org.eclipse.wtp.releng.webupdatesite/build-home/runCreateDigests.sh
+++ b/org.eclipse.wtp.releng.webupdatesite/build-home/runCreateDigests.sh
@@ -10,5 +10,5 @@ mainSiteFileName=site.xml
  
 source eclipseLocation.shsource
 
-ant  -f createDigests.xml      -Declipse.home=$eclipseLocation -DupdateSite=$updateSite  -DmainSiteFileName=$mainSiteFileName
+ant  -f createDigests.xml      -Declipse.home=${eclipseLocation} -DupdateSite=${updateSite}  -DmainSiteFileName=${mainSiteFileName}
 
diff --git a/org.eclipse.wtp.releng.webupdatesite/build-home/runCreatePack200s.sh b/org.eclipse.wtp.releng.webupdatesite/build-home/runCreatePack200s.sh
index 651a128e1..e458158d6 100644
--- a/org.eclipse.wtp.releng.webupdatesite/build-home/runCreatePack200s.sh
+++ b/org.eclipse.wtp.releng.webupdatesite/build-home/runCreatePack200s.sh
@@ -7,5 +7,5 @@ updateSite=${HOME}/downloads/webtools/testUpdates
  
 source eclipseLocation.shsource
 
-ant  -f createPack200s.xml      -Declipse.home=$eclipseLocation -DupdateSite=$updateSite
+ant  -f createPack200s.xml      -Declipse.home=${eclipseLocation} -DupdateSite=${updateSite}
 
diff --git a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllEnablingFeatures.sh b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllEnablingFeatures.sh
index 1d7965a08..abf9ccb6f 100644
--- a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllEnablingFeatures.sh
+++ b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllEnablingFeatures.sh
@@ -10,31 +10,31 @@ eclipseLocation=${HOME}/eclipse-ppc-33M5
 
 mainSiteFileName=siteEnabling.xml
 
- if [ "$1" == "-clean" ] ; then
+if [ "${1}" == "-clean" ] ; then
 
-	 echo "   Removing $updateSite/features/"
-	 rm -fr $updateSite/features/
+	 echo "   Removing ${updateSite}/features/"
+	 rm -fr ${updateSite}/features/
 	
-	 echo "   Removing $updateSite/plugins/"
-	 rm -fr $updateSite/plugins/
+	 echo "   Removing ${updateSite}/plugins/"
+	 rm -fr ${updateSite}/plugins/
 	
 	 echo "   Removing index and site xml files"
-	 rm -fr $updateSite/*
+	 rm -fr ${updateSite}/*
 	
 	 echo "   Updating index and web site files, but not site xml files (yet)"
-	    cp ${HOME}/$updateToolsDir/WebContent/index.html  $updateSite
-	    cp ${HOME}/$updateToolsDir/WebContent/*.jpg  $updateSite > /dev/null
-	    cp ${HOME}/$updateToolsDir/WebContent/*.gif  $updateSite > /dev/null
-	    cp -r ${HOME}/$updateToolsDir/WebContent/web $updateSite > /dev/null
+	    rsync -v -p ${HOME}/${updateToolsDir}/WebContent/index.html ${updateSite}
+      rsync -v -p ${HOME}/${updateToolsDir}/WebContent/*.jpg ${updateSite}
+      rsync -v -p ${HOME}/${updateToolsDir}/WebContent/*.gif ${updateSite}
+fi
 
- fi
 
+ant  -f updateEnablingMirrorAll.xml -DeclipseLocation=${eclipseLocation} -DlocalUpdateSitePath=${updateSite}
 
- ant  -f updateEnablingMirrorAll.xml -DeclipseLocation=$eclipseLocation -DlocalUpdateSitePath=$updateSite
+# merge authored site.xml files with the most recent auto generated one
+./runUpdateSiteXmlFiles.sh ${mainSiteFileName} ${updateSite}
 
- # merge authored site.xml files with the most recent auto generated one
- ./runUpdateSiteXmlFiles.sh $mainSiteFileName $updateSite
+# do create pack's later ... takes a long time
+# ant  -f createPack200s.xml     -Declipse.home=${eclipseLocation} -DupdateSite=${updateSite}
 
- ant  -f createPack200s.xml     -Declipse.home=$eclipseLocation -DupdateSite=$updateSite
- ant  -f createDigests.xml      -Declipse.home=$eclipseLocation -DupdateSite=$updateSite  -DmainSiteFileName=$mainSiteFileName
+ant  -f createDigests.xml      -Declipse.home=${eclipseLocation} -DupdateSite=${updateSite}  -DmainSiteFileName=${mainSiteFileName}
 
diff --git a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllEuropaProjects.sh b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllEuropaProjects.sh
index ccbdea61e..100e750de 100644
--- a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllEuropaProjects.sh
+++ b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllEuropaProjects.sh
@@ -13,18 +13,18 @@ mainSiteFileName=siteEuropa.xml
 if [ "${1}" == "-clean" ] ; then
 
 	 echo "   Removing ${updateSite}/features/"
-	 rm -fr $updateSite/features/
+	 rm -fr ${updateSite}/features/
 	
 	 echo "   Removing ${updateSite}/plugins/"
-	 rm -fr $updateSite/plugins/
+	 rm -fr ${updateSite}/plugins/
 	
 	 echo "   Removing index and site xml files"
 	 rm -fr ${updateSite}/*
 	
 	 echo "   Updating index and web site files, but not site xml files (yet)"
-	    cp ${HOME}/${updateToolsDir}/WebContent/indexEuropa.html  ${updateSite}/index.html
-	    cp ${HOME}/${updateToolsDir}/WebContent/*.jpg  ${updateSite} > /dev/null
-	    cp ${HOME}/${updateToolsDir}/WebContent/*.gif  ${updateSite} > /dev/null
+	    rsync -v -p ${HOME}/${updateToolsDir}/WebContent/indexEuropa.html ${updateSite}/index.html
+      rsync -v -p ${HOME}/${updateToolsDir}/WebContent/*.jpg ${updateSite}
+      rsync -v -p ${HOME}/${updateToolsDir}/WebContent/*.gif ${updateSite}
 fi
 
 
diff --git a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllProjects.sh b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllProjects.sh
index 8f5d976b0..b0883defb 100644
--- a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllProjects.sh
+++ b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateAllProjects.sh
@@ -10,7 +10,7 @@ updateToolsDir=org.eclipse.wtp.releng.webupdatesite
 
 source eclipseLocation.shsource
 
-if [ "$1" == "-clean" ] ; then
+if [ "${1}" == "-clean" ] ; then
 
 	 echo "   Removing ${updateSite}/features/"
 	 rm -fr ${updateSite}/features/
@@ -22,18 +22,16 @@ if [ "$1" == "-clean" ] ; then
 	 rm -fr ${updateSite}/*
 	
 	 echo "   Updating index and web site files, but not site xml files (yet)"
-	    cp ${HOME}/${updateToolsDir}/WebContent/index.html  ${updateSite}
-	    cp ${HOME}/${updateToolsDir}/WebContent/*.jpg  ${updateSite} > /dev/null
-	    cp ${HOME}/${updateToolsDir}/WebContent/*.gif  ${updateSite} > /dev/null
-	    cp -r ${HOME}/${updateToolsDir}/WebContent/web ${updateSite} > /dev/null
-
+      rsync -v -p ${HOME}/${updateToolsDir}/WebContent/index.html ${updateSite}/index.html
+      rsync -v -p ${HOME}/${updateToolsDir}/WebContent/*.jpg ${updateSite}
+      rsync -v -p ${HOME}/${updateToolsDir}/WebContent/*.gif ${updateSite}	 
 fi
 
 
 ant  -f updateCallistoMirrorAll.xml -Declipse.home=${eclipseLocation} -DlocalUpdateSitePath=${updateSite}
 
 # merge authored site.xml files with the most recent auto generated one
-./runUpdateSiteXmlFiles.sh $mainSiteFileName ${updateSite}
+./runUpdateSiteXmlFiles.sh ${mainSiteFileName} ${updateSite}
 
 #ant  -f createPack200s.xml     -Declipse.home=${eclipseLocation} -DupdateSite=${updateSite}
  
diff --git a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateProjects.sh b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateProjects.sh
index a28de1e6c..5b3c2b8a3 100644
--- a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateProjects.sh
+++ b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateProjects.sh
@@ -5,19 +5,19 @@
 #updateSite=${HOME}/downloads/webtools/testUpdates
 updateSite=${HOME}/downloads/webtools/declaredUpdates
 
-echo "update site: $updateSite"
+echo "update site: ${updateSite}"
 
  eclipseLocation=${HOME}/eclipse-ppc-33M5
 
 
-project="$1"
-if [ "$project" !=  "" ]
+project="${1}"
+if [ "${project}" !=  "" ]
 then
 
-     ant  -f features-$project.xml -DeclipseLocation=$eclipseLocation -DlocalUpdateSitePath=$updateSite -Dosgi.arch=ppc -Dosgi.clean -Dosgi.debug=true -Declipse.consoleLog=true -DcontinueOnError=true
+     ant  -f features-${project}.xml -DeclipseLocation=${eclipseLocation} -DlocalUpdateSitePath=${updateSite} -Dosgi.arch=ppc -Dosgi.clean -Dosgi.debug=true -Declipse.consoleLog=true -DcontinueOnError=true
 
 
 else
-     echo "   Usage: $0 <project> (where project is wtp, jsf, or jpa)"
+     echo "   Usage: ${0} <project> (where project is wtp, jsf, or jpa)"
 
 fi
diff --git a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateSiteXmlFile.sh b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateSiteXmlFile.sh
index 24893e68d..3eb5faf94 100644
--- a/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateSiteXmlFile.sh
+++ b/org.eclipse.wtp.releng.webupdatesite/build-home/runUpdateSiteXmlFile.sh
@@ -13,5 +13,8 @@ in_newFeatures=${updateSite}/.site.xml
 # merges newFeautes in to authored, back in original locaion
 java -jar siteFileUpdater.jar ${in_authored} ${in_newFeatures}
 
-#copy to discovery site
-cp ${in_authored}  ${updateSite}/site.xml
+# copy to discovery site
+# Note: here we are changing names from site specific site file name, to generic site.xml 
+rsync -v -p ${in_authored} ${updateSite}/site.xml
+
+rm ${in_newFeatures}
diff --git a/org.eclipse.wtp.releng.webupdatesite/tools/genUpdates.sh b/org.eclipse.wtp.releng.webupdatesite/tools/genUpdates.sh
deleted file mode 100644
index e98f24df2..000000000
--- a/org.eclipse.wtp.releng.webupdatesite/tools/genUpdates.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-currentTarget=/home/data/httpd/download.eclipse.org/webtools/testUpdates/features/
-echo $currentTarget > allUpdates.txt
-ls   $currentTarget >> allUpdates.txt
-
-currentTarget=/home/data/httpd/download.eclipse.org/webtools/testUpdates/plugins/
-echo $currentTarget >> allUpdates.txt
-ls   $currentTarget >> allUpdates.txt
-
-
-
-
-currentTarget=/home/data/httpd/download.eclipse.org/eclipse/updates/3.1/features/
-echo $currentTarget >> allUpdates.txt
-ls   $currentTarget >> allUpdates.txt
-
-currentTarget=/home/data/httpd/download.eclipse.org/eclipse/updates/3.1/plugins/
-echo $currentTarget >> allUpdates.txt
-ls   $currentTarget >> allUpdates.txt
-
-
-
-currentTarget=/home/data/httpd/download.eclipse.org/eclipse/updates/3.0/features/
-echo $currentTarget >> allUpdates.txt
-ls   $currentTarget >> allUpdates.txt
-
-currentTarget=/home/data/httpd/download.eclipse.org/eclipse/updates/3.0/plugins/
-echo $currentTarget >> allUpdates.txt
-ls   $currentTarget >> allUpdates.txt
-
-
-
-
-
-currentTarget=/home/data/httpd/download.eclipse.org/tools/emf/updates/features/
-echo $currentTarget >> allUpdates.txt
-ls   $currentTarget >> allUpdates.txt
-
-currentTarget=/home/data/httpd/download.eclipse.org/tools/emf/updates/plugins/
-echo $currentTarget >> allUpdates.txt
-ls   $currentTarget >> allUpdates.txt
-
-
-
-- 
GitLab