OSDN Git Service

Import iptables from https://scm.osdn.net/gitroot/linuxjm/iptables.git
[linuxjm/jm.git] / admin / listnew.perl
1 #!/usr/bin/perl
2 #
3 # translation_list をさわる perl script のひな形。
4 #
5 # とりあえずこれは標準入力から translation_list を
6 # 読み込んで、 man-pages-0.4 のリリース (1998/12/24)
7 # より日付が後で、かつステータスが ◎, ○, ☆ の
8 # ページを表示します。
9 #
10 BEGIN{
11     $epath = `dirname $0`; chomp $epath;
12     my $lpath = "$epath/../bin";
13     unshift (@INC, $lpath);
14 }
15 use JMtl ('line2hash');
16
17 use Time::Local;
18
19 $yr4 = 1998;
20 $mo4 = 12 - 1; # timelocal は 0..11 のため
21 $md4 = 24;
22
23 $ptime = timelocal(0, 0, 0, $md4, $mo4, $yr4);
24
25 open TL, "cat `find $epath/../manual -name translation_list | sort` |";
26
27 while(<TL>){
28         chop;
29         %ti = line2hash($_);
30
31         if ($ti{'kind'} ne 'roff') {
32                 next;
33         }
34
35         if ($ti{'stat'} !~ m/^up2/ && $ti{'stat'} !~ m/^upd_non/) {
36                 next;
37         }
38
39         ($yr, $mo, $md) = split "/", $ti{'tdat'};
40         $mo--;
41         $rtime = timelocal(0, 0, 0, $md, $mo, $yr);
42
43         if ($rtime > $ptime) {
44                 print "$ti{'tdat'}:$ti{'pkg'}:$ti{'fname'}.$ti{'sec'}\n";
45         }
46 }
47