Author: paul
Date: 2006-12-07 21:55:12 +0100 (Thu, 07 Dec 2006)
New Revision: 4160
Log:
r16870@polar: paul | 2006-12-07 14:54:38 -0600
Helper script to generate list of reserved words that are new
in a given MySQL series.
Added:
trunk/tools/list-new-reserved-words.rb
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:16867
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:13271
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:12611
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:16870
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:13271
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:12611
Property changes on: trunk/tools/list-new-reserved-words.rb
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/script
Added: trunk/tools/list-new-reserved-words.rb
===================================================================
--- trunk/tools/list-new-reserved-words.rb (rev 0)
+++ trunk/tools/list-new-reserved-words.rb 2006-12-07 20:55:12 UTC (rev 4160)
Changed blocks: 1, Lines Added: 58, Lines Deleted: 0; 1977 bytes
@@ -0,0 +1,58 @@
+#!/usr/bin/ruby -w
+# list-new-reserved-words.rb - Generate list of reserved words that
+# are new in a given MySQL series.
+
+# Usage: list-new-reserved-words.rb series prev-series-words cur-series-words
+
+# series = MySQL series number
+# prev-series-words = reserved word list for previous series
+# cur-series-words = reserved word list for current series
+
+# Example:
+# Usage: list-new-reserved-words.rb 5.1 /tmp/rw-new-5.0 /tmp/rw-new-5.1
+
+# The script reads the lists, removes from the second those that are
+# also present in the first, and formats the result as an XML text file.
+
+# Paul DuBois
+# paul@stripped
+# 2006-12-07
+
+def read_words(file_name)
+ words = []
+ File.open(file_name) do |fh|
+ fh.each_line do |line|
+ words << line.chomp
+ end
+ end
+ words
+end
+
+unless ARGV.length == 3
+ $stderr.puts <<EOF
+Usage: #{$0} series prev-series-words cur-series-words
+
+series = MySQL series number
+prev-series-words = reserved word list for previous series
+cur-series-words = reserved word list for current series
+
+Example:
+Usage: #{$0} 5.1 /tmp/rw-new-5.0 /tmp/rw-new-5.1
+EOF
+ exit 1
+end
+
+series = ARGV.shift
+words = (read_words(ARGV[1]) - read_words(ARGV[0])).sort
+words.collect! { |w| "<literal>" + w + "</literal>" }
+
+puts <<EOF
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE para PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+<para>
+The following are new reserved words in MySQL #{series}:
+EOF
+
+puts words.join(",\n") + "."
+puts "</para>"
Property changes on: trunk/tools/list-new-reserved-words.rb
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/script
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r4160 - in trunk: . tools | paul | 7 Dec |