commit-womb
[Top][All Lists]
Advanced

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

[commit-womb] gnumaint .cvsignore Makefile gm gm-read.pl gm-u...


From: karl
Subject: [commit-womb] gnumaint .cvsignore Makefile gm gm-read.pl gm-u...
Date: Mon, 03 Dec 2012 19:06:18 +0000

CVSROOT:        /sources/womb
Module name:    gnumaint
Changes by:     karl <karl>     12/12/03 19:06:18

Modified files:
        .              : .cvsignore Makefile gm gm-read.pl gm-util.pl 
                         gnupackages.txt 
Added files:
        .              : gm-email.pl template-copyright.txt 

Log message:
        prepare for mailing with fsf copyright query

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnumaint/.cvsignore?cvsroot=womb&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnumaint/Makefile?cvsroot=womb&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/gnumaint/gm?cvsroot=womb&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/gnumaint/gm-read.pl?cvsroot=womb&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnumaint/gm-util.pl?cvsroot=womb&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnumaint/gnupackages.txt?cvsroot=womb&r1=1.115&r2=1.116
http://cvs.savannah.gnu.org/viewcvs/gnumaint/gm-email.pl?cvsroot=womb&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnumaint/template-copyright.txt?cvsroot=womb&rev=1.1

Patches:
Index: .cvsignore
===================================================================
RCS file: /sources/womb/gnumaint/.cvsignore,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- .cvsignore  23 Aug 2008 01:08:10 -0000      1.9
+++ .cvsignore  3 Dec 2012 19:06:17 -0000       1.10
@@ -7,3 +7,4 @@
 pkgnames.frommaint
 pkgnames.fromdir
 fsd
+fsfpackages.txt

Index: Makefile
===================================================================
RCS file: /sources/womb/gnumaint/Makefile,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- Makefile    6 Nov 2012 23:16:19 -0000       1.39
+++ Makefile    3 Dec 2012 19:06:17 -0000       1.40
@@ -1,11 +1,11 @@
-# $Id: Makefile,v 1.39 2012/11/06 23:16:19 karl Exp $
+# $Id: Makefile,v 1.40 2012/12/03 19:06:17 karl Exp $
 # Copyright 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 #
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
 # notice and this notice are preserved.
 
-default: pap
+default: email
 
 test-genlhtml ghtml:  # result included from www.gnu.org/graphics/manual.html
        gm generate logos html | tee ~/tmp/x.html
@@ -16,9 +16,19 @@
 test-genphtml phtml:  # result included from www.gnu.org/software/software.html
        gm generate packages html | tee ~/tmp/x.html
 
-test-genmaint maint:  # result written to gnuorg/maintainers.bypkg
+test-genmaint maint:  # this function updates gnuorg/maintainers.bypkg
        gm generate maintainers bypackage
 
+test-genemail email: fsfpackages.txt
+       gm generate email bypackage -o msg.1201 -p fsfpackages.txt -t 
template-copyright.txt
+       ls msg.1201/
+test-genemail-err:
+       gm generate email bypackage  # should give error, missing args
+test-genemail-help:
+       gm generate email bypackage -h
+fsfpackages.txt: copyright.list gm gm-read.pl gm-util.pl
+       gm list copyrightfsf >$@
+
 test-listfsf fsf:
        gm list copyrightfsf
        

Index: gm
===================================================================
RCS file: /sources/womb/gnumaint/gm,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- gm  19 Jan 2012 21:32:10 -0000      1.50
+++ gm  3 Dec 2012 19:06:17 -0000       1.51
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# $Id: gm,v 1.50 2012/01/19 21:32:10 karl Exp $
+# $Id: gm,v 1.51 2012/12/03 19:06:17 karl Exp $
 # GNU maintainer-related operations.
 # 
 # Copyright 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation Inc.
@@ -19,8 +19,9 @@
 #
 # Originally written by Karl Berry.
 
-require "gm-util.pl";
 require "gm-read.pl";
+require "gm-util.pl";
+require "gm-email.pl";
 
 $DEBUG = 0;
 $ACTIVITY_FILE = "activity-report.txt";
@@ -42,7 +43,7 @@
   my $arg1 = $ARGV[1];
   my $arg2 = $ARGV[2];
   
