3 # This program takes release.sgml and breaks it up into
4 # per-major-release files that can be copied to the proper
7 [ "$#" -ne 1 ] && echo "Usage: $0 release_sgml_file" 1>&2 && exit 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" |
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" |
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`"