Package: devscripts
Version: 2.10.55
Severity: wishlist
File: /usr/bin/licensecheck

Hi,

the attached patch adds a --copyright-split option (and a config variable) to
display copyright holders one per line. That is much more readable IMHO, and
it makes it possible to do stuff like 'sort -u' with the output.

For example, the difference is something like this:

Without that option:

../libwnck/selector.c: LGPL (v2 or later) (with incorrect FSF address) 
  [Copyright: 2000 Helix Code, Inc / 2001 Free Software Foundation, Inc / 2003 
Sun Microsystems, Inc / 2005-2007 Vincent Untz]

With it:

libwnck/selector.c: LGPL (v2 or later) (with incorrect FSF address) 
  [Copyright: 2000 Helix Code, Inc]
  [Copyright: 2001 Free Software Foundation, Inc]
  [Copyright: 2003 Sun Microsystems, Inc]
  [Copyright: 2005-2007 Vincent Untz]

Maybe it should even be the default behaviour and we should add a
 --copyright-join option to return to the old one, but I'd be happy
if this patch is applied.

Cheers,
Emilio

-- Package-specific info:

--- /etc/devscripts.conf ---

--- ~/.devscripts ---
DEBCHANGE_RELEASE_HEURISTIC=changelog
DEBRELEASE_UPLOADER=dput
DEBRELEASE_DEBS_DIR=../build-area
DEBSIGN_KEYID=4A08B2FE
LICENSECHECK_COPYRIGHT_SPLIT=yes
USCAN_VERBOSE=yes
USCAN_SYMLINK=rename
USCAN_REPACK=yes
USCAN_DESTDIR=../tarballs
WHOUPLOADS_MAXUPLOADS=10

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-1-686 (SMP w/2 CPU cores)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages devscripts depends on:
ii  dpkg-dev                      1.15.4     Debian package development tools
ii  libc6                         2.9-26     GNU C Library: Shared libraries
ii  perl                          5.10.0-25  Larry Wall's Practical Extraction 

