diff options
-rwxr-xr-x | build/preseed.pl | 33 | ||||
-rw-r--r-- | debian/changelog | 3 |
2 files changed, 25 insertions, 11 deletions
diff --git a/build/preseed.pl b/build/preseed.pl index abcfe39a1..532356831 100755 --- a/build/preseed.pl +++ b/build/preseed.pl @@ -66,11 +66,15 @@ $p->parse_file($xmlfile); sub start_rtn { my ($tagname, $text, $attr) = @_; print STDERR "\nStart: $tagname\n" if $opt_d; - if ( $tagname =~ /appendix|sect1|sect2|sect3|para/ ) { + + if ( $tagname =~ /appendix|sect1|sect2|sect3|para|informalexample|phrase/ ) { $tagstatus{$tagname}{'count'} += 1; print STDERR "$tagname $tagstatus{$tagname}{'count'}\n" if $opt_d; if ( ! exists $ignore{'tag'} ) { + # FIXME: this ignores that 'contition' is used for many + # other things than the release; should be OK in practice + # for the preseed appendix though. if ( exists $attr->{condition} ) { print STDERR "Condition: $attr->{condition}\n" if $opt_d; if ( $attr->{condition} ne $release ) { @@ -89,6 +93,7 @@ sub start_rtn { } } } + # Assumes that <title> is the first tag after a section tag if ( $prevtag =~ /sect1|sect2|sect3/ ) { $settitle = ( $tagname eq 'title' ); @@ -147,24 +152,32 @@ sub text_rtn { sub end_rtn { my ($tagname) = @_; print STDERR "\nEnd: $tagname\n" if $opt_d; - if ( $tagname eq 'informalexample' ) { - $example{'print'} = 0; - } - if ( $tagname =~ /appendix|sect1|sect2|sect3|para/ ) { - delete $tagstatus{$tagname}{'title'} if exists $tagstatus{$tagname}{'title'}; + + # Set of tags must match what's in start_rtn + if ( $tagname =~ /appendix|sect1|sect2|sect3|para|informalexample|phrase/ ) { + my $ts = $tagstatus{$tagname}{'count'}; + $tagstatus{$tagname}{'count'} -= 1; + print STDERR "$tagname $tagstatus{$tagname}{'count'}\n" if $opt_d; + die "Invalid XML file: negative count for tag <$tagname>!" if $tagstatus{$tagname}{'count'} < 0; if ( exists $ignore{'tag'} ) { - if ( $ignore{'tag'} eq $tagname && $ignore{'depth'} == $tagstatus{$tagname}{'count'} ) { + if ( $ignore{'tag'} eq $tagname && $ignore{'depth'} == $ts ) { delete $ignore{'tag'}; } + return } + } + + if ( $tagname eq 'informalexample' ) { + $example{'print'} = 0; + } + + if ( $tagname =~ /appendix|sect1|sect2|sect3|para/ ) { + delete $tagstatus{$tagname}{'title'} if exists $tagstatus{$tagname}{'title'}; if ( $example{'in_sect'} ) { print "\n"; $example{'in_sect'} = 0; } - $tagstatus{$tagname}{'count'} -= 1; - print STDERR "$tagname $tagstatus{$tagname}{'count'}\n" if $opt_d; - die "Invalid XML file: negative count for tag <$tagname>!" if $tagstatus{$tagname}{'count'} < 0; } } diff --git a/debian/changelog b/debian/changelog index 47d786cc2..75198cd29 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,11 +29,12 @@ installation-guide (2008xxxx) UNRELEASED; urgency=low * Booting using LILO or GRUB: minor improvements. Closes: #519508. * Fix example how to generate md5-encoded password. Closes: #518018. * Fix missing tags in Japanese translation. Closes: #509372. + * Improve script that extracts preconfiguration example file from appendix. [ Samuel Thibault ] * Document accessibility support. Closes: #509371. - -- Frans Pop <fjp@debian.org> Tue, 07 Apr 2009 10:36:26 +0200 + -- Frans Pop <fjp@debian.org> Wed, 08 Apr 2009 06:38:18 +0200 installation-guide (20081208) unstable; urgency=low |