-  if ($cmd =~ /^-*help$/) {
+  if ($cmd =~ /^--?help$/) {
     print <<END_USAGE;
 Usage: $0 CMD ARG...
 
@@ -55,6 +56,7 @@
 check maintainers               verify consistency: gnupackages/maintainers
 check savannah                  verify consistency: gnupackages/savannah
 
+generate email bypackage        make messages to send out; add -h for details.
 generate maintainers bypackage  make /gd/gnuorg/maintainers.bypkg file
                                                 (run from address@hidden cron)
 generate logos html             make www.gnu.org/graphics/allgnupkgs.html 
@@ -247,6 +249,31 @@
 
 
 
+# Return all packages with all their maintainers, one package per
+# line, like the original format of the maintainers file.  We run this
+# from cron.
+# 
+sub generate_maintainers_bypackage {
+  my @ret = ();
+  
+  my %pkgs = &read_maintainers ("by-package");
+  
+  for my $p (sort { lc($a) cmp lc($b) } keys %pkgs) {
+    my ($entries,$generic_entry) = &maintainer_email_addrs ($pkgs{$p});
+    
+    # might not be anything in @entries if the only maintainer was generic.
+    push (@ret, "$p - $entries") if $entries;
+    
+    # if we had a generic maintainer for this package, add that as a
+    # separate entry, since that's the way rms wants it.
+    push (@ret, "$p (generic) - $generic_entry") if $generic_entry;
+  }
+  
+  return @ret;
+}
+
+
+
 # Return doc links for all packages.  The result is included in
 # www.gnu.org/manual/manual.html via SSI.
 # 
@@ -487,52 +514,6 @@
 
 
 
-# Return all packages with all their maintainers, one package per
-# line, like the original format of the maintainers file.  We run this
-# from cron.
-# 
-sub generate_maintainers_bypackage {
-  my @ret = ();
-  
-  my %pkgs = &read_maintainers ("by-package");
-  
-  for my $p (sort { lc($a) cmp lc($b) } keys %pkgs) {
-    my @entries = ();
-    my $generic_entry = "";
-    
-    for my $m (@{$pkgs{$p}}) {
-      my $name = $m->{"name"};
-      my $entry = $name;
-      $entry .= " " if $entry;
-      $entry .= "<$m->{best_email}>" if exists $m->{"best_email"};
-
-      if ($m->{"is_generic"} && $name ne "unmaintained") {
-        # Assume that if a name starts with a lowercase letter, it is
-        # generic.  If we ever have a maintainer whose real name starts
-        # with a lowercase letter, we can invent a field to distinguish.
-        # Exception: if the name is "unmaintained", just list that.
-        warn "two generic maintainers for $p?!" if $generic_entry;
-        $generic_entry = $entry;
-      } else {
-        push (@entries, $entry);
-      }
-    }
-    
-    # might not be anything in @entries if the only maintainer was generic.
-    push (@ret, "$p - " . join (", ", @entries)) if @entries;
-    
-    # if we had a generic maintainer for this package, add that as a
-    # separate entry, since that's the way rms wants it.
-    if ($generic_entry) {
-      push (@ret, "$p (generic) - $generic_entry");
-    }
-  }
-  
-  return @ret;
-}
-
-
-
 # Return all packages as relative HTML links to directories by the
 # package name.  We carefully maintain http://www.gnu.org/software/
 # so this works.  Use the simple pkgname/ directory, since nothing else
@@ -555,7 +536,7 @@
 
 
 # Return a list of strings: the packages and their maintainers, for
-# which the FSF is the copyright holder.  Or, if the NOT argument is
+# which the FSF is the copyright holder.  Or, if the NOTFSF argument is
 # set, for which it is not the copyright holder.
 # 
 sub list_copyrightfsf_ {
@@ -579,14 +560,14 @@
     if ($notfsf) {
       delete $maint_pkgs{$fsf_pkg};
     } else {
-      push (@ret, $fsf_pkg);
+      push (@ret, $fsf_pkg) if ! &skip_pkg_p ($mp);
     }
   }
   
   
   if ($notfsf) {
     # if not fsf, then we want everything left in (not deleted from) maint.
-    # a few more non-packages to delete in this case.
+    # The same few problem and non-packages to delete in this case.
     for my $mp (keys %maint_pkgs) {
       delete $maint_pkgs{$mp} if &skip_pkg_p ($mp);
     }

Index: gm-read.pl
===================================================================
RCS file: /sources/womb/gnumaint/gm-read.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gm-read.pl  19 Jan 2012 01:21:42 -0000      1.2
+++ gm-read.pl  3 Dec 2012 19:06:17 -0000       1.3
@@ -1,4 +1,4 @@
-# $Id: gm-read.pl,v 1.2 2012/01/19 01:21:42 karl Exp $
+# $Id: gm-read.pl,v 1.3 2012/12/03 19:06:17 karl Exp $
 # Subroutines for gm script that read various external data file.
 # (In this particular case, using require seemed better than setting up
 # modules.  Certainly simpler.)
@@ -115,9 +115,27 @@
       }
       
       # keyword ANY in copyright.list is not a package name for us, etc.
-      next if $w =~ /^(ANY|UNUSED|SPECIAL|TRANSLATIONS)$/;
+      next if $w =~ /^(ANY|UNUSED|SPECIAL|MISC|TRANSLATIONS)$/;
       next if $w =~ /^(CCLRC|CNOC|ET|INSIGHT|L3|LINBIT|WCT|FOO)$/;
       
+      # Some packages have legitimate entries, but are nevertheless
+      # known not to be copyright FSF.  Probably would be better to move
+      # this information to gnupackages.txt and get it from there.
+      next if $w =~ /^(# not really ours:
+                            3DLDF       #finstol
+                           |GCAL        #esken
+                           |GHOSTSCRIPT #aladdin
+                           |GNOME       #gnome
+                           |GNUZILLA    #mozilla
+                           |ICECAT      #mozilla
+                           |INDENT      #bsd et al.
+                           |INETUTILS   #bsd
+                           |LESS        #nudelman
+                           |PATCH       #lwall
+                           |SOCIAL      #new social is not the old package
+                           |VERA        #not an assignment
+                          )$/x;
+
       $w = lc ($w);
       $canonical_pkg_name = &canonicalize_pkg_name ($w);
       
@@ -133,7 +151,6 @@
   close (COPYRIGHT_LIST_FILE) || warn "close($COPYRIGHT_LIST_FILE) failed: $!";
   
   $ret{"gnustandards"} = 1; # no papers, but is copyright FSF
-  $ret{"goodbye"} = $ret{"network"} = 1; # mattl
   $ret{"libtasn1"} = 1;     # split off from gnutls, so no separate papers
   $ret{"lispintro"} = 1;    # no papers, but is copyright FSF
   $ret{"mig"} = 1;          # part of hurd
@@ -492,13 +509,13 @@
 
 
 # Read $MAINTAINERS_FILE according to $HOW, either "by-package" or
-# "by-maintainer" We return a hash.  With "by-package", the keys are
+# "by-maintainer".  We return a hash.  With "by-package", the keys are
 # package names and the values are a list of maintainer hash references.
 # With "by-maintainer", the keys are maintainer (real) names and the
 # values are hash references with their information.
 # 
-# Special maintainer keys we synthesize, that are not in the actual
-# maintainers file:
+# Special maintainer keys we synthesize, i.e., that are not in the
+# actual maintainers file:
 # is_generic - whether it is an actual person or a generic address;
 # best_email - uses privateemail where present, in preference to email;
 # lineno - location in the file.

Index: gm-util.pl
===================================================================
RCS file: /sources/womb/gnumaint/gm-util.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gm-util.pl  19 Jan 2012 01:21:42 -0000      1.2
+++ gm-util.pl  3 Dec 2012 19:06:17 -0000       1.3
@@ -1,9 +1,9 @@
-# $Id: gm-util.pl,v 1.2 2012/01/19 01:21:42 karl Exp $
+# $Id: gm-util.pl,v 1.3 2012/12/03 19:06:17 karl Exp $
 # Utilities for the gm script.
 # (In this particular case, using require seemed better than setting up
 # modules.  Certainly simpler.)
 # 
-# Copyright 2007, 2008, 2009, 2010, 2011 Free Software Foundation Inc.
+# Copyright 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation Inc.
 # 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,8 +21,52 @@
 # Originally written by Karl Berry.
 
 
+# Return the email addresses for the maintainers of package PKGREF (a
+# reference to a list of maintainer hashes).  Two strings are returned:
+# the named maintainers and any generic maintainer.  Either may be
+# empty/undef.
+# 
+sub maintainer_email_addrs {
+  my ($pkgref) = @_;
+  
+  my @entries = ();
+  my $generic_entry = "";
+
+  for my $m (@{$pkgref}) {
+    my $name = $m->{"name"};
+    my $entry = $name;
+    
+    $entry .= " " if $entry;
+    
+    if ($m->{"best_email"}) {
+      $entry .= "<$m->{best_email}>";
+    } else {
+      warn "no email for $name?!";
+    }
+
+    if ($m->{"is_generic"} && $name ne "unmaintained") {
+      # Assume that if a name starts with a lowercase letter, it is
+      # generic.  If we ever have a maintainer whose real name starts
+      # with a lowercase letter, we can invent a field to distinguish.
+      warn "two generic maintainers?! -- $entry and $generic_entry"
+        if $generic_entry;
+      $generic_entry = $entry;
+    } else {
+      push (@entries, $entry);
+    }
+  }
+  
+  # Make the individuals into a comma-separated list.
+  my $entries = join (", ", @entries);
+  
+  return ($entries,$generic_entry);
+}
+
+
 
-# Since we need this in more than one place.
+# Since we need this in more than one place.  These are listed in the
+# maintainers file, but shouldn't be included in the "allpackages"
+# lists, etc.
 #
 sub skip_pkg_p {
   my ($pkgname) = @_;

Index: gnupackages.txt
===================================================================
RCS file: /sources/womb/gnumaint/gnupackages.txt,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- gnupackages.txt     23 Nov 2012 21:56:16 -0000      1.115
+++ gnupackages.txt     3 Dec 2012 19:06:17 -0000       1.116
@@ -1,4 +1,4 @@
-# $Id: gnupackages.txt,v 1.115 2012/11/23 21:56:16 karl Exp $
+# $Id: gnupackages.txt,v 1.116 2012/12/03 19:06:17 karl Exp $
 # Public domain.
 # 
 # This file is maintained in the CVS repository of GNU womb,
@@ -134,7 +134,7 @@
 doc-summary: Emacs environment for editing (all flavors of) TeX files
 doc-url: /software/auctex/manual/
 gplv3-status: done-in-11.85
-activity-status: ok 20100221 (11.86)
+activity-status: ok 20121130 (11.87)
 
 package: autoconf
 doc-category: Software
@@ -331,7 +331,7 @@
 activity-status: ok 20111011 (1.4)
 
 package: cgicc
-copyright-holder: not-fsf
+copyright-holder: notfsf
 doc-category: Libraries
 doc-summary: C++ class library for writing CGI applications
 doc-url: none
@@ -409,7 +409,7 @@
 doc-summary: (u)Common C++ framework
 doc-url: none
 gplv3-status: not-done-commoncpp2-1.6.3.tar.gz, done-ucommon-1.9.1
-activity-status: ok commoncpp2-1.8.0/20100224 (ucommon-6.0/2012121120)
+activity-status: ok commoncpp2-1.8.0/20100224 (ucommon-6.1/20121126)
 last-contact: 8jun10 wrote
 
 package: complexity
@@ -417,7 +417,7 @@
 doc-summary: analyzing complexity of C functions
 doc-url: /software/complexity/manual/
 gplv3-status: done
-activity-status: ok 0.4 (20110515)
+activity-status: ok 1.0 (20121125)
 
 package: config
 doc-category: Software
@@ -627,7 +627,7 @@
 doc-summary: Line editor
 doc-url: htmlxref
 gplv3-status: done-in-1.0
-activity-status: ok 20120101 (1.6)
+activity-status: ok 20121124 (1.7)
 
 package: edma
 mundane-name: EDMA
@@ -868,7 +868,7 @@
 doc-shop: 
http://shop.fsf.org/product/debugging-gdb-gnu-source-level-debugger-10/
 gplv3-status: done-in-6.7
 logo: /software/gdb/images/archer.jpg
-activity-status: ok 20120817 (7.5)
+activity-status: ok 20121129 (7.5.1)
 
 package: gdbm
 doc-category: Database
@@ -1396,6 +1396,7 @@
 
 package: gnustandards
 mundane-name: GNU organization
+copyright-holder: fsf
 doc-category: gnuorg
 doc-summary: GNU coding standards and maintainer information
 doc-url: htmlxref
@@ -1418,7 +1419,7 @@
 doc-summary: Transport layer security library
 doc-url: /software/gnutls/manual/
 gplv3-status: stays-v2-indefinitely (gnumaint-reply 21 Aug 2007 11:13:04)
-activity-status: ok 20121109 (3.1.4, 2.11.20/20121108)
+activity-status: ok 20121124 (3.1.5, 2.11.20/20121108)
 
 package: gnutrition
 language: python
@@ -1472,8 +1473,9 @@
 doc-category: Software
 doc-summary: Prolog compiler
 doc-url: http://www.gprolog.org/manual/
-gplv3-status: not-done-in-1.3.1 # 1feb10 wrote
-activity-status: ok 20110707 (1.4.0)
+gplv3-status: not-done-in-1.3.1
+activity-status: ok 20121129 (1.4.2)
+last-contact: 1feb10 wrote
 
 package: grabcomics
 mundane-name: phpGrabComics
@@ -1603,7 +1605,7 @@
 doc-summary: Scheme implementation intended especially for extensions
 doc-url: /software/guile/manual/
 gplv3-status: not-done-in-1.8.6-planned-for-1.10/2.0-in-2009 # neil 12jan09
-activity-status: ok 20120707 (2.0.6)
+activity-status: ok 20121129 (2.0.7)
 
 package: guile-dbi
 doc-category: Database
@@ -1717,7 +1719,7 @@
 activity-status: ok 20120824 (1.40.12)
 
 package: hp2xx
-copyright-holder: not-fsf
+copyright-holder: notfsf
 doc-category: Printing
 doc-summary: Convert HP-GL format graphics to many vector and bitmap formats
 doc-url: none
@@ -1757,7 +1759,7 @@
 doc-summary: Entirely free browser derived from Mozilla Firefox
 doc-url: none
 gplv3-status: not-applicable-since-not-our-program
-activity-status: ok 20120821 (14.0)
+activity-status: ok 20121201 (17.0.1)
 
 package: idutils
 doc-category: Software
@@ -1942,11 +1944,11 @@
 doc-summary: Library for evaluating symbolic expressions
 doc-url: htmlxref
 gplv3-status: done-as-of-1.1.7
-activity-status: ok 20120922 (1.1.9)
+activity-status: ok 20121129 (1.1.10)
 last-contact: 18jun11 replied/wrote, 10nov10 wrote
 
 package: libmicrohttpd
-copyright-holder: not-fsf
+copyright-holder: notfsf
 language: c
 doc-category: Libraries
 doc-summary: C library implementing an HTTP 1.1 server
@@ -1971,7 +1973,7 @@
 doc-summary: Browser add-on that blocks nonfree nontrivial JavaScript
 doc-url: /software/librejs/manual/
 gplv3-status: ok
-activity-status: ok 20121106 (4.9.1)
+activity-status: ok 20121125 (4.9.2)
 
 package: libsigsegv
 doc-category: Software
@@ -1986,7 +1988,7 @@
 doc-summary: ASN.1 library
 doc-url: /software/libtasn1/manual/
 gplv3-status: done-as-of-2.6
-activity-status: ok 20121029 (3.0)
+activity-status: ok 20121130 (3.2)
 note: originated with gnutls, so copyright fsf, even though no explicit
 note: assignment has been needed yet.
 
@@ -2398,7 +2400,7 @@
 
 package: parallel
 logo: /software/parallel/logo.png
-copyright-holder: not-fsf
+copyright-holder: notfsf
 doc-category: Sysadmin
 doc-summary: Build and execute command lines in parallel
 doc-url: /software/parallel/man.html
@@ -2581,7 +2583,7 @@
 doc-summary: configure interface for Python-based packages
 doc-url: none
 gplv3-status: stays-lgplv2-indefinitely (rms 26 Sep 2010 06:37:43)
-activity-status: newpkg/20121105
+activity-status: ok 20121126 (0.1)
 
 package: pythonwebkit
 language: python
@@ -2822,7 +2824,7 @@
 doc-url: http://docs.solfege.org/
 logo: http://www.solfege.org/static/logo.png
 gplv3-status: done-in-3.10.3
-activity-status: ok 20120620 (3.20.6)
+activity-status: ok 20121126 (3.20.7)
 
 package: sourceinstall
 doc-category: Sysadmin

Index: gm-email.pl
===================================================================
RCS file: gm-email.pl
diff -N gm-email.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gm-email.pl 3 Dec 2012 19:06:17 -0000       1.1
@@ -0,0 +1,156 @@
+# $Id: gm-email.pl,v 1.1 2012/12/03 19:06:17 karl Exp $
+# Generate a batch of email messages.  See the help string below.
+# In a separate file just because it gets kind of long.
+#
+# Copyright 2012 Free Software Foundation Inc.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Originally written by Karl Berry.
+
+
+# Maybe someday we will need "bymaintainer", or something else.
+#
+sub generate_email_bypackage {
+  splice (@ARGV, 0, 3);  # lose the "generate email ..."
+  my ($output_dir, $pkg_list, $template_file);
+  while (my $arg = shift @ARGV) {
+    if ($arg eq "-h") {
+      print <<END_GENEMAIL_HELP;
+Usage: $0 generate email batch  -o OUTDIR  -p PKGLIST-FILE  -t TEMPLATE-FILE
+
+Generate a batch of email messages in OUTDIR,
+one for each package in PKGLIST-FILE (plain text, one package name per line),
+doing substitutions in TEMPLATE-FILE to make each actual message.
+All three of these options are required.
+
+Any previous contents of OUTDIR is removed, so the program can be run
+many times while tweaking the template and package list.
+
+No email is actually sent (do that by running, e.g., sendmail -t on each
+file in OUTDIR after you are satisfied with the contents).
+END_GENEMAIL_HELP
+      exit 0;
+
+    } elsif ($arg eq "-o") {
+      $output_dir = shift @ARGV;
+    } elsif ($arg eq "-p") {
+      $pkglist_file = shift @ARGV;
+    } elsif ($arg eq "-t") {
+      $template_file = shift @ARGV;
+    }
+  }
+  
+  # Check values.
+  die "$0: generate email group needs all of -o, -p, -t; try -h for help.\n"
+    if (! $output_dir || ! $pkglist_file || ! $template_file);
+  #
+  die "$0: package list file nonexistent or empty: $pkglist_file"
+    if ! -s $pkglist_file;
+  #
+  die "$0: template file nonexistent or empty: $template_file"
+    if ! -s $template_file;
+  # 
+  if (! -e $output_dir || -d $output_dir) {
+    system ("rm -rf $output_dir");
+    mkdir ($output_dir, 0777) || die "$0: mkdir($output_dir) failed: $!\n";
+  } else {
+    die "$0: output directory exists and is not a directory: $output_dir\n";
+  }
+  
+  my %maint_file = &read_maintainers ("by-package");
+  
+  my $count = 0;
+  open (PKGLIST, $pkglist_file) || die "open($pkglist_file) failed: $!";
+  while (<PKGLIST>) {
+    (my $pkg = $_) =~ s/\s.*$//;  # take first word of each line, ignore rest.
+    die "$0: Not a package in the maintainers file: $pkg\n"
+      if ! exists $maint_file{$pkg};
+
+    # for msg.1201, rms said to explicitly exclude Hurd from the query.
+    # And there's no point in checking on gnustandards or trans-coord.
+    next if $pkg =~ /^(mig|hurd|gnumach|gnustandards|trans-coord)$/;
+
+    my $msg = &make_msg ($template_file, $pkg, $maint_file{$pkg});
+    next if ! $msg;  # skipping this one since unmaintained, etc.
+    
+    local *MSG;
+    $MSG = ">$output_dir/$pkg";
+    open (MSG) || die "open($MSG) failed: $!";
+    print MSG $msg;
+    close (MSG) || die "close($MSG) failed: $!";
+    
+    $count++;
+  }
+  close (PKGLIST) || warn "close($pkglist_file) failed: $!";
+  
+  return "$count messages generated in $output_dir/.";
+}
+
+
+# PKGREF is a hash with the information for PKGNAME from the maintainers
+# file.  Expand TEMPLATE_FILE and return it as a string.  Except if the
+# package is unmaintained, then return undef.
+# 
+sub make_msg {
+  my ($template_file,$pkgname,$pkgref) = @_;
+  
+  # ignore generic entry if present, we want to write the individuals.
+  my ($maintainer_email_addrs,undef) = &maintainer_email_addrs ($pkgref);
+  return undef if $maintainer_email_addrs =~ /^unmaintained/;
+
+  # Ok, we're unnecessarily rereading the template file every time.
+  open (TEMPLATE, $template_file) || die "open($template_file) failed: $!";
+  my $msg = join ("", <TEMPLATE>);
+  close (TEMPLATE) || warn "close($template_file) failed: $!";
+  
+  my $pretty_email_addrs = &prettify_for_msg ($maintainer_email_addrs);
+  
+  # Template substitutions.
+  $msg =~ s/%PACKAGE_NAME/$pkgname/g;
+  $msg =~ s/%PACKAGE_MAINTAINERS/$pretty_email_addrs/g;
+  
+  return $msg;
+}
+
+# Given single string of email ADDRS, break into multiple lines at a
+# somewhat reasonable length, prepending tabs to second and subsequent
+# lines.  The idea being that the result can be used in the To: header.
+# 
+sub prettify_for_msg {
+  my ($addrs) = @_;
+  my $ret = "";
+  
+  my @addrs = split (/, /, $addrs);
+  return $addrs if @addrs == 1;  # only one, just return it.
+  
+  my $line_len = 0;
+  for (my $i = 0; $i < @addrs; $i++) {
+    $ret .= $addrs[$i];              # add addr
+    $ret .= "," if $i + 1 < @addrs;  # add comma if not the last one
+
+    $line_len += length ($addrs[$i]) + 1;  # what we just added
+    if ($line_len > 71) {
+      # long enough, end this line and start the next:
+      $ret .= "\n\t" if $i +1 < @addrs;  # unless it's the last one.
+      $line_len = 0;
+    } else {
+      $ret .= " ";  # add space, will continue on this line
+    }
+  }
+  
+  return $ret;
+}
+
+1;

Index: template-copyright.txt
===================================================================
RCS file: template-copyright.txt
diff -N template-copyright.txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ template-copyright.txt      3 Dec 2012 19:06:17 -0000       1.1
@@ -0,0 +1,34 @@
+From: address@hidden (GNU Project)
+To: %PACKAGE_MAINTAINERS
+Subject: %PACKAGE_NAME and non-FSF-copyrighted code
+Precedence: bulk
+
+Greetings,
+
+I'm sending you this message on behalf of the GNU Project because
+according to the FSF's records, you are the maintainer(s) of
+%PACKAGE_NAME, which is supposed to be an FSF-copyrighted package.
+
+We would like to gather information on any code or other material in
+your package that is *not* copyrighted by the FSF.  Could you please
+reply to this message (which should go to address@hidden) and let
+us know?  That is, one of:
+
+1) There is no non-FSF-copyrighted material in %PACKAGE_NAME.
+
+2) There is non-FSF-copyrighted code included in %PACKAGE_NAME,
+   per the procedure described in the External Libraries node
+   of the maintainers' guide:
+   http://www.gnu.org/prep/maintain/html_node/External-Libraries.html
+
+3) Something else.
+
+Please include any and all relevant details.
+
+(Aside from this, if you have any news or questions regarding the
+package, please let us know at address@hidden)
+
+Thanks for contributing to GNU, and happy hacking.
+
+Karl Berry
+Assistant Chief GNUisance



reply via email to

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