SF.net SVN: docutils:[9886 ] trunk/sandbox/infrastruct ure/docutils-update.local

grubert--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9886
          http://sourceforge.net/p/docutils/code/9886
Author:   grubert
Date:     2024-08-13 09:53:10 +0000 (Tue, 13 Aug 2024)
Log Message:
-----------
add support and preference for rst-files

Modified Paths:
--------------
    trunk/sandbox/infrastructure/docutils-update.local

Modified: trunk/sandbox/infrastructure/docutils-update.local
===================================================================
--- trunk/sandbox/infrastructure/docutils-update.local	2024-08-13 09:50:27 UTC (rev 9885)
+++ trunk/sandbox/infrastructure/docutils-update.local	2024-08-13 09:53:10 UTC (rev 9886)
@@ -14,11 +14,9 @@
 #
 # ATTENTION
 #
-# Any .html document with a corresponding .txt file is regenerated 
-# if the .txt has changed, but no new .html files will be generated.
+# Any .html document with a corresponding .rst or .txt file is regenerated 
+# if the .rst/.txt has changed, but no new .html files will be generated.
 #
-# * Funny thing: sf hides README.txt files.
-#
 # ATTENTION
 #
 # Directories might contain Makefile.docutils-update files with
@@ -152,6 +150,7 @@
 find $basedir -name aux -o -type d -print0 | xargs -0 chmod ug+rwxs 2> /dev/null || true
 
 # create the snapshots
+# TODO exclude .git ?
 exclude='--exclude=.svn'
 tar -cz $exclude -f $project-snapshot.tgz $project
 tar -cz $exclude -f $project-sandbox-snapshot.tgz sandbox
@@ -188,10 +187,11 @@
 cd $htdocsdest
 
 # 2. generate empty and old html files to force generation
-#    for any txt under docs ?
-find docs -type f -and -name \*.txt -print | ( \
+#    for any rst/txt under docs ?
+find docs -type f -and \( -name \*.rst -o -name \*.txt \) -print | ( \
 while read -r txtfile ; do
     dir=`dirname $txtfile`
+    base=`basename $txtfile .rst`
     base=`basename $txtfile .txt`
     htmlfile=$dir/$base.html
     if [ ! -e $htmlfile ] ; then
@@ -201,10 +201,12 @@
 done
 )
 
-#   for any README.txt under sandbox
-find sandbox -type f -and \( -name README.txt -o -name README \) -print | ( \
+#   for any README/.rst/.txt under sandbox
+find sandbox -type f -and \( -name README.rst \
+	-o -name README.txt -o -name README \) -print | ( \
 while read -r txtfile ; do
     dir=`dirname $txtfile`
+    base=`basename $txtfile .rst`
     base=`basename $txtfile .txt`
     htmlfile=$dir/$base.html
     if [ ! -e $htmlfile ] ; then
@@ -224,7 +226,7 @@
     fi
 done < $htmlfilelist
 
-# 3. re/generate html from txt
+# 3. re/generate html from rst/txt
 cd $htdocsdest
 
 # TODO use buildhtml.py ?
@@ -236,9 +238,9 @@
     if [ "$base" == "standalone_rst_html4strict" ] ; then
         print_feedback "skipped: $dir $base"
     else
-        txtfile=$dir/$base.txt
+        txtfile=$dir/$base.rst
         if [ ! -e $txtfile  ] ; then
-            txtfile=$dir/$base.rst
+            txtfile=$dir/$base.txt
         fi
         if [ ! -e $txtfile  ] ; then
             txtfile=$dir/$base
@@ -300,6 +302,9 @@
                 if test "${i: -5}" == .html; then
                     # HTML files (including the home page) have highest priority.
                     priority=1.0
+                elif test "${i: -4}" == .rst; then
+                    # Text files have medium priority.
+                    priority=0.5
                 elif test "${i: -4}" == .txt; then
                     # Text files have medium priority.
                     priority=0.5

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.