When a relation is moved to another tablespace, we can't assume that we can
[PostgreSQL.git] / src / tools / major_release_split
blob37f8111ca33ab46a5ae6bd59bbce74abe463a4a0
3 # This program takes release.sgml and breaks it up into
4 # per-major-release files that can be copied to the proper
5 # CVS tree.
7 [ "$#" -ne 1 ] && echo "Usage: $0 release_sgml_file" 1>&2 && exit 1
9 FILE="$1"
11 trap "rm -f /tmp/preamble" 0 1 2 3 15
13 # Create the SGML preamble file
14 # Copy from the start of the file to the first "sect1" heading
15 grep -B 1000000 "`sed -n '/<sect1/p;/<sect1/q' \"$FILE\"`" "$FILE" | 
16 # exclude last line
17 sed -n '$q;p' > /tmp/preamble
19 # Create per-major-release files
20 # spin over all "sect1" releases to find major release numbers
21 sed -n 's/^ *<sect1 id="release-\([^-]-[^-]\).*/\1/p' "$FILE" |
22 uniq |
23 while read RELEASE
25         # copy preamble
26         cp /tmp/preamble "$RELEASE"-"`basename $FILE`"
27         # grab remainder of file for major release
28         grep -A 10000000 "<sect1 id=\"release-$RELEASE" "$FILE" >> "$RELEASE"-"`basename $FILE`"
29 done