Versions of packages devscripts recommends:
ii  at                 3.1.11-1              Delayed job execution and batch pr
ii  bsd-mailx [mailx]  8.1.2-0.20090911cvs-1 simple mail user agent
ii  bzr                1.18-1                easy to use distributed version co
ii  curl               7.19.5-1.1            Get a file from an HTTP, HTTPS or 
ii  cvs                1:1.12.13-12          Concurrent Versions System
ii  dctrl-tools        2.13.1                Command-line tools to process Debi
ii  debian-keyring [de 2009.08.27            GnuPG (and obsolete PGP) keys of D
ii  dput               0.9.5.1               Debian package upload tool
ii  epiphany-gecko [ww 2.26.3-2              Intuitive GNOME web browser - Geck
ii  epiphany-webkit [w 2.27.92-3             Intuitive GNOME web browser - WebK
ii  equivs             2.0.7-0.1             Circumvent Debian package dependen
ii  fakeroot           1.13                  Gives a fake root environment
ii  git-core           1:1.6.3.3-2           fast, scalable, distributed revisi
ii  gnupg              1.4.10-1              GNU privacy guard - a free PGP rep
ii  iceweasel [www-bro 3.5.2-1               lightweight web browser based on M
ii  libauthen-sasl-per 2.12-1                Authen::SASL - SASL Authentication
ii  libcrypt-ssleay-pe 0.57-2                Support for https protocol in LWP
ii  libparse-debcontro 2.005-2               Easy OO parsing of Debian control-
ii  libsoap-lite-perl  0.710.08-2            Client and server side SOAP implem
ii  libterm-size-perl  0.2-4+b1              Perl extension for retrieving term
ii  libtimedate-perl   1.1600-9              Time and date functions for Perl
ii  liburi-perl        1.37+dfsg-1           Manipulates and accesses URI strin
ii  libwww-perl        5.831-1               WWW client/server library for Perl
ii  libyaml-syck-perl  1.07-1                fast, lightweight YAML loader and 
ii  links [www-browser 2.2-1+b1              Web browser running in text mode
ii  lintian            2.2.15                Debian package checker
ii  lsb-release        3.2-23                Linux Standard Base version report
ii  lzma               4.43-14               Compression method of 7z format in
ii  man-db             2.5.6-2               on-line manual pager
ii  mercurial          1.3.1-1               scalable distributed version contr
ii  openssh-client [ss 1:5.1p1-7             secure shell client, an rlogin/rsh
ii  patch              2.5.9-5               Apply a diff file to an original
ii  patchutils         0.3.1-2               Utilities to work with patches
ii  sensible-utils     0.0.1                 Utilities for sensible alternative
ii  strace             4.5.18-1              A system call tracer
ii  subversion         1.6.5dfsg-1           Advanced version control system
ii  unzip              6.0-1                 De-archiver for .zip files
ii  w3m [www-browser]  0.5.2-2.1             WWW browsable pager with excellent
ii  wdiff              0.5-19                Compares two files word by word
ii  wget               1.11.4-4              retrieves files from the web

Versions of packages devscripts suggests:
ii  build-essential               11.4       Informational list of build-essent
pn  cvs-buildpackage              <none>     (no description available)
pn  devscripts-el                 <none>     (no description available)
pn  gnuplot                       <none>     (no description available)
pn  libfile-desktopentry-perl     <none>     (no description available)
pn  libnet-smtp-ssl-perl          <none>     (no description available)
ii  mutt                          1.5.20-3   text-based mailreader supporting M
ii  svn-buildpackage              0.6.27     helper programs to maintain Debian

-- no debconf information
Index: scripts/licensecheck.pl
===================================================================
--- scripts/licensecheck.pl	(revisión: 2009)
+++ scripts/licensecheck.pl	(copia de trabajo)
@@ -78,6 +78,11 @@
 
 Also display copyright text found within the file
 
+=item B<--copyright-split>
+
+If copyrights are to be displayed, print each copyright holder in its own
+line.
+
 =item B<--no-conf> B<--noconf>
 
 Do not read any configuration files. This can only be used as the first
@@ -100,6 +105,11 @@
 If this is set to I<yes>, then it is the same as the --verbose command
 line parameter being used. The default is I<no>.
 
+=item B<LICENSECHECK_COPYRIGHT_SPLIT>
+
+If this is set to I<yes>, then it is the same as the --copyright-split
+command line parameter being used. The default is I<no>.
+
 =item B<LICENSECHECK_PARSELINES>
 
 If this is set to a positive number then the specified number of lines
@@ -164,6 +174,7 @@
   = ('', '', '', '', '');
 my $opt_recursive = 0;
 my $opt_copyright = 0;
+my $opt_copyright_split = 0;
 my ($opt_help, $opt_version);
 my $def_lines = 60;
 
@@ -177,6 +188,7 @@
     my @config_files = ('/etc/devscripts.conf', '~/.devscripts');
     my %config_vars = (
 		       'LICENSECHECK_VERBOSE' => 'no',
+		       'LICENSECHECK_COPYRIGHT_SPLIT' => 'no',
 		       'LICENSECHECK_PARSELINES' => $def_lines,
 		      );
     my %config_default = %config_vars;
@@ -196,6 +208,8 @@
     # Check validity
     $config_vars{'LICENSECHECK_VERBOSE'} =~ /^(yes|no)$/
 	or $config_vars{'LICENSECHECK_VERBOSE'} = 'no';
+    $config_vars{'LICENSECHECK_COPYRIGHT_SPLIT'} =~ /^(yes|no)$/
+	or $config_vars{'LICENSECHECK_COPYRIGHT_SPLIT'} = 'no';
     $config_vars{'LICENSECHECK_PARSELINES'} =~ /^[1-9][0-9]*$/
 	or $config_vars{'LICENSECHECK_PARSELINES'} = $def_lines;
 
@@ -208,6 +222,7 @@
     chomp $modified_conf_msg;
 
     $opt_verbose = $config_vars{'LICENSECHECK_VERBOSE'} eq 'yes' ? 1 : 0;
+    $opt_copyright_split = $config_vars{'LICENSECHECK_COPYRIGHT_SPLIT'} eq 'yes' ? 1 : 0;
     $opt_lines = $config_vars{'LICENSECHECK_PARSELINES'};
 }
 
@@ -219,6 +234,7 @@
 	   "recursive|r" => \$opt_recursive,
 	   "check|c=s" => \$opt_check_regex,
 	   "copyright" => \$opt_copyright,
+	   "copyright-split" => \$opt_copyright_split,
 	   "noconf" => \$opt_noconf,
 	   "no-conf" => \$opt_noconf,
 	   )
@@ -301,8 +317,16 @@
     print "$file: ";
     print "*No copyright* " unless $copyright;
     print $license . "\n";
-    print "  [Copyright: " . $copyright . "]\n"
-      if $copyright and $opt_copyright;
+
+    if ( $copyright and $opt_copyright ) {
+	if ( ! $opt_copyright_split ) {
+	    print "  [Copyright: " . $copyright . "]\n";
+	} else {
+	    foreach my $single_copyright (@copyrights{keys %copyrights}) {
+		print "  [Copyright: " . $single_copyright . "]\n";
+	    }
+	}
+    }
     print "\n" if $opt_copyright;
 }
 

Reply via email to