|
| 1 | +: |
| 2 | + |
| 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. |
| 6 | + |
| 7 | +[ "$#" -ne 1 ] && echo "Usage: $0 release_sgml_file" 1>&2 && exit 1 |
| 8 | + |
| 9 | +FILE="$1" |
| 10 | + |
| 11 | +trap "rm -f /tmp/preamble" 0 1 2 3 15 |
| 12 | + |
| 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 |
| 18 | + |
| 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 |
| 24 | +do |
| 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 |
| 30 | + |