aboutsummaryrefslogtreecommitdiffstats
path: root/dist-tools/timeseries
blob: 7a20c4c28c05056a16085c6a701fd61db5757792 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/perl
#
# Extract information on the fetchmail project size from the NEWS file
#
# Note: this only works if you have a news file from 5.1.1 or later --
# I didn't patch the code sizes into NEWS until then.
#
my($release, $date, $jdate);

%month_offsets = (
	"Jan",   0,
	"Feb",   31,
	"Mar",   59,
	"Apr",   90,
	"May",   120,
	"Jun",   151,
	"Jul",   181,
	"Aug",   212,
	"Sep",   243,
	"Oct",   273,
	"Nov",   304,
	"Dec",   334,
);


sub day_offset
{
    my($datestring) = @_;
    my($wday, $month, $day, $time, $zone, $year) = split(' ', $datestring);
    my($jdate);

    # We don't deal with leap years here because the baseline day is after
    # the last leap year (1996) and there's a long time before the next
    # one (2004).
    $jdate = ($year - 1996) * 365;

    $jdate += $month_offsets{$month};

    $jdate += ($day - 1);

    # Baseline day for the size data was Fri Oct 25 23:02:26 EDT 1996 
    $jdate -= 297;

    return($jdate);
}

open(NEWS, "NEWS");
$timestamp = `date`;
chop $timestamp;
$release = "unknown";
$lines = "unknown";
$date = "unknown";
$jdate = "unknown";
print <<EOF;
# Population data from fetchmail NEWS file, as of $timestamp.
#
# Output other than pass-through % lines is tab-separated fields.
# Field 1: release ID
# Field 2: count of source lines under version control 
# Field 3: count of fetchmail-friends subscribers
# Field 4: count of fetchmail-announce subscribers
# Field 5: total subscribers to both lists
# Field 6: date of release (days since first datum)
# Field 7: date of release (RFC822 date format)
#
EOF
while ($_ = <NEWS>)
{
    my($sum);

    if (/^%/) {
	print $_;
    }
    elsif (/^fetchmail-([^ ]*) \(([^)]+)\)(, [0-9]* lines)?:/) {
	$release = $1;
	$date = $2;
	$jdate = &day_offset($date);
	if ($3) {
	    $lines = substr($3, 2, length($3) - 8);
	} else {
	    $lines = 'na'
	}
    }
    elsif (/There are ([0-9]*) people on fetchmail-friends and ([0-9]*) on fetchmail-announce/) {
	$sum = $1 + $2;
	print "${release}\t${lines}\t$1\t$2\t${sum}\t${jdate}\t${date}\n";
	$release = "unknown";
	$date = "unknown";
    }
    elsif (/There are ([0-9]*) people on the fetchmail-friends list./) {
	print "$release\t${lines}\t$1\t0\t$1\t$jdate\t$date\n";
	$release = "unknown";
	$date = "unknown";
    }
}

# end
an>> <em>Floating-point</em> ( <code>a</code>, <code>A</code>, <code>e</code>, <code>E</code>, <code>f</code>, <code>F</code>, <code>g</code>, <code>G</code> ) <p> <em>Integer</em> ( <code>i</code> ) <p> <em>Count</em> ( <code>n</code> ) <p> <em>Octal</em> ( <code>o</code> ) <p> <em>Pointer</em> ( <code>p</code> ) <p> <em>String</em> ( <code>s</code> ) <p> <em>Unsigned</em> ( <code>u</code> ) <p> <em>Hex</em> ( <code>x</code>, <code>X</code> ) <p> <em>Scanlist</em> ( <code>[]</code> ) <p> Scanlist Exclusion (<code>^</code> ) <p> Scanlist Range ( <code>-</code> ) [TRIO] <p> <ul> <li> Only increasing ranges, i.e. <code>[a-b]</code>, but not <code>[b-a]</code>. <li> Transitive ranges, ie. <code>[a-b-c]</code> equals <code>[a-c]</code>. <li> Trailing minus, ie. <code>[a-]</code> is interpreted as an <code>a</code> and a <code>-</code>. <li> Duplicates are ignored.</ul> Scanlist Equivalence Class Expression ( <code>[</code>= =<code>]</code> ) [TRIO] <p> Locale dependent (LC_COLLATE). Only one expression can appear inside the delimiters. <ul> <li> <code>[=a=]</code> All letters in the same equivalence class as the letter <code>a</code>. <div class="fragment"><pre> trio_scanf("%[[=a=]b]\n", buffer); trio_scanf("%[[=a=][=b=]]\n", buffer); </pre></div></ul> Scanlist Character Class Expression ( <code>[</code>: :<code>])</code> [TRIO] Locale dependent (LC_CTYPE). Only one expression can appear inside the delimiters. <ul> <li> <code>[:alnum:]</code> Same as <code>[:alpha:]</code> and <code>[:digit:]</code> <li> <code>[:alpha:]</code> Same as <code>[:lower:]</code> and <code>[:upper:]</code> <li> <code>[:cntrl:]</code> Control characters <li> <code>[:digit:]</code> Decimal digits <li> <code>[:graph:]</code> Printable characters except space <li> <code>[:lower:]</code> Lower case alphabetic letters <li> <code>[:print:]</code> Printable characters <li> <code>[:punct:]</code> Punctuation <li> <code>[:space:]</code> Whitespace characters <li> <code>[:upper:]</code> Upper case alphabetic letters <li> <code>[:xdigit:]</code> Hexadecimal digits <div class="fragment"><pre> trio_scanf("%[[:alnum:]]\n", buffer); trio_scanf("%[[:alpha:][:digit:]]\n", buffer); </pre></div></ul> <b>RETURN</b> <b>VALUES</b> <p> <b>SEE</b> <b>ALSO</b> <p> <a class="el" href="group___printf.html#a0">trio_printf</a> <hr><h2>Function Documentation</h2> <a name="a0" doxytag="trio.c::trio_scanf"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int trio_scanf </td> <td class="md" valign="top">(&nbsp;</td> <td class="md" nowrap valign="top">const char *&nbsp;</td> <td class="mdname" nowrap>&nbsp; <em>format</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>...&nbsp;</td> <td class="mdname" nowrap>&nbsp;</td> </tr> <tr> <td></td> <td class="md">)&nbsp;</td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> &nbsp; </td> <td> <p> Scan characters from standard input stream. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>format</em>&nbsp;</td><td> Formatting string. </td></tr> <tr><td valign=top><em>...</em>&nbsp;</td><td> Arguments. </td></tr> </table> </dl><dl compact><dt><b> Returns: </b><dd> Number of scanned characters. </dl> </td> </tr> </table> <HR> <center class="copyright">Copyright (C) 2001 Bj&oslash;rn Reese and Daniel Stenberg.</center> </body> </html>