~ubuntu-branches/ubuntu/quantal/nginx/quantal-updates

« back to all changes in this revision

Viewing changes to debian/modules/nginx-echo/util/wiki2pod.pl

  • Committer: Bazaar Package Importer
  • Author(s): Michael Lustfield, Micheal Lustfield, Kartik Mistry
  • Date: 2011-03-03 23:39:07 UTC
  • mfrom: (4.2.29 sid)
  • Revision ID: james.westby@ubuntu.com-20110303233907-y48yifhfnn5qjuxz
Tags: 0.8.54-4
[Micheal Lustfield]
* debian/nginx-{full,light,extras}.default:
  + Added comment about alternative to ULIMIT.
* debian/nginx-{full,light,extras}.init.d:
  + Added quotes around a test variable. (Closes: #610946, LP: #699736)
* debian/patches/609343-log-time-iso8601.diff:
  + Added patch to add $time_iso8601 variable to logs. (Closes: #609343)
* Clean up old logrotate files. (Closes: #608983, Closes: #610289)
  + Added Files:
    - debian/nginx-common.preinst
  + Modified Files:
    - debian/rules
  + Moved debian/nginx-common.logrotate to debian/logrotate.
* Added common files to nginx-common package. (Closes: #610290)
  + Removed Files:
    - debian/nginx-full.dirs
    - debian/nginx-light.dirs
    - debian/nginx-full.install
    - debian/nginx-light.install
    - debian/nginx-extras.install
    - debian/nginx.*
  + Added Files:
    - debian/nginx-common.default
    - debian/nginx-common.dirs
    - debian/nginx-common.init.d
    - debian/nginx-common.install
    - debian/nginx-common.manpages
    - debian/logrotate
  + Modified Files:
    - debian/nginx-extras.dirs
    - debian/control
    - debian/rules
* debian/nginx-*.install: (Closes: #609797)
  + Removed NEWS.Debian from nginx-{full,light,extras}.install.
  + Added NEWS.Debian to nginx-common.install.
* nginx-common.postinst:
  + Enforce /var/log/nginx mode and user:group. (Closes: #610983)
  + Enforce /var/log/nginx/*.log mode and user:group. (Closes: #612832)
* debian/rules:
  + Added --with-file-aio to nginx-extras. (Closes: #613175)
  + Removed split clients and user id modules from nginx-light.
* debian/conf/sites-available/default:
  + Fixed a minor typo ( s/Quickstart/QuickStart/ ). (Closes: #613355)
* debian/conf/mime.types:
  + Changed xml type to application/xhtml+xml. (Closes: #613851)
* debian/help/docs/fcgiwrap:
  + Removed Ubuntu specific line in docs. (Closes: #614987)
* debian/conf/sites-available/default:
  + Fixed a pointer to a file. (Closes: #614980)

[Kartik Mistry]
* debian/*.lintian-overrides:
  + Add Lintian overrides for nginx man page. We've manpage in nginx-common
    binary

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env perl
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
use bytes;
 
6
 
 
7
my @nl_counts;
 
8
my $last_nl_count_level;
 
9
 
 
10
my @bl_counts;
 
11
my $last_bl_count_level;
 
12
 
 
13
sub fmt_pos ($) {
 
14
    (my $s = $_[0]) =~ s{\#(.*)}{/"$1"};
 
15
    $s;
 
16
}
 
17
 
 
18
sub fmt_mark ($$) {
 
19
    my ($tag, $s) = @_;
 
20
    my $max_level = 0;
 
21
    while ($s =~ /([<>])\1*/g) {
 
22
        my $level = length $&;
 
23
        if ($level > $max_level) {
 
24
            $max_level = $level;
 
25
        }
 
26
    }
 
27
 
 
28
    my $times = $max_level + 1;
 
29
    if ($times > 1) {
 
30
        $s = " $s ";
 
31
    }
 
32
    return $tag . ('<' x $times) . $s . ('>' x $times);
 
33
}
 
34
 
 
35
print "=encoding utf-8\n\n";
 
36
 
 
37
while (<>) {
 
38
    if ($. == 1) {
 
39
        # strip the leading U+FEFF byte in MS-DOS text files
 
40
        my $first = ord(substr($_, 0, 1));
 
41
        #printf STDERR "0x%x", $first;
 
42
        #my $second = ord(substr($_, 2, 1));
 
43
        #printf STDERR "0x%x", $second;
 
44
        if ($first == 0xEF) {
 
45
            substr($_, 0, 1, '');
 
46
            #warn "Hit!";
 
47
        }
 
48
    }
 
49
    s{\[(http[^ \]]+) ([^\]]*)\]}{$2 (L<$1>)}gi;
 
50
    s{ \[\[ ( [^\]\|]+ ) \| ([^\]]*) \]\] }{"L<$2|" . fmt_pos($1) . ">"}gixe;
 
51
    s{<code>(.*?)</code>}{fmt_mark('C', $1)}gie;
 
52
    s{'''(.*?)'''}{fmt_mark('B', $1)}ge;
 
53
    s{''(.*?)''}{fmt_mark('I', $1)}ge;
 
54
    if (s{^\s*<[^>]+>\s*$}{}) {
 
55
        next;
 
56
    }
 
57
 
 
58
    if (/^\s*$/) {
 
59
        print "\n";
 
60
        next;
 
61
    }
 
62
 
 
63
=begin cmt
 
64
 
 
65
    if ($. == 1) {
 
66
        warn $_;
 
67
        for my $i (0..length($_) - 1) {
 
68
            my $chr = substr($_, $i, 1);
 
69
            warn "chr ord($i): ".ord($chr)." \"$chr\"\n";
 
70
        }
 
71
    }
 
72
 
 
73
=end cmt
 
74
=cut
 
75
 
 
76
    if (/(=+) (.*) \1$/) {
 
77
        #warn "HERE! $_" if $. == 1;
 
78
        my ($level, $title) = (length $1, $2);
 
79
        collapse_lists();
 
80
 
 
81
        print "\n=head$level $title\n\n";
 
82
    } elsif (/^(\#+) (.*)/) {
 
83
        my ($level, $txt) = (length($1) - 1, $2);
 
84
        if (defined $last_nl_count_level && $level != $last_nl_count_level) {
 
85
            print "\n=back\n\n";
 
86
        }
 
87
        $last_nl_count_level = $level;
 
88
        $nl_counts[$level] ||= 0;
 
89
        if ($nl_counts[$level] == 0) {
 
90
            print "\n=over\n\n";
 
91
        }
 
92
        $nl_counts[$level]++;
 
93
        print "\n=item $nl_counts[$level].\n\n";
 
94
        print "$txt\n";
 
95
    } elsif (/^(\*+) (.*)/) {
 
96
        my ($level, $txt) = (length($1) - 1, $2);
 
97
        if (defined $last_bl_count_level && $level != $last_bl_count_level) {
 
98
            print "\n=back\n\n";
 
99
        }
 
100
        $last_bl_count_level = $level;
 
101
        $bl_counts[$level] ||= 0;
 
102
        if ($bl_counts[$level] == 0) {
 
103
            print "\n=over\n\n";
 
104
        }
 
105
        $bl_counts[$level]++;
 
106
        print "\n=item *\n\n";
 
107
        print "$txt\n";
 
108
    } else {
 
109
        collapse_lists();
 
110
        print;
 
111
    }
 
112
}
 
113
 
 
114
collapse_lists();
 
115
 
 
116
sub collapse_lists {
 
117
    while (defined $last_nl_count_level && $last_nl_count_level >= 0) {
 
118
        print "\n=back\n\n";
 
119
        $last_nl_count_level--;
 
120
    }
 
121
    undef $last_nl_count_level;
 
122
    undef @nl_counts;
 
123
 
 
124
    while (defined $last_bl_count_level && $last_bl_count_level >= 0) {
 
125
        print "\n=back\n\n";
 
126
        $last_bl_count_level--;
 
127
    }
 
128
    undef $last_bl_count_level;
 
129
    undef @bl_counts;
 
130
}
 
131