On 25 April 2018 at 11:06, <[email protected]> wrote: > Author: henkp > Date: Wed Apr 25 10:06:11 2018 > New Revision: 1830062 > > URL: http://svn.apache.org/viewvc?rev=1830062&view=rev > Log: > attr id -> stem > > Modified: > attic/site-lua/docs/data/projects.json > attic/site-lua/docs/gen-flags > attic/site-lua/docs/mk-stuff > > Modified: attic/site-lua/docs/data/projects.json > URL: > http://svn.apache.org/viewvc/attic/site-lua/docs/data/projects.json?rev=1830062&r1=1830061&r2=1830062&view=diff > ============================================================================== > --- attic/site-lua/docs/data/projects.json (original) > +++ attic/site-lua/docs/data/projects.json Wed Apr 25 10:06:11 2018 > @@ -38,8 +38,8 @@ > "description": "Apache AxKit was an XML Application Server for Apache. It > provided on-the-fly conversion from XML to any format, such as HTML, WAP or > text using either W3C standard techniques, or flexible custom code." > }, > { > - "id": "axis-sandesha-c", > "name": "Axis Sandesha2/C", > + "stem": "axis-sandesha-c", > "project": "axis", > "subproject": "axis2/c/sandesha", > "retired": "September 2014", > @@ -288,8 +288,8 @@ > "description": "Apache MRUnit was a Java library that helped developers > unit test Apache Hadoop map reduce jobs." > }, > { > - "id": "ojb", > "name": "ObJectRelationalBridge (OJB)", > + "stem": "ojb", > "project": "db", > "subproject": "ojb", > "retired": "January 2011", > @@ -362,8 +362,8 @@ > "description": "Apache Shindig was an OpenSocial container to help you to > start hosting OpenSocial apps quickly." > }, > { > - "id": "stdcxx", > "name": "Standard C++ Library (STDCXX)", > + "stem": "stdcxx", > "project": "stdcxx", > "retired": "July 2013", > "scm": "svn", > @@ -425,8 +425,8 @@ > "description": "Wookie was a Java server application that allowed you to > upload and deploy W3C/OpenSocial/Google Wave widgets to your applications." > }, > { > - "id": "muse", > "name": "WS Muse", > + "stem": "muse", > "website": "#", > "project": "ws", > "subproject": "muse", > > Modified: attic/site-lua/docs/gen-flags > URL: > http://svn.apache.org/viewvc/attic/site-lua/docs/gen-flags?rev=1830062&r1=1830061&r2=1830062&view=diff > ============================================================================== > --- attic/site-lua/docs/gen-flags (original) > +++ attic/site-lua/docs/gen-flags Wed Apr 25 10:06:11 2018 > @@ -61,7 +61,7 @@ Error "no flags dir ($FLAGS_DIR)" unless > > sub mk_tag > { my $hash = shift ; > - my $res = $hash -> {id} ; > + my $res = $hash -> {stem} ; > unless ( $res ) > { $res = lc $hash -> {name} ; > $res =~ s![/\s]!-!g ;
The 'stem' attribute is used to override the html prefix if the name does not convert correctly. This is not necessarily the same as the website host, although it happens to work currently. A better choice is the project. > Modified: attic/site-lua/docs/mk-stuff > URL: > http://svn.apache.org/viewvc/attic/site-lua/docs/mk-stuff?rev=1830062&r1=1830061&r2=1830062&view=diff > ============================================================================== > --- attic/site-lua/docs/mk-stuff (original) > +++ attic/site-lua/docs/mk-stuff Wed Apr 25 10:06:11 2018 > @@ -10,6 +10,7 @@ my $INDX_TXT = 'data/index.txt' ; > my $PROC_TXT = 'data/process.txt' ; > my $RESO_TXT = 'data/resolution.txt' ; > my $DEST = '.' ; > +my $NA = 'n/a' ; > > my $prog = substr $0, rindex ( $0, '/' ) + 1 ; > my $Usage = <<USAGE ; > @@ -56,7 +57,7 @@ sub get_file ($) > > sub mk_tag > { my $hash = shift ; > - my $res = $hash -> {id} ; > + my $res = $hash -> {stem} ; > unless ( $res ) > { $res = lc $hash -> {name} ; > $res =~ s![/\s]!-!g ; > @@ -72,7 +73,8 @@ sub get_json > sub mk_proj_list > { my $json = shift ; > my @res = () ; > - for my $tag ( sort keys %$json ) > + for my $tag > + ( sort { lc $json->{$a}{name} cmp lc $json->{$b}{name} } keys %$json ) > { my $hash = $json -> { $tag } ; > push @res, sprintf '<a href="/projects/%s.html">%s</a>' > , $tag, $hash -> {name} ; > @@ -81,28 +83,52 @@ sub mk_proj_list > } > > sub url { sprintf '<a href="%s">%s</a>', @_ ; } > +sub site_url > + { my $site = shift ; > + return $NA if not defined $site or $site =~ /^#/ ; > + url "https://$site", $site ; > + } > sub mail_url > { my ( $p, $l ) = @_ ; > url ( "https://mail-archives.apache.org/mod_mbox/$p-$l/", $l ) ; > } > sub jira_url > { my $p = shift ; > - ( $p ? url ( "https://issues.apache.org/jira/browse/$p/", 'JIRA' ) : '' > ) ; > + return $NA unless defined $p ; > + url "https://issues.apache.org/jira/browse/$p/", 'JIRA' ; > } > sub bugz_url > { my $b = shift ; > + return '' unless defined $b ; > my $u = "https://bz.apache.org/bugzilla/buglist.cgi?product=%s" ; > - ( $b ? url ( sprintf ( $u, $b ), 'Bugzilla' ) : '' ) ; > + url sprintf ( $u, $b ), 'Bugzilla' ; > } > sub wiki_url > - { my $u = shift ; ( $u ? url ( $u, $u ) : '' ) ; } > + { my $u = shift ; > + return $NA unless defined $u ; > + url $u, $u ; > + } > sub minutes_url > { my $p = shift ; > - ( $p > - ? url ( "https://whimsy.apache.org/board/minutes/$p.html", 'Minutes' ) > - : '' > + return $NA unless defined $p ; > + url "https://whimsy.apache.org/board/minutes/$p.html", 'Minutes' > + } > +sub scm_url > + { my ( $scm, $p, $sub ) = @_ ; > + return $NA unless defined $scm ; > + $p .= "/$sub" if defined $sub ; > + ( $scm eq 'svn' > + ? url ( "http://svn.apache.org/viewvc/$p/", $scm ) > + : 'todo' > ) ; > } > +sub arch_url > + { my ( $p, $sub, $dist ) = @_ ; > + return $NA unless $dist ; > + return $NA unless defined $p ; > + $p .= "/$sub" if defined $sub ; > + url "http://archive.apache.org/dist/$p/", "archive.apache.org/dist/$p/" > + } > > sub gen_page > { my %opts = > @@ -123,43 +149,67 @@ sub gen_page > rename $TMP, $OUT or Error "can't rename $TMP, $OUT ($!)" ; > } > > +sub DEF_POST ($) > + { my $proj = shift ; > + <<POST ; > +As with any project in the Attic - if you should choose > +to fork <i>$proj</i> outside of Apache, please let us know so we > +can link to your project. > +POST > + } > + > sub mk_proj > - { my $tag = shift ; > - my $hash = shift ; > - my $name = $hash -> {name} ; > - my $proj = $hash -> {project} ; > - my $sprj = $hash -> {subproject} ; > - my $site = $hash -> {website} || "$proj.apache.org" ; > + { my $tag = shift ; > + my $hash = shift ; > + my $name = ucfirst $hash -> {name} ; > + my $proj = $hash -> {project} || $tag ; > + my $sprj = $hash -> {subproject} ; > + my $site = $hash -> {website} || "$proj.apache.org" ; > $site .= "/$sprj" if defined $sprj ; > - my $mail = join "\n| ", map { mail_url $proj, $_ } @{$hash -> > {mailnames}} ; > - my $rtrd = $hash -> {retired} ; > - my $dscr = $hash -> {description} ; > - my $post = $hash -> {postlude} || '' ; > - my $jira = $hash -> {jira} ; > - my $bugz = $hash -> {bugzilla} ; > - my $wiki = $hash -> {wiki} ; > - my @res = > - ( [ 'Website', url ( "https://$site", $site ) ] > - , [ 'Mailing List Archives', $mail ] > + my $mail = $hash -> {mailnames} ; > + my $rtrd = $hash -> {retired} ; > + my $dscr = $hash -> {description} ; > + my $post = $hash -> {postlude} || DEF_POST $name ; > + my $jira = $hash -> {jira} ; > + my $bugz = $hash -> {bugzilla} ; > + my $wiki = $hash -> {wiki} ; > + my $board = $hash -> {board} ; > + my $scm = $hash -> {scm} ; > + my $dist = not $hash -> {nodist} ; > + my @res = > + ( [ 'Website' > + , site_url $site > + ] > + , [ 'Mailing List Archives' > + , join ( "\n| ", map { mail_url $proj, $_ } @$mail ) || $NA > + ] > , [ 'Issue Tracker' > - , join ' | ', grep /./, jira_url ( $jira ), bugz_url ( $bugz ) > + , join ( ' | ', grep /./, jira_url ( $jira ), bugz_url ( $bugz ) ) > || $NA > + ] > + , [ 'Source' > + , scm_url $scm, $proj, $sprj > + ] > + , [ 'Wiki' > + , wiki_url $wiki > + ] > + , [ 'Board Reports' > + , minutes_url $board || $proj > + ] > + , [ 'Archive' > + , arch_url $proj, $sprj, $dist > ] > - , [ 'Wiki', wiki_url $wiki ] > - , [ 'Board Reports', minutes_url $hash -> {board} || $proj ] > ) ; > my $res = <<TAB ; > <p>$site moved into the Attic in $rtrd.<br>$dscr</p> > <table style="margin-left: auto; margin-right:auto; width:90%"> > -<tr><th>Read-only Resource</th> > - <th>Link(s)</th> > -</tr> > +<tr><th>Read-only Resource</th><th>Link(s)</th></tr> > TAB > for my $rec ( @res ) > { my ( $k, $d ) = @$rec ; > $res .= "<tr>\n <td>$k</td>\n <td>$d</td>\n</tr>\n" ; > } > $res .= "</table>\n" ; > - $res .= "<p>$post</p>" if $post ; > + $res .= "<p>$post</p>" ; > $res ; > } > > @@ -195,7 +245,7 @@ for my $tag ( sort keys %$json ) > { gen_page > ( PAGE => $page > , FILE => "projects/$tag.html" > - , TITLE => "Apache Attic -- Apache $tag" > + , TITLE => "Apache Attic -- Apache @{[ucfirst $tag]}" > , BODY => mk_proj ( $tag, $json -> { $tag } ) > ) ; > } > >
