commit-womb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commit-womb] gnumaint gm-generate.pl


From: karl
Subject: [commit-womb] gnumaint gm-generate.pl
Date: Wed, 26 Feb 2014 00:05:09 +0000

CVSROOT:        /sources/womb
Module name:    gnumaint
Changes by:     karl <karl>     14/02/26 00:05:09

Modified files:
        .              : gm-generate.pl 

Log message:
        include (scaled) package logo when available; original suggestion from 
karen sandler

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnumaint/gm-generate.pl?cvsroot=womb&r1=1.15&r2=1.16

Patches:
Index: gm-generate.pl
===================================================================
RCS file: /sources/womb/gnumaint/gm-generate.pl,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- gm-generate.pl      5 Nov 2013 14:41:52 -0000       1.15
+++ gm-generate.pl      26 Feb 2014 00:05:09 -0000      1.16
@@ -1,4 +1,4 @@
-# $Id: gm-generate.pl,v 1.15 2013/11/05 14:41:52 karl Exp $
+# $Id: gm-generate.pl,v 1.16 2014/02/26 00:05:09 karl Exp $
 # The generate actions for the gm script (see --help message).
 # 
 # Copyright 2007, 2008, 2009, 2010, 2012, 2013
@@ -348,8 +348,11 @@
     my $msgprefix = "$PKGBLURBS_FILE:$pkg{lineno}";
     warn "$msgprefix: $pkgname not in gnupackages\n"
       if ! exists $gnupkgs{$pkgname};
+    #
+    # Retrieve info from packages file.
     my $pkglabel = $gnupkgs{$pkgname}->{"human-label"};
-    my $activity = $gnupkgs{$pkgname}->{"activity-status"};
+    my $pkgactivity = $gnupkgs{$pkgname}->{"activity-status"};
+    my $pkglogo = $gnupkgs{$pkgname}->{"logo"};
     delete $gnupkgs{$pkgname}; # so we can see what's left over
     
     # we intentionally omit blurbs for some packages.
@@ -362,18 +365,30 @@
     my $rxsafe_id = quotemeta ($pkgname);
     $rxsafe_id =~ s,\\-,-,g;  # \- troubles ineiev's request-blurbs
 
-    # this ssi stuff lets the homepage extract a single blurb to display.
+    # This ssi stuff lets the homepage extract a single blurb to display.
     push (@ret, qq,\n<!--,
                   . qq,#if expr="\$pkg_selection = /:($rxsafe_id|ALL):/" -->,);
 
+    # Include the package logo (scaled) in the head, if there is one.
+    my $logo_xhtml = "";
+    if ($pkglogo) {
+      # SSI stuff so that our <img>s do not become localizable texts
+      # that the translators have to deal with.
+      $logo_xhtml
+        = qq,\n<!--#set var="logoimage",
+        . qq, value='<img src="$pkglogo" style="height:1em" />'\n,
+        . qq,  --> <!--#echo encoding="none" var="logoimage" -->,;
+    }
+    
     # Note for translators if the package is stale.
     my $stale_comment = "";
-    $stale_comment = "<!-- TRANSLATORS: stale -->" if $activity =~ /^stale/;
+    $stale_comment = "<!-- TRANSLATORS: stale -->" if $pkgactivity =~ /^stale/;
 
     # Include it in both HTML elements so that, e.g., msggrep can be used.
     push (@ret, qq,<h4 id="$xhtml_id">,
                   . qq,$stale_comment,
-                  . qq,<a href="/software/$pkgname/">$pkglabel</a></h4>,
+                  . qq,$logo_xhtml,
+                  . qq,\n  <a href="/software/$pkgname/">$pkglabel</a></h4>,
                   . ($stale_comment ? "\n" : "")
                   . qq,<p>$stale_comment,);
 
@@ -411,7 +426,7 @@
     # let's advertise if the package is looking for a maintainer.  maybe
     # we'll find someone.
     push (@ret, "This package is looking for a maintainer.")
-      if $activity =~ /^nomaint/;
+      if $pkgactivity =~ /^nomaint/;
 
     my $doc_links = "/manual/manual.html#$xhtml_id";
     push (@ret, qq!<small>(<a href="$doc_links">doc</a>)!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]