Develop and Download Open Source Software

Browse CVS Repository

Diff of /tombo/htdocs/pagegen.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.8 by hirami, Sat Feb 11 15:43:36 2006 UTC revision 1.9 by hirami, Mon Sep 11 17:18:55 2006 UTC
# Line 19  $base = $ARGV[2]; Line 19  $base = $ARGV[2];
19    
20  opendir(DIR_S, $srcdir) || die;  opendir(DIR_S, $srcdir) || die;
21  while($file = readdir(DIR_S)) {  while($file = readdir(DIR_S)) {
22          next unless ($file =~ /\.tmpl/);          next unless ($file =~ /\.tmpl$/);
23          pagegen($file);          pagegen($file);
24  }  }
25  closedir(DIR_S);  closedir(DIR_S);
# Line 57  sub pagegen() { Line 57  sub pagegen() {
57                          include_history(OUT);                          include_history(OUT);
58                  }                  }
59                  if (/^<!-- HEADLINE -->$/) {                  if (/^<!-- HEADLINE -->$/) {
60                      include_headline(OUT);                          include_headline(OUT);
61                    }
62    #               if (/^<!-- DL\(([0-9a-zA-Z_]+), +([0-9]+)\) -->$/) {
63                    if (/^<!-- DL\(([0-9a-zA-Z_]+), *([0-9]+)\) -->$/) {
64                            expand_dl(OUT, $1, $2);
65                  }                  }
66                  print OUT "$_\n";                  print OUT "$_\n";
67          }          }
# Line 65  sub pagegen() { Line 69  sub pagegen() {
69          close(OUT);          close(OUT);
70  }  }
71    
72    sub expand_dl()
73    {
74            my ($stream, $prefix, $dlid) = @_;
75            my ($rs, $disp, $arch, $suffix);
76            open(DL, "$srcdir/download.conf") || die;
77            while(<DL>) {
78                    chop;
79                    next if (/^#/);
80                    ($rs, $disp, $arch, $suffix, $path, $cmt) = split(/     /);
81                    if ($rs eq "") {
82                            print $stream "<tr><td>$disp<td>$arch<td><a href=\"http://prdownloads.sourceforge.jp/tombo/$dlid/$prefix"."_$suffix.zip\">$prefix"."_$suffix.zip</a><td>$path<td>$cmt\n"
83                    } elsif ($rs ne "c") {
84                            print $stream "<tr><td rowspan=\"$rs\">$disp<td>$arch<td><a href=\"http://prdownloads.sourceforge.jp/tombo/$dlid/$prefix"."_$suffix.zip\">$prefix"."_$suffix.zip</a><td>$path<td>$cmt\n";
85                    } else {
86                            print $stream "<tr><td>$arch<td><a href=\"http://prdownloads.sourceforge.jp/tombo/$dlid/$prefix"."_$suffix.zip\">$prefix"."_$suffix.zip</a><td>$path<td>$cmt\n";
87                    }
88            }
89            close(DL);
90    }
91    
92  sub include_top()  sub include_top()
93  {  {
94          my ($stream) = @_;          my ($stream) = @_;

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26