incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r1162467 - in /incubator/ooo/site/trunk/tools: kenai2website.sh readme.txt urlrewrite.sed urlrewrite.sh web-list.txt
Date Sun, 28 Aug 2011 01:55:31 GMT
Author: wave
Date: Sun Aug 28 01:55:31 2011
New Revision: 1162467

URL: http://svn.apache.org/viewvc?rev=1162467&view=rev
Log:
Further automation for the web conversion scripts.

Added:
    incubator/ooo/site/trunk/tools/urlrewrite.sed
    incubator/ooo/site/trunk/tools/urlrewrite.sh   (with props)
Modified:
    incubator/ooo/site/trunk/tools/kenai2website.sh
    incubator/ooo/site/trunk/tools/readme.txt
    incubator/ooo/site/trunk/tools/web-list.txt

Modified: incubator/ooo/site/trunk/tools/kenai2website.sh
URL: http://svn.apache.org/viewvc/incubator/ooo/site/trunk/tools/kenai2website.sh?rev=1162467&r1=1162466&r2=1162467&view=diff
==============================================================================
--- incubator/ooo/site/trunk/tools/kenai2website.sh (original)
+++ incubator/ooo/site/trunk/tools/kenai2website.sh Sun Aug 28 01:55:31 2011
@@ -26,15 +26,20 @@
 # for a note on the checkout from the Kenai svn repository.
 #
 # USAGE:
-#   $ ./kenai2website.sh WEB-PROJECT SITE-DIR
+#   $ ./kenai2website.sh PROJECT
 #
-#     WEB-LIST is a file containing the list of Projects to fetch
-#       (see the file tools/dev/webcontent-list.txt)
-#     WORK-DIR each project's webcontent will be created in a
-#       subdirectory of WORK-DIR
+#     PROJECT is the name of the project to convert.
 #
-#  Future steps will include scripts to transform the content for
-#  the Apache CMS or a Confluence Wiki import
+#     Here are the steps performed.
+#
+#     1. svn export.
+#     2. dos2unix fixup. Change DOS2UNIX to fit your OS.
+#     3. compare with AOOo site. Either
+#        a) if project exists in AOOo site then find out what differs
+#        b) if project does not exist then moves the directory into the AOOo site content.
+#           The contents are tested to see what url fixups may be needed.
+#           Additional steps are manual. Do test site builds, image url cleanup, other fixups.
+#           Once satisfied then do "svn add PROJECT"
 #
 
 if test "$#" != 1; then
@@ -44,6 +49,9 @@ fi
 
 REPOS='https://svn.openoffice.org/svn/'
 REPOS2='~webcontent'
+DOS2UNIX='/tmp/dos2unix.pl'
+toolsdir=`pwd`
+contentdir=${toolsdir}/../content/openofficeorg/
 
 webproject=$1
 
@@ -53,4 +61,23 @@ rm -rf ${webproject}
 webrepos=${REPOS}${webproject}${REPOS2}
 
 echo "============ '$webproject' is being exported ..."
-svn export $webrepos $webproject
+svn export ${webrepos} ${webproject}
+${DOS2UNIX} `find ${webproject} -name "*.html"`
+${DOS2UNIX} `find ${webproject} -name "*.css"`
+${DOS2UNIX} `find ${webproject} -name "*.js"`
+${DOS2UNIX} `find ${webproject} -name "*.svg"`
+if test -d ${contentdir}${webproject}; then
+    echo "============ '$webproject' looking for differences ..."
+    diff -rqw ${webproject} ${contentdir}/${webproject} | grep differ
+    echo "The files above differ. This can be from changes in either repository."
+else
+    echo "============ installing '$webproject' ..."
+    mv ${webproject} ${contentdir}/.
+    cd ${contentdir}/.
+    echo "============ '$webproject' is installed ..."
+    echo "Need to change urls - possibly with sed."
+    grep -o "http://.*openoffice.org/" `find ${webproject} -name "*.html"`
+    echo "suggest local build until satisified."
+    echo "remove unneeded files before svn add ${webproject}"
+fi
+echo " "

Modified: incubator/ooo/site/trunk/tools/readme.txt
URL: http://svn.apache.org/viewvc/incubator/ooo/site/trunk/tools/readme.txt?rev=1162467&r1=1162466&r2=1162467&view=diff
==============================================================================
--- incubator/ooo/site/trunk/tools/readme.txt (original)
+++ incubator/ooo/site/trunk/tools/readme.txt Sun Aug 28 01:55:31 2011
@@ -34,11 +34,9 @@ This directory contains the scripts used
 kenai2website.sh <project>
 ==========================
 
-This is used to pull a Kenai webrepos to a /tmp directory. It will be enhanced to
-perform additional steps for converting and updating the folder in the project's
-website - content/openofficeorg/<project>/.
-
-The enhancements will wait until we've done a few more projects manually.
+This is used to pull a Kenai project webrepos to a /tmp directory.
+dos2unix is applied to certain files. And either the directory moved to
+ooo/site/trunk/content/openofficeorg/<project>/. or the two directories compared.
 
 fetch-all-web.sh <project-list>
 ===============================
