Stefan Lippers-Hollmann <s....@gmx.de> writes:
> On Saturday 31 May 2014, Stefan Lippers-Hollmann wrote:
>> On Saturday 31 May 2014, Gerald Turner wrote:
>> > Stefan Lippers-Hollmann <s....@gmx.de> writes:
>> > > On Saturday 31 May 2014, Gerald Turner wrote:
> [...]
>> > Would you like me to spend some time reconstructing a DEP-5
>> > copyright file for 2.1, or would that also be wasted effort?
>>
>> It doesn't make sense to start collecting the copyright information
>> from the 2.1 release, as meanwhile 28 files changed their copyright
>> (new years, typically 2014, added), 24 new files were added + the
>> whole new subdirectory hs20/ (which is fortunately licensed rather
>> uniformly) and with 6 files being completely removed. If we already
>> had this DEP-5 listing for 2.1, it would be reasonable to update it,
>> but when starting from scratch, it only makes sense to start from
>> current upstream HEAD (and then to use git diff <hash>..hostap_2_2,
>> to fill up the gaps until v2.1 gets tagged. I'm not asking you to
>> spend time on this, as I know far too well how demotivating this is,
>> but I certainly wouldn't say no to a patch either.
>
> Just as a hint, I have just[1] updated debian/get-orig-source to work
> with wpa 2.2~. Using a version number like e.g.
>       2.1+git20140531.1+147848e-1
> then fetches the according upstream tarball.

Well, I've done it, and it sure was tedious!

Steps:

  git log --full-diff -p hostapd hs20 patches src wpa_supplicant | \
    egrep '(^diff|Copyright)' | \
    grep -B1 Copyright | \
    ./git-log-full-diff-parse-copyright

The Perl script (attached) took a few hours to write - there's a brick
of about 60 lines to munge file moves.  Then about another hour to
inspect all that output, plus poking at each file to make sure that the
license change actually occured.

--
Gerald Turner <gtur...@unzane.com>        Encrypted mail preferred!
OpenPGP: 4096R / CA89 B27A 30FA 66C5 1B80  3858 EC94 2276 FDB8 716D
Index: debian/copyright
===================================================================
--- debian/copyright	(revision 1866)
+++ debian/copyright	(working copy)
@@ -1,152 +1,248 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: wpa_supplicant
+Upstream-Name: hostapd
 Upstream-Contact: Jouni Malinen <j...@w1.fi>
-Source: http://w1.fi/wpa_supplicant/
+Source: git://w1.fi/srv/git/hostap.git
 
 Files: *
-Copyright: 2002-2012, Jouni Malinen <j...@w1.fi>
-License: BSD or GPL-2
+Copyright: 2002-2014, Jouni Malinen <j...@w1.fi>
+License: BSD
 
+Files: hostapd/Android.mk
+Copyright: 2008, The Android Open Source Project
+License: BSD
+
 Files: hostapd/logwatch/*
 Copyright: 2005, Henrik Brix Andersen <b...@gentoo.org>
 License: BSD or GPL-2
 
-Files: hostapd/hostapd.8
-       hostapd/hostapd_cli.1
-Copyright: 2005, Faidon Liambotis <fai...@cube.gr>
-License: BSD or GPL-2
+Files: hs20/*
+Copyright: 2012-2014, Qualcomm Atheros, Inc.
+License: BSD
 
-Files: patches/*
-Copyright: 2005, Alexey Kobozev <akobo...@cisco.com>
-           2005-2012, Jouni Malinen <j...@w1.fi>
-License: BSD or GPL-2
+Files: src/ap/acs.*
+Copyright: 2011, Atheros Communications
+           2013, Qualcomm Atheros, Inc.
+License: BSD
 
+Files: src/ap/ap_config.*
+Copyright: 2003-2014, Jouni Malinen <j...@w1.fi>
+           2007-2008, Intel Corporation
+License: BSD
+
 Files: src/ap/ap_list.*
-       src/ap/ap_mlme.*
-       src/ap/beacon.*
-       src/ap/hw_features.*
-       src/ap/vlan_init.*
-       src/ap/wmm.*
 Copyright: 2002-2009, Jouni Malinen <j...@w1.fi>
-           2002-2004, Instant802 Networks, Inc.
+           2003-2004, Instant802 Networks, Inc.
+           2006, Devicescape Software, Inc.
+           2007-2008, Intel Corporation
+License: BSD
+
+Files: src/ap/ap_mlme.*
+Copyright: 2003-2008, Jouni Malinen <j...@w1.fi>
+           2003-2004, Instant802 Networks, Inc.
            2005-2006, Devicescape Software, Inc.
-License: BSD or GPL-2
+License: BSD
 
-Files: src/ap/ieee802_11_ht.c
-Copyright: 2002-2009, Jouni Malinen <j...@w1.fi>
+Files: src/ap/beacon.*
+Copyright: 2002-2004, Instant802 Networks, Inc.
+           2005-2006, Devicescape Software, Inc.
            2007-2008, Intel Corporation
-License: BSD or GPL-2
+           2008-2012, Jouni Malinen <j...@w1.fi>
+License: BSD
 
-Files: src/ap/p2p_hostapd.*
+Files: src/ap/dfs.*
+Copyright: 2002-2013, Jouni Malinen <j...@w1.fi>
+           2013, Qualcomm Atheros, Inc.
+License: BSD
+
+Files: src/ap/gas_serv.*
+Copyright: 2011-2014, Qualcomm Atheros, Inc.
+License: BSD
+
+Files: src/ap/hostapd.h
+Copyright: 2002-2013, Jouni Malinen <j...@w1.fi>
+           2007-2008, Intel Corporation
+License: BSD
+
+Files: src/ap/hs20.*
+Copyright: 2009, Atheros Communications, Inc.
+           2011-2013, Qualcomm Atheros, Inc.
+License: BSD
+
+Files: src/ap/hw_features.*
+Copyright: 2002-2003, Instant802 Networks, Inc.
+           2005-2006, Devicescape Software, Inc.
+           2008-2012, Jouni Malinen <j...@w1.fi>
+License: BSD
+
+Files: src/ap/ieee802_11.*
+       src/ap/ieee802_11_ht.c
+Copyright: 2002-2013, Jouni Malinen <j...@w1.fi>
+           2007-2008, Intel Corporation
+License: BSD
+
+Files: src/ap/p2p_hostapd.c
 Copyright: 2009-2010, Atheros Communications
-License: BSD or GPL-2
+License: BSD
 
+Files: src/ap/sta_info.c
+Copyright: 2002-2013, Jouni Malinen <j...@w1.fi>
+           2007-2008, Intel Corporation
+License: BSD
+
+Files: src/ap/vlan_init.*
+Copyright: 2003, Instant802 Networks, Inc.
+           2005-2006, Devicescape Software, Inc.
+           2009, Jouni Malinen <j...@w1.fi>
+License: BSD
+
+Files: src/ap/vlan_util.*
+Copyright: 2012, Michael Braun <michael-...@fami-braun.de>
+License: BSD
+
+Files: src/ap/wmm.*
+Copyright: 2002-2003, Instant802 Networks, Inc.
+           2005-2006, Devicescape Software, Inc.
+           2009, Jouni Malinen <j...@w1.fi>
+License: BSD
+
+Files: src/ap/wnm_ap.*
+Copyright: 2011-2013, Qualcomm Atheros, Inc.
+License: BSD
+
 Files: src/common/gas.*
 Copyright: 2009, Atheros Communications
-           2011, Qualcomm Atheros
-License: BSD or GPL-2
+           2011-2012, Qualcomm Atheros
+License: BSD
 
 Files: src/common/ieee802_11_defs.h
 Copyright: 2002-2009, Jouni Malinen <j...@w1.fi>
            2007-2008, Intel Corporation
-License: BSD or GPL-2
+License: BSD
 
-Files: src/common/wireless_copy.h
-Copyright: 1997-2007, Jean Tourrilhes <j...@hpl.hp.com>
-License: BSD or GPL-2
+Files: src/common/ieee802_1x_defs.h
+Copyright: 2013-2014, Qualcomm Atheros, Inc.
+License: BSD
 
+Files: src/common/qca-vendor*
+Copyright: 2014, Qualcomm Atheros, Inc.
+License: BSD
+
+Files: src/common/wpa_helpers.*
+Copyright: 2010-2011, Atheros Communications, Inc.
+           2011-2012, Qualcomm Atheros, Inc.
+License: BSD
+
+Files: src/drivers/driver.h
+Copyright: 2002-2014, Jouni Malinen <j...@w1.fi>
+           2007-2008, Intel Corporation
+License: BSD
+
 Files: src/drivers/driver_atheros.c
 Copyright: 2004, Sam Leffler <s...@errno.com>
            2004, Video54 Technologies
            2005-2007, Jouni Malinen <j...@w1.fi>
            2009, Atheros Communications
-License: BSD or GPL-2
+License: BSD
 
-Files: src/drivers/driver_broadcom.c
-Copyright: 2004, Nikki Chumkov <ni...@gattaca.ru>
-           2004, Jouni Malinen <j...@w1.fi>
-License: BSD or GPL-2
-
 Files: src/drivers/driver_bsd.c
-Copyright: 2004, Sam Leffler <s...@errno.com>
-           2004, 2Wire, Inc
-License: BSD or GPL-2
+Copyright: 2004, 2Wire, Inc
+           2004, Sam Leffler <s...@errno.com>
+License: BSD
 
+Files: src/drivers/driver_macsec_qca.c
+Copyright: 2004, Gunter Burchardt <t...@isx.de>
+           2005-2009, Jouni Malinen <j...@w1.fi>
+           2013-2014, Qualcomm Atheros, Inc.
+License: BSD
+
 Files: src/drivers/driver_madwifi.c
 Copyright: 2004, Sam Leffler <s...@errno.com>
            2004, Video54 Technologies
            2004-2007, Jouni Malinen <j...@w1.fi>
-License: BSD or GPL-2
+License: BSD
 
 Files: src/drivers/driver_nl80211.c
-Copyright: 2002-2010, Jouni Malinen <j...@w1.fi>
+Copyright: 2002-2014, Jouni Malinen <j...@w1.fi>
            2003-2004, Instant802 Networks, Inc.
            2005-2006, Devicescape Software, Inc.
            2007, Johannes Berg <johan...@sipsolutions.net>
            2009-2010, Atheros Communications
-License: BSD or GPL-2
+License: BSD
 
 Files: src/drivers/driver_none.c
 Copyright: 2008, Atheros Communications
-License: BSD or GPL-2
+License: BSD
 
-Files: src/drivers/driver_ralink.*
-Copyright: 2003-2006, Jouni Malinen <j...@w1.fi>
-           2007, Snowpin Lee <snowpin_...@ralinktech.com.tw>
-License: BSD or GPL-2
+Files: src/drivers/driver_openbsd.c
+Copyright: 2013, Mark Kettenis
+License: BSD
 
 Files: src/drivers/driver_roboswitch.c
 Copyright: 2008-2009, Jouke Witteveen
-License: BSD or GPL-2
+License: BSD
 
 Files: src/drivers/driver_wired.c
-Copyright: 2005-2009, Jouni Malinen <j...@w1.fi>
+Copyright: 2002-2009, Jouni Malinen <j...@w1.fi>
            2004, Gunter Burchardt <t...@isx.de>
-License: BSD or GPL-2
+License: BSD
 
 Files: src/drivers/nl80211_copy.h
-Copyright: 2006-2010, Johannes Berg <johan...@sipsolutions.net>
+Copyright: 2006-2010 Johannes Berg <johan...@sipsolutions.net>
            2008, Michael Wu <flaming...@sourmilk.net>
            2008, Luis Carlos Cobo <lui...@cozybit.com>
            2008, Michael Buesch <m...@bues.ch>
-           2008-2009, Luis R. Rodriguez <lrodrig...@atheros.com>
+           2008-2009 Luis R. Rodriguez <lrodrig...@atheros.com>
            2008, Jouni Malinen <jouni.mali...@atheros.com>
            2008, Colin McCabe <co...@cozybit.com>
 License: ISC
 
 Files: src/eap_common/eap_pwd_common.*
-       src/eap_peer/eap_pwd.c
        src/eap_server/eap_server_pwd.c
 Copyright: 2010, Dan Harkins <dhark...@lounge.org>
-License: BSD or GPL-2
+License: BSD
 
+Files: src/eap_peer/eap_proxy*
+Copyright: 2011-2013, Qualcomm Atheros, Inc.
+License: BSD
+
 Files: src/l2_packet/l2_packet_freebsd.c
 Copyright: 2003-2005, Jouni Malinen <j...@w1.fi>
            2005, Sam Leffler <s...@errno.com>
-License: BSD or GPL-2
+License: BSD
 
 Files: src/p2p/*
 Copyright: 2009-2010, Atheros Communications
-License: BSD or GPL-2
+License: BSD
 
+Files: src/pae/*
+Copyright: 2013-2014, Qualcomm Atheros, Inc.
+License: BSD
+
 Files: src/rsn_supp/tdls.c
 Copyright: 2010-2011, Atheros Communications
-License: BSD or GPL-2
+License: BSD
 
-Files: src/tls/libtommath.c
-Copyright: Tom St Denis
-License: public-domain
+Files: src/utils/browser*
+Copyright: 2013, Qualcomm Atheros, Inc.
+License: BSD
 
+Files: src/utils/http*
+Copyright: 2012-2014, Qualcomm Atheros, Inc.
+License: BSD
+
 Files: src/utils/radiotap.c
        src/utils/radiotap_iter.h
 Copyright: 2007, Andy Green <a...@warmcat.com>
-           2007, Johannes Berg <johan...@sipsolutions.net>
+           2009, Johannes Berg <johan...@sipsolutions.net>
 License: BSD or GPL-2
 
 Files: src/utils/radiotap.h
-Copyright: 2003-2004, David Young
+Copyright: 2003-2004 David Young
 License: BSD
 
+Files: src/utils/xml*
+Copyright: 2012-2013, Qualcomm Atheros, Inc.
+
 Files: src/wps/http.h
        src/wps/upnp_xml.*
        src/wps/wps_upnp.*
@@ -162,35 +258,75 @@
 
 Files: src/wps/httpread.*
 Copyright: 2008, Ted Merrill, Atheros Communications
-License: BSD or GPL-2
+License: BSD
 
 Files: src/wps/ndef.c
        src/wps/wps_nfc.c
        src/wps/wps_nfc_pn531.c
        src/wps/wps_ufd.c
-Copyright: 2009, Masashi Honma <ho...@ictec.co.jp>
-License: BSD or GPL-2
+Copyright: 2009-2012, Masashi Honma <ho...@ictec.co.jp>
+License: BSD
 
 Files: src/wps/wps_validate.c
 Copyright: 2010, Atheros Communications, Inc.
-License: BSD or GPL-2
+License: BSD
 
-Files: wpa_supplicant/dbus/dbus_common.*
-       wpa_supplicant/dbus/dbus_common_i.h
-       wpa_supplicant/dbus/dbus_new.*
-       wpa_supplicant/dbus/dbus_new_handlers.*
-       wpa_supplicant/dbus/dbus_new_handlers_wps.c
-       wpa_supplicant/dbus/dbus_new_helpers.*
+Files: wpa_supplicant/Android.mk
+Copyright: 2008, The Android Open Source Project
+License: Apache-2.0
+
+Files: wpa_supplicant/ap.*
+Copyright: 2002-2009, Jouni Malinen <j...@w1.fi>
+           2007-2008, Intel Corporation
+           2009, Atheros Communications
+License: BSD
+
+Files: wpa_supplicant/autoscan*
+Copyright: 2012, Intel Corporation. All rights reserved.
+License: BSD
+
+Files: wpa_supplicant/dbus/*
 Copyright: 2006, Dan Williams <d...@redhat.com> and Red Hat, Inc.
            2009-2010, Witold Sowa <witold.s...@gmail.com>
            2009, Jouni Malinen <j...@w1.fi>
-License: BSD or GPL-2
+License: BSD
 
-Files: wpa_supplicant/dbus/dbus_dict_helpers.*
-       wpa_supplicant/dbus/dbus_old*
-Copyright: 2006, Dan Williams <d...@redhat.com> and Red Hat, Inc.
-License: BSD or GPL-2
+Files: wpa_supplicant/driver_i.h
+Copyright: 2002-2009, Jouni Malinen <j...@w1.fi>
+           2007-2008, Intel Corporation
+License: BSD
 
+Files: wpa_supplicant/gas_query.*
+       wpa_supplicant/offchannel.*
+       wpa_supplicant/p2p_supplicant.*
+Copyright: 2009-2010, Atheros Communications
+           2011-2014, Qualcomm Atheros
+           2011-2014, Jouni Malinen <j...@w1.fi>
+License: BSD
+
+Files: wpa_supplicant/hs20_supplicant.*
+Copyright: 2009, Atheros Communications, Inc.
+           2011-2013, Qualcomm Atheros, Inc.
+License: BSD
+
+Files: wpa_supplicant/interworking.*
+Copyright: 2011-2014, Jouni Malinen <j...@w1.fi>
+           2011-2013, Qualcomm Atheros, Inc.
+License: BSD
+
+Files: wpa_supplicant/utils/log2pcap.py
+Copyright: 2012, Intel Corporation
+License: BSD
+
+Files: wpa_supplicant/wifi_display.*
+Copyright: 2011, Atheros Communications, Inc.
+           2011-2012, Qualcomm Atheros, Inc.
+License: BSD
+
+Files: wpa_supplicant/wnm_sta.*
+Copyright: 2011-2013, Qualcomm Atheros, Inc.
+License: BSD
+
 Files: wpa_supplicant/wpa_gui-qt4/icons/ap.svg
 Copyright: 2008, mystica
 License: public-domain
@@ -214,32 +350,20 @@
 Files: wpa_supplicant/wpa_gui-qt4/peers.*
        wpa_supplicant/wpa_gui-qt4/stringquery.*
 Copyright: 2009-2010, Atheros Communications
-License: BSD or GPL-2
+License: BSD
 
 Files: wpa_supplicant/wpa_gui-qt4/signalbar.*
 Copyright: 2011, Kel Modderman <k...@otaku42.de>
-License: BSD or GPL-2
+License: BSD
 
-Files: wpa_supplicant/Android.mk
-Copyright: 2008, The Android Open Source Project
-License: Apache-2.0
+Files: wpa_supplicant/wpa_supplicant_conf.*
+Copyright: 2010, The Android Open Source Project
+License: BSD
 
-Files: wpa_supplicant/ap.*
-Copyright: 2003-2009, Jouni Malinen <j...@w1.fi>
-           2009, Atheros Communications
-License: BSD or GPL-2
+Files: wpa_supplicant/wpas_kay.c
+Copyright: 2013-2014, Qualcomm Atheros, Inc.
+License: BSD
 
-Files: wpa_supplicant/gas_query.*
-       wpa_supplicant/offchannel.*
-       wpa_supplicant/p2p_supplicant.*
-Copyright: 2009-2010, Atheros Communications
-           2011, Qualcomm Atheros
-License: BSD or GPL-2
-
-Files: wpa_supplicant/interworking.*
-Copyright: 2011, Qualcomm Atheros
-License: BSD or GPL-2
-
 Files: debian/*
 Copyright: 2004-2006, Kyle McMartin <k...@debian.org>
            2005-2009, Faidon Liambotis <parav...@debian.org>
@@ -342,4 +466,3 @@
  default settings. The main purpose of having this version here is to make it
  easier to build bignum.c wrapper without having to install and build an
  external library.
-
#!/usr/bin/perl

use strict;
use warnings;

use List::MoreUtils qw(uniq);

my %files;
my $current;
while (my $line = <>) {
  chomp $line;
  if ($line =~ /^diff.*b\/(.*)/) {
    $current = $1;
    if (!-e $current) {
      $current =~ s/^hostapd\//src\/ap\//;
      $current =~ s/^src\/ap\/driver/src\/drivers\/driver/;
      $current =~ s/^src\/ap\/ap\.h/wpa_supplicant\/ap\.h/;
      $current =~ s/^src\/ap\/config/src\/ap\/ap_config/;
      $current =~ s/^src\/ap\/eapol_sm/src\/eapol_auth\/eapol_auth_sm/;
      $current =~ s/^src\/ap\/hostap_common\.h/src\/drivers\/driver_hostap\.h/;
      $current =~ s/^src\/ap\/hostapd_defs\.h/src\/utils\/common\.h/;
      $current =~ s/^src\/ap\/mlme/src\/ap\/ap_mlme/;
      $current =~ s/^src\/ap\/peerkey\.c/src\/ap\/peerkey_auth\.c/;
      $current =~ s/^src\/ap\/pmksa_cache/src\/ap\/pmksa_cache_auth/;
      $current =~ s/^src\/ap\/preauth/src\/ap\/preauth_auth/;
      $current =~ s/^src\/ap\/wpa\.h/src\/ap\/wpa_auth\.h/;
      $current =~ s/^src\/ap\/wpa\.c/src\/ap\/wpa_auth\.c/;
      $current =~ s/^src\/ap\/wpa_ft\.c/src\/ap\/wpa_auth_ft\.c/;
      $current =~ s/^src\/ap\/radiotap/src\/utils\/radiotap/;
      $current =~ s/^src\/ap\/sta_flags\.h/src\/ap\/sta_info\.h/;
      $current =~ s/^src\/ap\/wme/src\/ap\/wmm/;
      $current =~ 
s/^src\/common\/nl80211_copy\.h/src\/drivers\/nl80211_copy\.h/;
      $current =~ s/^src\/crypto\/aes.c/src\/crypto\/aes-internal.c/;
      $current =~ s/^src\/crypto\/aes_wrap.c/src\/crypto\/aes-wrap.c/;
      $current =~ s/^src\/crypto\/des.c/src\/crypto\/des-internal.c/;
      $current =~ s/^src\/crypto\/md4.c/src\/crypto\/md4-internal.c/;
      $current =~ s/^src\/crypto\/rc4.h/src\/crypto\/crypto.h/;
      $current =~ s/^src\/drivers\/driver_i\.h/wpa_supplicant\/driver_i\.h/;
      $current =~ s/^src\/eap_peer\/eap_aka_prime\.c/src\/eap_peer\/eap_aka\.c/;
      $current =~ s/^src\/eap_peer\/eap_tlv\.c/src\/eap_peer\/eap_peap\.c/;
      $current =~ 
s/^src\/eap_peer\/eap_tlv\.h/src\/eap_common\/eap_tlv_common\.h/;
      $current =~ s/^src\/eap_server\/eap\.c/src\/eap_server\/eap_server\.c/;
      $current =~ 
s/^src\/eap_server\/eap_aka\.c/src\/eap_server\/eap_server_aka.c/;
      $current =~ 
s/^src\/eap_server\/eap_aka_prime\.c/src\/eap_server\/eap_server_aka\.c/;
      $current =~ 
s/^src\/eap_server\/eap_fast\.c/src\/eap_server\/eap_server_fast\.c/;
      $current =~ 
s/^src\/eap_server\/eap_gpsk\.c/src\/eap_server\/eap_server_gpsk\.c/;
      $current =~ 
s/^src\/eap_server\/eap_gtc\.c/src\/eap_server\/eap_server_gtc\.c/;
      $current =~ 
s/^src\/eap_server\/eap_identity\.c/src\/eap_server\/eap_server_identity\.c/;
      $current =~ 
s/^src\/eap_server\/eap_ikev2\.c/src\/eap_server\/eap_server_ikev2\.c/;
      $current =~ 
s/^src\/eap_server\/eap_md5\.c/src\/eap_server\/eap_server_md5\.c/;
      $current =~ 
s/^src\/eap_server\/eap_methods\.c/src\/eap_server\/eap_server_methods\.c/;
      $current =~ 
s/^src\/eap_server\/eap_mschapv2\.c/src\/eap_server\/eap_server_mschapv2\.c/;
      $current =~ 
s/^src\/eap_server\/eap_pax\.c/src\/eap_server\/eap_server_pax\.c/;
      $current =~ 
s/^src\/eap_server\/eap_peap\.c/src\/eap_server\/eap_server_peap\.c/;
      $current =~ 
s/^src\/eap_server\/eap_psk\.c/src\/eap_server\/eap_server_psk\.c/;
      $current =~ 
s/^src\/eap_server\/eap_sake\.c/src\/eap_server\/eap_server_sake\.c/;
      $current =~ 
s/^src\/eap_server\/eap_sim\.c/src\/eap_server\/eap_server_sim\.c/;
      $current =~ 
s/^src\/eap_server\/eap_tls\.c/src\/eap_server\/eap_server_tls\.c/;
      $current =~ 
s/^src\/eap_server\/eap_tls_common\.c/src\/eap_server\/eap_server_tls_common\.c/;
      $current =~ 
s/^src\/eap_server\/eap_tlv\.c/src\/eap_server\/eap_server_peap\.c/;
      $current =~ 
s/^src\/eap_server\/eap_tnc\.c/src\/eap_server\/eap_server_tnc\.c/;
      $current =~ 
s/^src\/eap_server\/eap_ttls\.c/src\/eap_server\/eap_server_ttls\.c/;
      $current =~ 
s/^src\/eap_server\/eap_vendor_test\.c/src\/eap_server\/eap_server_vendor_test\.c/;
      $current =~ 
s/^src\/eap_server\/eap_wsc\.c/src\/eap_server\/eap_server_wsc\.c/;
      $current =~ s/^src\/drivers\/radiotap/src\/utils\/radiotap/;
      $current =~ s/^src\/drivers\/scan_helpers\.c/wpa_supplicant\/scan\.c/;
      $current =~ s/^src\/hlr_auc_gw\/hlr_auc_gw\.c/hostapd\/hlr_auc_gw\.c/;
      $current =~ s/^src\/hlr_auc_gw\/milenage/src\/crypto\/milenage/;
      $current =~ s/^src\/tls\/asn1_test\.c/tests\/test-asn1\.c/;
      $current =~ s/^wpa_supplicant\/ctrl_iface_/wpa_supplicant\//;
      $current =~ s/^wpa_supplicant\/dbus\/ctrl_iface_/wpa_supplicant\/dbus\//;
      $current =~ s/^wpa_supplicant\/dbus\./wpa_supplicant\/dbus\/dbus\./;
      $current =~ s/^wpa_supplicant\/dbus_/wpa_supplicant\/dbus\/dbus_/;
      $current =~ 
s/^wpa_supplicant\/dbus\/dbus\./wpa_supplicant\/dbus\/dbus_old\./;
      $current =~ 
s/^wpa_supplicant\/dbus\/dbus_handlers/wpa_supplicant\/dbus\/dbus_old_handlers/;
      $current =~ s/^wpa_supplicant\/mlme/src\/ap\/ap_mlme/;
      $current =~ s/^wpa_supplicant\/tests\/test_/tests\/test-/;
    }
  }
  else {
    my @copyrights = ();
    if (exists $files{$current}) {
      @copyrights = @{$files{$current}};
    }
    push @copyrights, $line;
    $files{$current} = \@copyrights;
  }
}

foreach my $file (sort keys %files) {
  if ($file =~ 
/^(CONTRIBUTIONS|COPYING|README|eap_example|doc|mac80211_hwsim|radius_example|test|wlantest|www)/)
 {
    next;
  }
  print "\nFile: $file";
  if (!-e $file) {
    print " (file does not exist)";
  }
  print "\n";

  my %owners;
  foreach my $copyright (@{$files{$file}}) {
    if ($copyright =~ /([0-9]{4})(-([0-9]{4}))?,?\s*(.*)/) {
      my $year_start = $1;
      my $year_end = $3;
      my $owner = $4;

      my @years = ();
      if (exists $owners{$owner}) {
        @years = @{$owners{$owner}};
      }
      if (defined $year_end) {
        for (my $year = $year_start; $year <= $year_end; $year++) {
          push @years, $year;
        }
      }
      else {
        push @years, $year_start;
      }

      my @unique_years = uniq @years;
      $owners{$owner} = \@unique_years;
    }
  }

  foreach my $owner (sort keys %owners) {
    print "Copyright: ";
    my $previous;
    my $ranging;
    foreach my $year (@{$owners{$owner}}) {
      if (!defined $previous) {
        print $year;
        $previous = $year;
        next;
      }
      if ($year == $previous + 1) {
        if (!$ranging) {
          print "-";
          $ranging = 1;
        }
        $previous = $year;
        next;
      }
      if ($ranging) {
        print $previous;
        $ranging = 0;
      }
      print ",$year";
      $previous = $year;
    }

    if ($ranging) {
      print $previous;
    }
    print ", $owner\n";
  }
}

Attachment: pgpHcJv83OlDL.pgp
Description: PGP signature

Reply via email to