@@ -48,4 +46,15 @@ This is used to call kenai2website for a
 web-list.txt
 ============
 
-This is a list of OOo projects in Kenai. It is not yet complete.
+This is a list of OOo projects from Kenai that have been moved into AOOo's repros.
+
+urlrewrite.sh
+=============
+
+This script is used to rewrite urls in the project's html to fit the AOOo scheme.
+
+urlrewrite.sed
+==============
+
+This contains the url rewrite rules. Used by urlrewrite.sh.
+

Added: incubator/ooo/site/trunk/tools/urlrewrite.sed
URL: http://svn.apache.org/viewvc/incubator/ooo/site/trunk/tools/urlrewrite.sed?rev=1162467&view=auto
==============================================================================
--- incubator/ooo/site/trunk/tools/urlrewrite.sed (added)
+++ incubator/ooo/site/trunk/tools/urlrewrite.sed Sun Aug 28 01:55:31 2011
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# This file contains a set of url change commands.
+#
+s/http:\/\/www.openoffice.org/\/openofficeorg\/www/g
+s/http:\/\/download.openoffice.org/\/openofficeorg\/download/g
+s/http:\/\/support.openoffice.org/\/openofficeorg\/support/g
+s/http:\/\/contributing.openoffice.org/\/openofficeorg\/contributing/g
+s/http:\/\/projects.openoffice.org/\/openofficeorg\/projects/g
+s/http:\/\/why.openoffice.org/\/openofficeorg\/why/g

Added: incubator/ooo/site/trunk/tools/urlrewrite.sh
URL: http://svn.apache.org/viewvc/incubator/ooo/site/trunk/tools/urlrewrite.sh?rev=1162467&view=auto
==============================================================================
--- incubator/ooo/site/trunk/tools/urlrewrite.sh (added)
+++ incubator/ooo/site/trunk/tools/urlrewrite.sh Sun Aug 28 01:55:31 2011
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+#
+# Use this script to fetch all a project's webcontent for the projects
+# listed in the specified file (typically, webcontent-list.txt).
+#
+# See https://cwiki.apache.org/confluence/display/OOOUSERS/OOo-Sitemap
+# for a note on the checkout from the Kenai svn repository.
+#
+# USAGE:
+#   $ ./urlrewrite.sh WEB-PROJECT
+#
+#     WEB-PROJECT - the name of the project to apply the urlrewrite rules.
+#
+#  This is used to change html according the rules in urlrewrite.sed
+#  The project directory is scanned at the end for other urls which eventually
+#  need fixup when the new url is known.
+#
+#  Fixups may be needed for css, js and other types of files.
+#
+
+if test "$#" != 1; then
+  echo "USAGE: $0 PROJECT"
+  exit 1
+fi
+
+toolsdir=`pwd`
+sedscripts=${toolsdir}/urlrewrite.sed
+contentdir=${toolsdir}/../content/openofficeorg/
+
+webproject=$1
+
+if test -d ${contentdir}${webproject}; then
+    echo "============ '$webproject' performing url fixups ..."
+    cd ${contentdir}${webproject}
+    for htmlfile in `find . -name "*.html"` ; do
+	echo ${htmlfile}
+	mv ${htmlfile} ${htmlfile}.bak
+	sed -f ${sedscripts} ${htmlfile}.bak > ${htmlfile}
+	diff -q ${htmlfile}.bak ${htmlfile}
+	rm ${htmlfile}.bak
+    done
+    echo "============ '$webproject' performing url fixups ..."
+    grep -o "http://.*openoffice.org/" `find . -name "*.html"`
+fi
+echo " "

Propchange: incubator/ooo/site/trunk/tools/urlrewrite.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ooo/site/trunk/tools/urlrewrite.sh
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/ooo/site/trunk/tools/web-list.txt
URL: http://svn.apache.org/viewvc/incubator/ooo/site/trunk/tools/web-list.txt?rev=1162467&r1=1162466&r2=1162467&view=diff
==============================================================================
--- incubator/ooo/site/trunk/tools/web-list.txt (original)
+++ incubator/ooo/site/trunk/tools/web-list.txt Sun Aug 28 01:55:31 2011
@@ -18,12 +18,14 @@
 #
 
 #
-# This file contains a list of every project's webcontent currently
-# hosted on Oracle's Kenai svn repository at:
+# This file contains a list of every project whose webcontent
+# has been transferred from
+#
 #   https://svn.openoffice.org/svn/<$projectname>~webcontent
 #
-# The webcontent repositories that should not be pulled are commented out,
-# with a short explanation why.
+# to
+#
+#   ooo/site/trunk/content/openofficeorg/<$projectname>
 #
 # Note: for automated processing of this file, use only lines that
 # begin with "./".
@@ -33,4 +35,6 @@
 ./download
 ./de
 ./projects
-./development
+./contributing
+./support
+./why



Mime
View raw message