COPYRIGHT000644001750001750 245114347334266 16155 0ustar00jonasjonas000000000000String-Copyright-0.003014Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: String-Copyright Upstream-Contact: Jonas Smedegaard (JONASS) Source: https://metacpan.org/pod/String::Copyright Files: Changes META.json META.yml doap.ttl lib/String/Copyright.pm t/50_context.t t/50_identifier.t t/50_owner.t Copyright: Copyright 2022 Jonas Smedegaard. License: AGPL_3 Files: dist.ini t/20_parse.t t/30_RE2_missing.t t/50_encoding.t t/50_range.t Copyright: Copyright 2021 Jonas Smedegaard. License: AGPL_3 Files: INSTALL LICENSE README TODO Copyright: Unknown License: Unknown Files: COPYRIGHT CREDITS SIGNATURE Copyright: None License: public-domain Files: Makefile.PL Copyright: Copyright 2020 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 License: AGPL_3 This software is Copyright (c) 2022 by Jonas Smedegaard. This is free software, licensed under: The GNU Affero General Public License, Version 3, November 2007 License: Artistic-1.0 This software is Copyright (c) 2022 by the copyright holder(s). This is free software, licensed under: The Artistic License 1.0 License: GPL-1.0 This software is Copyright (c) 2022 by the copyright holder(s). This is free software, licensed under: The GNU General Public License, Version 1, February 1989 CREDITS000644001750001750 35014347334266 15656 0ustar00jonasjonas000000000000String-Copyright-0.003014Maintainer: - Jonas Smedegaard (JONASS) Thanks: - Dominique Dumont - Perl Ancar (PERLANCAR) - Petter Reinholdtsen - Slaven Rezic (SREZIC) Changes000644001750001750 2065414347334266 16202 0ustar00jonasjonas000000000000String-Copyright-0.003014String-Copyright ================ Created: 2016-07-21 Home page: Home page: Bug tracker: Maintainer: Jonas Smedegaard (JONASS) 0.003014 2022-12-17 [ Documentation ] - fix a few typos in POD [ Test Suite ] - check spelling of PODs with tidyall - fix wordlist in author test pod-spell [ Other ] - detect SPDX-FileCopyrightText: as stricl label 0.003013 2022-01-16 [ Documentation ] - slightly improve POD section DESCRIPTION [ Test Suite ] - silence author test pod-spell - simplify context tests to not require utf8 IO [ Packaging ] - work around tidyall string-encoding bug [ Other ] - skip bogus copyright holder starting with more year template patterns, including [yyyy] 0.003012 2021-12-16 [ Bug Fixes ] - fix detect owner after (space-delimited) dash - fix skip non-copyright chatter of single word at end of line [ Other ] - cover copyright sign misparsed from latin1 or MacRoman, and skip other misparsed characters (most commonly é but also cyrillic, vietnamese and CJK characters) - generalize patterns colon_or_dash delimiter - skip bogus copyright holder starting with YEAR - skip bogus identifier preceded by dash - skip identifier followed by ' License' - skip identifier followed by ', patent' - slight optimization: re-computing substring-after-regex-match already available - use Set::IntSpan (not Number::Range) 0.003011 2021-09-04 [ Documentation ] - add Purism SPC as copyright holder [ Test Suite ] - teach author test pod-spell about the word 'Affero' [ Packaging ] - runtime-recommend re::engine::RE2 - skip kwalitee test: fails to recognize AGPL licensing - test-require Test::Without::Module [ Other ] - detect '\(co' (© in roff markup) as identifier - detect pseudo-sign after years - detect real copyright preceded by bogus (have bogus match be non-greedy) - detect vague sign '-C-' as identifier, except standalone - relicense project as AGPL-3-or-newer - skip identifier followed by ' dates ' - skip identifier followed by ' for ' - skip non-indentifier followed by ' This ' - skip non-indentifier followed by ' of ' - skip non-range '19xx' - skip pseudo-sign chatter of single character in (at least ending) parens - skip pseudo-sign followed by ' all begin ' - tighten to detect only vague year as owner (not other strings beginning with dash) - treat leading dash with space around as delimiter (not part of owner) - use re::engine::RE2 when available 0.003010 2021-08-28 - relax to cover double colon or colon preceded by space - skip non-identifier ' for copyright' - skip non-identifiers 'copyright sign ' 'copyright symbol ' 'copyright text ' 0.003009 2021-08-28 - skip bogus pseudo-sign chatter '(c) You must' - skip dummy year - skip non-owner starting with are/disclaimer/if/interest/permission/treaty - skip non-owner starting with (non-delimiting) comma - skip non-owner the library/software, then comma - skip nonidentifier 'Copyright Act' - skip nonidentifier 'we copyright' 0.003008 2021-08-18 [ Packaging ] - require Test2::V1 (not Test::More) [ Other ] - detect identifier 'copyright: (C)' - require word boundary after literal copyright as identifier - rewrite tests to use Test2::V1 - skip non-identifier '_copyright' - skip non-identifier 'copyright applies' - skip non-identifier 'copyright at' - skip non-identifier 'copyright block' - skip non-identifier 'copyright or' - skip non-identifier 'copyright tag' - skip non-identifier 'copyright transfer' - skip non-identifier 'copyright-' (other than 'copyright-holder') - skip non-identifier 'no copyright' 0.003007 2021-08-16 [ Bug Fixes ] - silence warning at duplicate year or single-year range [ Documentation ] - fix typo in example code [ Test Suite ] - test identifiers - test skipped initial owner characters - tighten TODO test succeeding since v0.003005 [ Other ] - detect {c} (i.e. braces-wrapped c, supplementing parens-wrapped c) as identifier - skip dollar or percentage sign as initial owner character - slightly simplify regexp variable signs_and_more_re - stop precompile intermediate regexp variables 0.003006 2018-09-27 [ Bug Fixes ] - Fix declare dependency on Number::Range at runtime (not only for tests). Perl Ancar++ [ Other ] - Tidy spaces. 0.003005 2016-11-30 [ Bug Fixes ] - Fix skip chatter after boilerplate. - Fix skip some pseudosign chatter, and skip single question mark after copyright signs (possibly fallout from broken converted copyright sign). Dominique Dumont++ [ Test Suite ] - Add tests for broken copyright sign and boilerplate chatter. 0.003004 2016-09-23 [ Bug Fixes ] - Fix avoid regex modifier r (available only since Perl 5.14). [ Documentation ] - Add TODO file. - Fix remove POD mentions or subs for unimplemented features. [ Other ] - Suppress "assigned" and "generated" as chatter. 0.003003 2016-09-07 [ Bug Fixes ] - Fix reset detected chatter at newline (regression since 0.002000). Dominique Dumont++ 0.003002 2016-09-07 [ Bug Fixes ] - Fix avoid misdetecting bogus multi-range year spans. - Fix strip owner intro (e.g. "by "). - Fix suppress eq as chatter. Petter Reinholdtsen++ [ Other ] - Capture each year span. - Shorten regexes $blank_or_break_re $comma_re and make more greedy. - Use Number::Range to normalize years. 0.003001 2016-08-21 [ Bug Fixes ] - Fix relax detection of owner to permit prefix (for styled names like "(URW)++"). [ Other ] - Improve cleanup of "all rights reserved" boilerplate to not necessarily be last. 0.003000 2016-08-13 [ Documentation ] - Fix list example option inside threshold header in POD. [ Other ] - Added: Add format option. - Drop undocumented blocks sub. - Keep years and owners separate internally. - Strip "All rights reserved" boilerplate. 0.002001 2016-08-04 [ Bug Fixes ] - Fix chatter detection to handle double whitespace. 0.002000 2016-08-04 [ Test Suite ] - Extend testsuite with (some yet unsupported) corner cases. [ Packaging ] - Use Exporter::Tiny. [ Other ] - Added: Implement threshold options, with none by default (was hardcoded threshold_after=5). - Misc. improvements e.g. in detecting non-sign chatter, delimiting characters and whitespace. - Parse multiple lines at a time. 0.001005 2016-07-29 [ Test Suite ] - Adjust and extend testsuite. [ Other ] - Detect chatter before signs or owners. - Detect comma before years. - Fix stop exclude define's (misses statements embedded in e.g. "banner" define); instead tighten sign detection to require space around pseudo-sign (c). - Limit chatter detection to non-email-like strings generally (not only for info/information). - Relax years detection to tolerate initial commas. - Tighten owner detection to require non-punctuation as initial character. 0.001004 2016-07-27 [ Bug Fixes ] - Fix use re 'eval'. 0.001003 2016-07-26 [ Bug Fixes ] - Use Test::Script to ensure correct perl invokes script in tests. Slaven Rezic++ [ Test Suite ] - Add a few tests for year-like owner field. - Extend testsuite. [ Other ] - Fix extend block into next line(s) only when purely years detected (not on any - possibly owner - string ending in digits). - Fix stop include next line based on it starting with digits (only on previous line ending with digits). - Improve parsing of year-like strings: Treat as owner (instead of dropping) in more corner cases. - Refactor parsing to use pre-compiled regular expressions. - Tighten parser slightly regarding corner cases of years tied up in line-wrapping. - Tighten parsing to consider only space and tab (not other whitespace) where appropriate. 0.001002 2016-07-24 [ BACK COMPAT ] - Avoid superfluous regex modifiers /l /i /x. [ Bug Fixes ] - Fix typo in regex: Misdetected some discussions about copyright as copyright statement. [ Test Suite ] - Improve range tests: Separate multi-range test from new test of newline before year-delimiting comma. [ Other ] - Updated: Detect alternative representations for copyright sign and hyphen-minus. - Updated: Include copyright sign when stringifying.. 0.001001 2016-07-22 [ REGRESSIONS ] - Fix stop custom-decode encoded copyright sign. [ Documentation ] - Add notes to POD on possible encoding issues. 0.001 2016-07-22 Initial release. INSTALL000644001750001750 171614347334266 15716 0ustar00jonasjonas000000000000String-Copyright-0.003014 Installing String-Copyright should be straightforward. INSTALLATION WITH CPANMINUS If you have cpanm, you only need one line: % cpanm String::Copyright If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S String::Copyright INSTALLATION WITH THE CPAN SHELL Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan String::Copyright MANUAL INSTALLATION As a last resort, you can manually install it. Download the tarball and unpack it. Consult the file META.json for a list of pre-requisites. Install these first. To build String-Copyright: % perl Makefile.PL % make && make test Then install it: % make install If you are installing into a system-wide directory, you may need to run: % sudo make install LICENSE000644001750001750 10357514347334266 15740 0ustar00jonasjonas000000000000String-Copyright-0.003014This software is Copyright (c) 2022 by Jonas Smedegaard. This is free software, licensed under: The GNU Affero General Public License, Version 3, November 2007 GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . MANIFEST000644001750001750 37514347334266 15776 0ustar00jonasjonas000000000000String-Copyright-0.003014COPYRIGHT CREDITS Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README SIGNATURE TODO dist.ini doap.ttl lib/String/Copyright.pm t/20_parse.t t/30_RE2_missing.t t/50_context.t t/50_encoding.t t/50_identifier.t t/50_owner.t t/50_range.t META.json000644001750001750 410214347334266 16276 0ustar00jonasjonas000000000000String-Copyright-0.003014{ "abstract" : "representation of text-based copyright statements", "author" : [ "Jonas Smedegaard (JONASS) " ], "dynamic_config" : 0, "generated_by" : "Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010", "keywords" : [ "Licensing", "Sourcecode" ], "license" : [ "agpl_3" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "String-Copyright", "no_index" : { "directory" : [ "eg", "examples", "inc", "t", "xt" ] }, "optional_features" : {}, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.17" } }, "runtime" : { "recommends" : { "re::engine::RE2" : "0" }, "requires" : { "Exporter::Tiny" : "0", "Set::IntSpan" : "1.12", "constant" : "0", "perl" : "5.008001" } }, "test" : { "requires" : { "Test2::V0" : "0", "Test::Without::Module" : "0", "utf8" : "0" } } }, "provides" : { "String::Copyright" : { "file" : "lib/String/Copyright.pm", "version" : "0.003014" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=libstring-copyright-perl" }, "homepage" : "https://metacpan.org/pod/String::Copyright", "license" : [ "http://www.gnu.org/licenses/agpl-3.0.txt" ], "repository" : { "type" : "git", "web" : "https://anonscm.debian.org/cgit/build-common/string-copyright.git" }, "x_identifier" : "http://purl.org/NET/cpan-uri/dist/String-Copyright/project" }, "version" : "0.003014", "x_help_wanted" : [ "tester", "documenter" ], "x_serialization_backend" : "JSON::PP version 4.07", "x_static_install" : 1 } META.yml000644001750001750 250414347334266 16132 0ustar00jonasjonas000000000000String-Copyright-0.003014--- abstract: 'representation of text-based copyright statements' author: - 'Jonas Smedegaard (JONASS) ' build_requires: Test2::V0: '0' Test::Without::Module: '0' utf8: '0' configure_requires: ExtUtils::MakeMaker: '6.17' dynamic_config: 0 generated_by: 'Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010' keywords: - Licensing - Sourcecode license: open_source meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: String-Copyright no_index: directory: - eg - examples - inc - t - xt optional_features: {} provides: String::Copyright: file: lib/String/Copyright.pm version: '0.003014' recommends: re::engine::RE2: '0' requires: Exporter::Tiny: '0' Set::IntSpan: '1.12' constant: '0' perl: '5.008001' resources: Identifier: http://purl.org/NET/cpan-uri/dist/String-Copyright/project bugtracker: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=libstring-copyright-perl homepage: https://metacpan.org/pod/String::Copyright license: http://www.gnu.org/licenses/agpl-3.0.txt repository: https://anonscm.debian.org/cgit/build-common/string-copyright.git version: '0.003014' x_help_wanted: - tester - documenter x_serialization_backend: 'CPAN::Meta::YAML version 0.018' x_static_install: 1 Makefile.PL000644001750001750 1115114347334266 16651 0ustar00jonasjonas000000000000String-Copyright-0.003014use strict; use ExtUtils::MakeMaker 6.17; my $EUMM = eval( $ExtUtils::MakeMaker::VERSION ); my $meta = { "abstract" => "representation of text-based copyright statements", "author" => ["Jonas Smedegaard (JONASS) "], "dynamic_config" => 0, "generated_by" => "Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010", "keywords" => ["Licensing", "Sourcecode"], "license" => ["agpl_3"], "meta-spec" => { url => "http://search.cpan.org/perldoc?CPAN::Meta::Spec", version => 2, }, "name" => "String-Copyright", "no_index" => { directory => ["eg", "examples", "inc", "t", "xt"] }, "prereqs" => { configure => { requires => { "ExtUtils::MakeMaker" => 6.17 } }, runtime => { recommends => { "re::engine::RE2" => 0 }, requires => { "constant" => 0, "Exporter::Tiny" => 0, "perl" => 5.008001, "Set::IntSpan" => 1.12, }, }, test => { requires => { "Test2::V0" => 0, "Test::Without::Module" => 0, "utf8" => 0 }, }, }, "provides" => { "String::Copyright" => { file => "lib/String/Copyright.pm", version => 0.003014 }, }, "release_status" => "stable", "resources" => { bugtracker => { web => "https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=libstring-copyright-perl", }, homepage => "https://metacpan.org/pod/String::Copyright", license => ["http://www.gnu.org/licenses/agpl-3.0.txt"], repository => { type => "git", web => "https://anonscm.debian.org/cgit/build-common/string-copyright.git", }, x_identifier => "http://purl.org/NET/cpan-uri/dist/String-Copyright/project", }, "version" => 0.003014, "x_help_wanted" => ["tester", "documenter"], "x_static_install" => 1, }; my %dynamic_config; my %WriteMakefileArgs = ( ABSTRACT => $meta->{abstract}, AUTHOR => ($EUMM >= 6.5702 ? $meta->{author} : $meta->{author}[0]), DISTNAME => $meta->{name}, VERSION => $meta->{version}, EXE_FILES => [ map $_->{file}, values %{ $meta->{x_provides_scripts} || {} } ], NAME => do { my $n = $meta->{name}; $n =~ s/-/::/g; $n }, test => { TESTS => "t/*.t" }, %dynamic_config, ); $WriteMakefileArgs{LICENSE} = $meta->{license}[0] if $EUMM >= 6.3001; sub deps { my %r; for my $stage (@_) { for my $dep (keys %{$meta->{prereqs}{$stage}{requires}}) { next if $dep eq 'perl'; my $ver = $meta->{prereqs}{$stage}{requires}{$dep}; $r{$dep} = $ver if !exists($r{$dep}) || $ver >= $r{$dep}; } } \%r; } my ($build_requires, $configure_requires, $runtime_requires, $test_requires); if ($EUMM >= 6.6303) { $WriteMakefileArgs{BUILD_REQUIRES} ||= deps('build'); $WriteMakefileArgs{CONFIGURE_REQUIRES} ||= deps('configure'); $WriteMakefileArgs{TEST_REQUIRES} ||= deps('test'); $WriteMakefileArgs{PREREQ_PM} ||= deps('runtime'); } elsif ($EUMM >= 6.5503) { $WriteMakefileArgs{BUILD_REQUIRES} ||= deps('build', 'test'); $WriteMakefileArgs{CONFIGURE_REQUIRES} ||= deps('configure'); $WriteMakefileArgs{PREREQ_PM} ||= deps('runtime'); } elsif ($EUMM >= 6.52) { $WriteMakefileArgs{CONFIGURE_REQUIRES} ||= deps('configure'); $WriteMakefileArgs{PREREQ_PM} ||= deps('runtime', 'build', 'test'); } else { $WriteMakefileArgs{PREREQ_PM} ||= deps('configure', 'build', 'test', 'runtime'); } { my ($minperl) = reverse sort( grep defined && /^[0-9]+(\.[0-9]+)?$/, map $meta->{prereqs}{$_}{requires}{perl}, qw( configure build runtime ) ); if (defined($minperl)) { die "Installing $meta->{name} requires Perl >= $minperl" unless $] >= $minperl; $WriteMakefileArgs{MIN_PERL_VERSION} ||= $minperl if $EUMM >= 6.48; } } my $mm = WriteMakefile(%WriteMakefileArgs); exit(0); README000644001750001750 630614347334266 15545 0ustar00jonasjonas000000000000String-Copyright-0.003014NAME String::Copyright - Representation of text-based copyright statements VERSION Version 0.003014 SYNOPSIS use String::Copyright; my $copyright = copyright(<<'END'); copr. © 1999,2000 Foo Barbaz and Acme Corp. Copyright (c) 2001,2004 Foo (work address) Copyright 2003, Foo B. and friends © 2000, 2002 Foo Barbaz END print $copyright; # Copyright 1999-2000 Foo Barbaz and Acme Corp. # Copyright 2000, 2002 Foo Barbaz and Acme Corp. # Copyright 2001, 2004 Foo (work address) # Copyright 2003 Foo B. and friends DESCRIPTION String::Copyright identifies copyright statements in a string and serializes them in a normalized format. OPTIONS Options can be set as an argument to the 'use' statement. threshold, threshold_before, threshold_after use String::Copyright { threshold_after => 5 }; Stop parsing after this many lines without copyright information, before or after having found any copyright information at all. `threshold` sets both `threshold_before` and `threshold_after`. By default unset: All lines are parsed. format( \&sub ) use String::Copyright { format => \&GNU_style } }; sub GNU_style { my ( $years, $owners ) = @_; return 'Copyright (C) ' . join ' ', $years || '', $owners || ''; } FUNCTIONS Exports one function: `copyright`. This module uses Exporter::Tiny to export functions, which allows for flexible import options; see the Exporter::Tiny documentation for details. SEE ALSO * Encode * Exporter::Tiny BUGS/CAVEATS/etc String::Copyright operates on strings, not bytes. Data encoded as UTF-8, Latin1 or other formats need to be decoded to strings before use. Only ASCII characters and © (copyright sign) are directly processed. If copyright sign is not detected or accents or multi-byte characters display wrong, then most likely the data was not decoded into a string. If ranges or lists of years are not tidied, then maybe it contained non-ASCII whitespace or digits. AUTHOR Jonas Smedegaard `` COPYRIGHT AND LICENSE This program is based on the script "licensecheck" from the KDE SDK, originally introduced by Stefan Westerfeld ``. Copyright © 2007, 2008 Adam D. Barratt Copyright © 2005-2012, 2016, 2018, 2020-2021 Jonas Smedegaard Copyright © 2018, 2020-2021 Purism SPC This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3, 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . SIGNATURE000644001750001750 606714347334266 16155 0ustar00jonasjonas000000000000String-Copyright-0.003014This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.88. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 SHA256 e139be88a4c16cd74698f3e6f5b38d5ce74774c2f44cbe5f4e86f7928647d686 COPYRIGHT SHA256 8e84561ba1880012c329bf234de6956126f0f4c799705d6beefdd61705b402de CREDITS SHA256 b82a08a938bc5be06060dc8655ada11dc53dbc6f567189ed1e114558430c9155 Changes SHA256 3e823a99b91718b1f29605c6e8bbc43d49ccc5de02079132373864e2f9797197 INSTALL SHA256 84dacfae1a903552ef31452e7e3e0c8b5d4d4bbe6c524bf07ac78187e33c34a6 LICENSE SHA256 f611595b373144f1e1e6665428f7bc7ac1ca4f241653bb0b919ee91df3713608 MANIFEST SHA256 2ed034be644efdb49b3387ca7c9816696b4013d083da5f0384ff385cbfb8ef8e META.json SHA256 e4de05bc35674b3f1d857abf09be70378a72e8f190034896fd997d9878bdea54 META.yml SHA256 10ad11306f85b00c42a112bcaedc3ca3e73ec220da584eee0de18c7445a7bf7c Makefile.PL SHA256 e0115f537a8bf02d7b01c50a95e2e25f40ad9dcae55f3b9400dc876a456dde36 README SHA256 85c71c4de16878293cc0781f8bcbbaf0b2cbca8997652eb8265d1d4df836996a TODO SHA256 472723074e3276e188469a344783f8bda7ca9645ba82c8ebcb909abb83e4739b dist.ini SHA256 ef93fc4f2f171dd6fad55d824289315a9b3cf14b9c151908b3fcf7dc83865a3f doap.ttl SHA256 6b881703592bd5d7670e7c3691f862870a20b4d15a98b187270c37c1b5850a3d lib/String/Copyright.pm SHA256 4afdea43ddbae2365c793c237d4ec4c389f3760f8b134a46041f4b7271b0a929 t/20_parse.t SHA256 236deb6a8ff3d15e16a588747d4d1fe3b116e3d029ceb90c771cebd1c79083f8 t/30_RE2_missing.t SHA256 d0eb8e2a4ee733688babcd3a4b47b0b3e0756b5dcf0f74d2442e3186c40602b0 t/50_context.t SHA256 ad87f0ce3754f17a4207a04d5ebcdac1edd8b62bcbd385eba25225b0fd9beab9 t/50_encoding.t SHA256 95eee579328293bb1bdf970bb22cb156e6b87a0fabd5f9525ed29086ba559a15 t/50_identifier.t SHA256 f0f2633336cd8063fa649fb2e644ff75293c7fda307386794e0b1a900c231e96 t/50_owner.t SHA256 38799956d8115e42bdccc445383c14361198303e243aef5ac154952d292505d3 t/50_range.t -----BEGIN PGP SIGNATURE----- iQIzBAEBAwAdFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAmOduLIACgkQLHwxRsGg ASFx8A//d6SAT4TOh1JpA866bE9kb19pdMo93Jn9qxUR2SS98Vt4Kxw0vy6nOXXL Fm/7cJVxaetB07Q/ahwNaYB6kQYVDl1eYy82xr6DgkyjwjGe57OSOZgkzZq5ltYx 6WLmj3UWYoiKE1nfeftzgiawDfwexMAmL45eVgVH1Psn8a8J0DEOhfMZsGm0/p92 LwIASLSg5O69/tLQ31NbQTwwUtgzOw9Jn3yFqtozcFC3k1CvP5hiknUg4OCqyBAM JyehxdpZnQ0lJGm0t4Va2L/7C8wPywPuJL5LSoHT81g+QTCBm1wRzQ2bR8jgqJLj PywoBcQ+z5C7cb0ejswS9Nn6EmG4XSefLI3vjpcvg1E2PypIzWyH6PqpFNME3j4w M5Li4wQYbJmxImN4P50XLVAnmTbnxwa53ndHiU1yl9wFEeTWxQFcxnB8mWlsbLCJ qTB71sl+YEPSd6pUfeQuV7vZxd4/34NOaTXIBf9A0QebSKCS/ffqefAj66Lr//MT jQmvCgjAcGuBTBXupT246u3Q+24qKrxR7WCdkRVdqooA0cYkg4OptAk5T/T9y1Z0 PtpEIuiL3fZNfgcQeDjNVyBXrW27fJKR/Yh24bAqYwk+6YlVYKaTf0imrVRQ7gNo l2nFa3bOFxUfMHSqt1ZYQXYy1PnRbS6wZhgeW94HWRrz4wWUfEE= =L7mE -----END PGP SIGNATURE----- TODO000644001750001750 202514347334266 15347 0ustar00jonasjonas000000000000String-Copyright-0.003014 * Implement mangle option: + Regex for mangling source content. + Repeated use of the option is merged together. * Implement id resolving: + For defined authors, us email address, URL, or full string as key. + Use fc when Unicode::CaseFold is available, else lc. * Implement merge-author option: + no: Disable id resolving altogether + yes (default): same as titlecase. + force: same as lowercase. + fail: die on author id referencing varying full strings. + titlecase: Merge id's varying only in case, Favoring titlecase over other mixed-case, lowercase, or uppercase (in that order). + lowercase: Merge id's always, lowercasing varying content. * Use Log::Any: + Emit warning when author id's refer to varying full strings. * Implement alias option: + Hash of arrays of id's to be merged with id used as key. * Fix "Complex regular subexpression recursion limit (32766) exceeded at /usr/share/perl5/String/Copyright.pm line 162." seen with twitter-bootstrap3 3.4.1+dfsg-1. dist.ini000644001750001750 32414347334266 16303 0ustar00jonasjonas000000000000String-Copyright-0.003014; Configuration file for String::Copyright ; ; whitespace test clashes with perltidy ; ;; class = 'Dist::Inkt::Profile::TOBYINK' ;; name = 'String-Copyright' ;; skip_whitespace_test = 1 ;; skip_kwalitee_test = 1 doap.ttl000644001750001750 7236014347334266 16360 0ustar00jonasjonas000000000000String-Copyright-0.003014@prefix cpan-uri: . @prefix dc: . @prefix doap: . @prefix doap-bugs: . @prefix doap-changeset: . @prefix doap-deps: . @prefix foaf: . @prefix rdfs: . @prefix xsd: . a doap:Project; cpan-uri:x_help_wanted , ; dc:contributor ; doap-deps:runtime-recommendation [ doap-deps:on "re::engine::RE2"^^doap-deps:CpanId ]; doap-deps:runtime-requirement [ doap-deps:on "constant 0"^^doap-deps:CpanId ], [ doap-deps:on "Exporter::Tiny 0"^^doap-deps:CpanId ], [ doap-deps:on "perl 5.008001"^^doap-deps:CpanId ], [ doap-deps:on "Set::IntSpan 1.12"^^doap-deps:CpanId ]; doap-deps:test-requirement [ doap-deps:on "Test::Without::Module"^^doap-deps:CpanId; ], [ doap-deps:on "Test2::V0"^^doap-deps:CpanId ], [ doap-deps:on "utf8 0"^^doap-deps:CpanId ]; doap:bug-database , ; doap:category [ rdfs:label "Sourcecode" ], [ rdfs:label "Licensing" ]; doap:created "2016-07-21"^^xsd:date; doap:developer ; doap:download-page ; doap:homepage , ; doap:license ; doap:maintainer ; doap:name "String-Copyright"; doap:programming-language "Perl"; doap:release , , , , , , , , , , , , , , , , , , , , , , ; doap:repository [ a doap:GitRepository; doap:browse ; ]; doap:shortdesc "representation of text-based copyright statements". a doap:Version; dc:identifier "String-Copyright-0.001001"^^xsd:string; dc:issued "2016-07-22"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Regression; rdfs:label "Fix stop custom-decode encoded copyright sign."; ], [ a doap-changeset:Documentation; rdfs:label "Add notes to POD on possible encoding issues."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.001001"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.001002"^^xsd:string; dc:issued "2016-07-24"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Update; rdfs:label "Include copyright sign when stringifying.."; ], [ a doap-changeset:Update; rdfs:label "Detect alternative representations for copyright sign and hyphen-minus."; ], [ a doap-changeset:BackCompat; rdfs:label "Avoid superfluous regex modifiers /l /i /x."; ], [ a doap-changeset:Bugfix; rdfs:label "Fix typo in regex: Misdetected some discussions about copyright as copyright statement."; ], [ a doap-changeset:Tests; rdfs:label "Improve range tests: Separate multi-range test from new test of newline before year-delimiting comma."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.001002"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.001003"^^xsd:string; dc:issued "2016-07-26"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "Fix extend block into next line(s) only when purely years detected (not on any - possibly owner - string ending in digits)."; ], [ a doap-changeset:Change; rdfs:label "Tighten parser slightly regarding corner cases of years tied up in line-wrapping."; ], [ a doap-changeset:Change; rdfs:label "Improve parsing of year-like strings: Treat as owner (instead of dropping) in more corner cases."; ], [ a doap-changeset:Change; rdfs:label "Tighten parsing to consider only space and tab (not other whitespace) where appropriate."; ], [ a doap-changeset:Tests; rdfs:label "Add a few tests for year-like owner field."; ], [ a doap-changeset:Change; rdfs:label "Refactor parsing to use pre-compiled regular expressions."; ], [ a doap-changeset:Tests; rdfs:label "Extend testsuite."; ], [ a doap-changeset:Change; rdfs:label "Fix stop include next line based on it starting with digits (only on previous line ending with digits)."; ], [ a doap-changeset:Bugfix; rdfs:label "Fix silence closure warnings for regex variable.", "Use Test::Script to ensure correct perl invokes script in tests."; doap-bugs:fixes ; doap-changeset:thanks ; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.001003"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.001004"^^xsd:string; dc:issued "2016-07-27"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Fix use re 'eval'."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.001004"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.001005"^^xsd:string; dc:issued "2016-07-29"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "Tighten owner detection to require non-punctuation as initial character."; ], [ a doap-changeset:Change; rdfs:label "Fix stop exclude define's (misses statements embedded in e.g. \"banner\" define); instead tighten sign detection to require space around pseudo-sign (c)."; ], [ a doap-changeset:Change; rdfs:label "Relax years detection to tolerate initial commas."; ], [ a doap-changeset:Change; rdfs:label "Limit chatter detection to non-email-like strings generally (not only for info/information)."; ], [ a doap-changeset:Change; rdfs:label "Detect chatter before signs or owners."; ], [ a doap-changeset:Change; rdfs:label "Detect comma before years."; ], [ a doap-changeset:Tests; rdfs:label "Adjust and extend testsuite."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.001005"^^xsd:string. a doap:Version; rdfs:label "Initial release."; dc:identifier "String-Copyright-0.001"^^xsd:string; dc:issued "2016-07-22"^^xsd:date; doap-changeset:released-by ; doap:file-release ; doap:revision "0.001"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.002000"^^xsd:string; dc:issued "2016-08-04"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "Misc. improvements e.g. in detecting non-sign chatter, delimiting characters and whitespace."; ], [ a doap-changeset:Packaging; rdfs:label "Use Exporter::Tiny."; ], [ a doap-changeset:Addition; rdfs:label "Implement threshold options, with none by default (was hardcoded threshold_after=5)."; ], [ a doap-changeset:Change; rdfs:label "Parse multiple lines at a time."; ], [ a doap-changeset:Tests; rdfs:label "Extend testsuite with (some yet unsupported) corner cases."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.002000"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.002001"^^xsd:string; dc:issued "2016-08-04"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Fix chatter detection to handle double whitespace."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.002001"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003000"^^xsd:string; dc:issued "2016-08-13"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "Strip \"All rights reserved\" boilerplate."; ], [ a doap-changeset:Documentation; rdfs:label "Fix list example option inside threshold header in POD."; ], [ a doap-changeset:Change; rdfs:label "Drop undocumented blocks sub."; ], [ a doap-changeset:Change; rdfs:label "Keep years and owners separate internally."; ], [ a doap-changeset:Addition; rdfs:label "Add format option."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003000"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003001"^^xsd:string; dc:issued "2016-08-21"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Fix relax detection of owner to permit prefix (for styled names like \"(URW)++\")."; ], [ a doap-changeset:Change; rdfs:label "Improve cleanup of \"all rights reserved\" boilerplate to not necessarily be last."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003001"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003002"^^xsd:string; dc:issued "2016-09-07"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Fix avoid misdetecting bogus multi-range year spans."; ], [ a doap-changeset:Change; rdfs:label "Shorten regexes $blank_or_break_re $comma_re and make more greedy."; ], [ a doap-changeset:Change; rdfs:label "Capture each year span."; ], [ a doap-changeset:Change; rdfs:label "Use Number::Range to normalize years."; ], [ a doap-changeset:Bugfix; rdfs:label "Fix strip owner intro (e.g. \"by \")."; ], [ a doap-changeset:Bugfix; rdfs:label "Fix suppress eq as chatter."; doap-changeset:thanks ; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003002"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003003"^^xsd:string; dc:issued "2016-09-07"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Fix reset detected chatter at newline (regression since 0.002000)."; doap-bugs:fixes ; doap-changeset:thanks ; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003003"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003004"^^xsd:string; dc:issued "2016-09-23"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "Suppress \"assigned\" and \"generated\" as chatter."; ], [ a doap-changeset:Bugfix; rdfs:label "Fix avoid regex modifier r (available only since Perl 5.14)."; ], [ a doap-changeset:Documentation; rdfs:label "Fix remove POD mentions or subs for unimplemented features."; ], [ a doap-changeset:Documentation; rdfs:label "Add TODO file."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003004"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003005"^^xsd:string; dc:issued "2016-11-30"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Fix skip chatter after boilerplate."; ], [ a doap-changeset:Tests; rdfs:label "Add tests for broken copyright sign and boilerplate chatter."; ], [ a doap-changeset:Bugfix; rdfs:label "Fix skip some pseudosign chatter, and skip single question mark after copyright signs (possibly fallout from broken converted copyright sign)."; doap-bugs:fixes ; doap-changeset:thanks ; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003005"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003006"^^xsd:string; dc:issued "2018-09-27"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "Tidy spaces."; ], [ a doap-changeset:Bugfix; rdfs:label "Fix declare dependency on Number::Range at runtime (not only for tests)."; doap-changeset:thanks ; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003006"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003007"^^xsd:string; dc:issued "2021-08-16"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Tests; rdfs:label "tighten TODO test succeeding since v0.003005"; ], [ a doap-changeset:Documentation; rdfs:label "fix typo in example code"; ], [ a doap-changeset:Change; rdfs:label "stop precompile intermediate regexp variables"; ], [ a doap-changeset:Change; rdfs:label "skip dollar or percentage sign as initial owner character"; ], [ a doap-changeset:Tests; rdfs:label "test skipped initial owner characters"; ], [ a doap-changeset:Change; rdfs:label "detect {c} (i.e. braces-wrapped c, supplementing parens-wrapped c) as identifier"; ], [ a doap-changeset:Tests; rdfs:label "test identifiers"; ], [ a doap-changeset:Change; rdfs:label "slightly simplify regexp variable signs_and_more_re"; ], [ a doap-changeset:Bugfix; rdfs:label "silence warning at duplicate year or single-year range"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003007"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003008"^^xsd:string; dc:issued "2021-08-18"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "require word boundary after literal copyright as identifier"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier 'no copyright'"; ], [ a doap-changeset:Change; rdfs:label "rewrite tests to use Test2::V1"; ], [ a doap-changeset:Packaging; rdfs:label "require Test2::V1 (not Test::More)"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier '_copyright'"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier 'copyright transfer'"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier 'copyright tag'"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier 'copyright block'"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier 'copyright at'"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier 'copyright applies'"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier 'copyright or'"; ], [ a doap-changeset:Change; rdfs:label "detect identifier 'copyright: (C)'"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier 'copyright-' (other than 'copyright-holder')"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003008"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003009"^^xsd:string; dc:issued "2021-08-28"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "skip non-owner starting with (non-delimiting) comma"; ], [ a doap-changeset:Change; rdfs:label "skip non-owner starting with are/disclaimer/if/interest/permission/treaty"; ], [ a doap-changeset:Change; rdfs:label "skip non-owner the library/software, then comma"; ], [ a doap-changeset:Change; rdfs:label "skip dummy year"; ], [ a doap-changeset:Change; rdfs:label "skip nonidentifier 'we copyright'"; ], [ a doap-changeset:Change; rdfs:label "skip nonidentifier 'Copyright Act'"; ], [ a doap-changeset:Change; rdfs:label "skip bogus pseudo-sign chatter '(c) You must'"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003009"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003010"^^xsd:string; dc:issued "2021-08-28"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "relax to cover double colon or colon preceded by space"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifier ' for copyright'"; ], [ a doap-changeset:Change; rdfs:label "skip non-identifiers 'copyright sign ' 'copyright symbol ' 'copyright text '"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003010"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003011"^^xsd:string; dc:issued "2021-09-04"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "skip non-range '19xx'"; ], [ a doap-changeset:Change; rdfs:label "skip non-indentifier followed by ' of '"; ], [ a doap-changeset:Change; rdfs:label "skip non-indentifier followed by ' This '"; ], [ a doap-changeset:Change; rdfs:label "detect real copyright preceded by bogus (have bogus match be non-greedy)"; ], [ a doap-changeset:Change; rdfs:label "use re::engine::RE2 when available"; ], [ a doap-changeset:Packaging; rdfs:label "runtime-recommend re::engine::RE2"; ], [ a doap-changeset:Packaging; rdfs:label "test-require Test::Without::Module"; ], [ a doap-changeset:Change; rdfs:label "skip pseudo-sign followed by ' all begin '"; ], [ a doap-changeset:Change; rdfs:label "detect pseudo-sign after years"; ], [ a doap-changeset:Change; rdfs:label "detect '\\(co' ( in roff markup) as identifier"; ], [ a doap-changeset:Change; rdfs:label "skip pseudo-sign chatter of single character in (at least ending) parens"; ], [ a doap-changeset:Change; rdfs:label "skip identifier followed by ' for '"; ], [ a doap-changeset:Change; rdfs:label "skip identifier followed by ' dates '"; ], [ a doap-changeset:Change; rdfs:label "detect vague sign '-C-' as identifier, except standalone"; ], [ a doap-changeset:Change; rdfs:label "treat leading dash with space around as delimiter (not part of owner)"; ], [ a doap-changeset:Change; rdfs:label "tighten to detect only vague year as owner (not other strings beginning with dash)"; ], [ a doap-changeset:Change; rdfs:label "relicense project as AGPL-3-or-newer"; ], [ a doap-changeset:Documentation; rdfs:label "add Purism SPC as copyright holder"; ], [ a doap-changeset:Tests; rdfs:label "teach author test pod-spell about the word 'Affero'"; ], [ a doap-changeset:Packaging; rdfs:label "skip kwalitee test: fails to recognize AGPL licensing"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003011"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003012"^^xsd:string; dc:issued "2021-12-16"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "skip identifier followed by ' License'"; ], [ a doap-changeset:Change; rdfs:label "skip identifier followed by ', patent'"; ], [ a doap-changeset:Bugfix; rdfs:label "fix skip non-copyright chatter of single word at end of line"; ], [ a doap-changeset:Change; rdfs:label "skip bogus copyright holder starting with YEAR"; ], [ a doap-changeset:Change; rdfs:label "skip bogus identifier preceded by dash"; ], [ a doap-changeset:Change; rdfs:label "slight optimization: re-computing substring-after-regex-match already available"; ], [ a doap-changeset:Change; rdfs:label "generalize patterns colon_or_dash delimiter"; ], [ a doap-changeset:Bugfix; rdfs:label "fix detect owner after (space-delimited) dash"; ], [ a doap-changeset:Change; rdfs:label "cover copyright sign misparsed from latin1 or MacRoman, and skip other misparsed characters (most commonly but also cyrillic, vietnamese and CJK characters)"; ], [ a doap-changeset:Change; rdfs:label "use Set::IntSpan (not Number::Range)"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003012"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003013"^^xsd:string; dc:issued "2022-01-16"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Change; rdfs:label "skip bogus copyright holder starting with more year template patterns, including [yyyy]"; ], [ a doap-changeset:Documentation; rdfs:label "slightly improve POD section DESCRIPTION"; ], [ a doap-changeset:Packaging; rdfs:label "work around tidyall string-encoding bug"; ], [ a doap-changeset:Tests; rdfs:label "simplify context tests to not require utf8 IO"; ], [ a doap-changeset:Tests; rdfs:label "silence author test pod-spell"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003013"^^xsd:string. a doap:Version; dc:identifier "String-Copyright-0.003014"^^xsd:string; dc:issued "2022-12-17"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Documentation; rdfs:label "fix a few typos in POD"; ], [ a doap-changeset:Tests; rdfs:label "fix wordlist in author test pod-spell"; ], [ a doap-changeset:Tests; rdfs:label "check spelling of PODs with tidyall"; ], [ a doap-changeset:Change; rdfs:label "detect SPDX-FileCopyrightText: as stricl label"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003014"^^xsd:string. a foaf:Person; foaf:mbox , ; foaf:name "Jonas Smedegaard"; foaf:nick "JONASS"; foaf:page . a foaf:Person; foaf:mbox ; foaf:name "Perl Ancar"; foaf:nick "PERLANCAR"; foaf:page . a foaf:Person; foaf:mbox ; foaf:name "Slaven Rezic"; foaf:nick "SREZIC"; foaf:page . a doap-bugs:Issue; doap-bugs:id "116460"^^xsd:string; doap-bugs:page . foaf:mbox ; foaf:name "Dominique Dumont". foaf:mbox ; foaf:name "Petter Reinholdtsen". dc:title "GNU Affero General Public License version 3 or newer.". 20_parse.t000644001750001750 263514347334266 16731 0ustar00jonasjonas000000000000String-Copyright-0.003014/tuse Test2::V0; plan 9; use String::Copyright; use String::Copyright { threshold_before => 0 }, 'copyright' => { -as => 'before0' }; use String::Copyright { threshold_before => 1 }, 'copyright' => { -as => 'before1' }; use String::Copyright { threshold_before => 2 }, 'copyright' => { -as => 'before2' }; use String::Copyright { threshold_after => 0 }, 'copyright' => { -as => 'after0' }; use String::Copyright { threshold_after => 1 }, 'copyright' => { -as => 'after1' }; use String::Copyright { threshold_after => 2 }, 'copyright' => { -as => 'after2' }; #is( ( 0 + copyright( "foo" ) ), 0, 'non-copyright string numeric is zero' ); my $string = "© Foo\n© Bar\n\n© Baz\n\n\n© Boom"; is copyright($string), "© Foo\n© Bar\n© Baz\n© Boom", 'no skip'; is before0("\n\n\n\n$string"), "© Foo\n© Bar\n© Baz\n© Boom", 'zero skip before match'; is before1($string), "© Foo\n© Bar\n© Baz\n© Boom", 'skip before match and 1 miss'; is before1("\n$string"), "", 'skip before match and 1 miss, skipped'; is before2("\n$string"), "© Foo\n© Bar\n© Baz\n© Boom", 'skip before match and 2 misses'; is before2("\n\n$string"), "", 'skip before match and 2 misses, skipped'; is after0($string), "© Foo\n© Bar\n© Baz\n© Boom", 'zero skip after match'; is after1($string), "© Foo\n© Bar", 'skip after match and 1 miss'; is after2($string), "© Foo\n© Bar\n© Baz", 'skip after match and 2 misses'; done_testing; 30_RE2_missing.t000644001750001750 42214347334266 17711 0ustar00jonasjonas000000000000String-Copyright-0.003014/tuse Test2::V0; use Test::Without::Module qw( re::engine::RE2 ); plan 1; use String::Copyright { format => sub { join ':', $_->[0] || '', $_->[1] || '' } }; is copyright('This software is copyright (c) 2016 by Foo'), '2016:Foo', 'sign pseudosign intro'; done_testing; 50_context.t000644001750001750 525114347334266 17303 0ustar00jonasjonas000000000000String-Copyright-0.003014/tuse Test2::V0; plan 23; use String::Copyright { format => sub { join ':', $_->[0] || '', $_->[1] || '' } }; is copyright('This software is copyright (c) 2016 by Foo'), '2016:Foo', 'sign pseudosign intro'; is copyright('This software is (c) copyright 2016 by Foo'), '2016:Foo', 'pseudosign sign intro'; is copyright("Copyright:\n2000 Foo"), '2000:Foo', 'sign then newline'; is copyright("Copyright:\n!not Foo"), '', 'sign then newline then non-owner'; is copyright("#define foo(c) 1999 Foo"), '', 'bogus sign'; is copyright("(c) 1999 Foo\n#define foo(c) 1999 Bar"), '1999:Foo', 'sign, then bogus sign'; is copyright("#define foo(c) 1999 Foo\n(c) 1999 Bar"), '1999:Bar', 'bogus sign, then sign'; is copyright("(c) 1999 Foo #define foo(c) 1999 Bar"), '1999:Foo #define foo(c) 1999 Bar', 'sign, then bogus sign on same line'; is copyright("#define foo(c) 1997 Foo (c) 1999 Bar"), '1999:Bar', 'bogus sign, then sign on same line'; is copyright("(c) 1999 Foo (c) 2000 Foo (c) 2002 Foo"), '1999:Foo (c) 2000 Foo (c) 2002 Foo', 'sign x 3 on same line'; my $todo = todo 'not yet handled'; is copyright("(c) 2000 Foo\n 2005 Bar\n2008 Baz"), ":2000:Foo\n2005:Bar\n2008:Baz", 'multi-line multi-statement'; is copyright("Copyright:\n2000 Foo\n2000 Bar"), "2000:Foo\n2000:Bar", 'multi-line multi-statement after single sign'; is copyright("Copyright:\nFoo\nBar\n\nBaz"), ":Foo\n:Bar", 'multi-line owner-only multi-statement after single sign'; is copyright("Copyright:\n2000\n2001\nFoo\n\n2002"), "2000-2000:\n:Foo", 'multi-line year-only multi-statement after single sign'; $todo = undef; is copyright( "Copyright (C) 2004 - 2005\n\nSee http://foo.bar for more information"), '2004-2005:', 'years-only, with unrelated text after double-newline'; is copyright("* Note, the copyright information is at end of file."), '', 'non-sign and space'; is copyright("* For copyright information, see copyright.h."), '', 'non-sign and punctuation'; is copyright('covered under the following copyright and permission notice:'), '', 'chatter involving "and"'; is copyright(" if (ref \$copyright eq 'ARRAY') {"), '', 'chatter involving "eq"'; is copyright('the above copyright notice, this list'), '', 'chatter with double whitespace'; is copyright( "=head1 COPYRIGHT AND LICENSE\n\nThis software is (c) copyright 2016 by Foo" ), '2016:Foo', 'chatter then copyright'; is copyright("Copyright ?1991-2012 Unicode, Inc."), '1991-2012:Unicode, Inc.', 'broken copyright sign'; is copyright( "Copyright 1991-2012 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html." ), '1991-2012:Unicode, Inc.', 'boilerplate then chatter'; done_testing; 50_encoding.t000644001750001750 65214347334266 17365 0ustar00jonasjonas000000000000String-Copyright-0.003014/tuse Test2::V0; skip_all "FIXME: not yet written"; use String::Copyright; done_testing; __END__ FIXME: * raw strings should succeed on both latin1 and utf8 © * utf8 strings should fail on latin1 © and succeed on utf8 © * utf8 strings should succeed on double-byte names * utf8 strings should correctly normalize double-byte merged lines * utf8 strings should cleanup double-byte whitespace and exotic markers 50_identifier.t000644001750001750 1504114347334266 17757 0ustar00jonasjonas000000000000String-Copyright-0.003014/tuse Test2::V0; plan 71; use String::Copyright { format => sub { join ':', $_->[0] || '', $_->[1] || '' } }; is copyright("SPDX-FileCopyrightText: Foo"), ':Foo', 'SPDX identifier'; is copyright("© Foo"), ':Foo', 'copyright sign as identifier'; is copyright("©Foo"), ':Foo', 'copyright sign and no space as identifier'; is copyright("Ⓒ Foo"), ':Foo', 'capital C-in-circle symbol as identifier'; is copyright("ⓒ Foo"), ':Foo', 'c-in-circle symbol as identifier'; is copyright("⒞ Foo"), ':Foo', 'c-in-parens symbol as identifier'; is copyright("🄒 Foo"), ':Foo', 'capital c-in-parens symbol as identifier'; is copyright("🄫 Foo"), ':Foo', 'cursive c-in-circle symbol as identifier'; is copyright("🅒 Foo"), ':Foo', 'inverse c-in-circle symbol as identifier'; is copyright("(c) Foo"), ':Foo', '(c) as identifier'; is copyright("(C) Foo"), ':Foo', '(C) as identifier'; is copyright("{c} Foo"), ':Foo', '{c} as identifier'; is copyright("{C} Foo"), ':Foo', '{C} as identifier'; is copyright("© Foo"), ':Foo', 'lati1-misparsed-as-utf8 copyright sign as identifier'; is copyright("René Foo"), '', 'bogus latin1-as-utf8 accent acute'; is copyright("¬© Foo"), ':Foo', 'MacRoman-misparsed-as-utf8 copyright sign as identifier'; is copyright("Copyright: Foo"), ':Foo', '"Copyright:" as identifier'; is copyright('Copyright : Foo'), ':Foo', '"Copyright :" as identifier'; is copyright("Copyright-holder: Foo"), ':Foo', '"Copyright-holder:" as identifier'; is copyright("Copyright-holders: Foo"), ':Foo', '"Copyright-holders:" as identifier'; is copyright("Copr. Foo"), ':Foo', '"Copr." as identifier'; is copyright('Copyright -C- Foo'), ':Foo', '"Copyright -C- " as identifier'; is copyright('Copyright - Foo'), ':Foo', '"Copyright - " as identifier'; is copyright('Copyright -- Foo'), ':Foo', '"Copyright -- " as identifier'; is copyright('\(co Foo'), ':Foo', '"\(co" (© in roff markup) as identifier'; is copyright('Copyright: (C) 2001 Foo'), '2001:Foo', '"Copyright: (C)" as identifier'; is copyright('Copyright(C) 2001 Foo'), '2001:Foo', '"Copyright(C)" as identifier'; is copyright('Copyright:: Copyright (c) Foo'), ':Foo', '"Copyright:: Copyright (c)" as identifier'; is copyright('Copyright 1999 (c) Foo'), '1999:Foo', '"pseudo-sign after years'; is copyright('COPYRIGHT HOLDER'), '', 'bogus copyright holder "HOLDER" as last word of line'; is copyright("-C- Foo"), '', 'bogus lone non-pseudosign -C-'; is copyright('(c) You must '), '', 'bogus pseudo-sign chatter "(c) You must"'; is copyright('((b), (c), 0)'), '', 'bogus pseudo-sign chatter "(c), 0)"'; is copyright('memset ((d), (c), (l))'), '', 'bogus pseudo-sign chatter "(c), cl)"'; is copyright('others have copyright or other rights in the material'), '', 'bogus identifier followed by " or"'; is copyright('Copyright Oracle'), ':Oracle', 'make sure excluding " or" still includes e.g. " Oracle"'; is copyright('The following copyright applies to code from'), '', 'bogus identifier followed by " applies"'; is copyright('See original copyright at the end of this file'), '', 'bogus identifier followed by " at"'; is copyright( 'THIS SOFTWARE IS PROVIDED BY <> "AS IS" AND ' ), '', 'bogus identifier followed by latin character'; is copyright('if the compilation and its resulting copyright are '), '', 'bogus identifier followed by " are"'; is copyright('according to the copyright dates in '), '', 'bogus identifier followed by " dates"'; is copyright('to sign a "copyright disclaimer" for the program '), '', 'bogus identifier followed by " disclaimer"'; is copyright('See COPYRIGHT for more information'), '', 'bogus identifier followed by " for "'; is copyright('infringe copyright if you do '), '', 'bogus identifier followed by " if"'; is copyright('disclaims all copyright interest in '), '', 'bogus identifier followed by " interest"'; is copyright('Grant of Copyright License.'), '', 'bogus identifier followed by " License"'; is copyright('fall under the copyright of this Package'), '', 'bogus identifier followed by " of "'; is copyright('all copyright, patent, trademark'), '', 'bogus identifier followed by " patent"'; is copyright('requiring copyright permission '), '', 'bogus identifier followed by " permission"'; is copyright('contain a copyright sign '), '', 'bogus identifier followed by " sign"'; is copyright('contain a copyright symbol '), '', 'bogus identifier followed by " symbol"'; is copyright('contain a copyright text '), '', 'bogus identifier followed by " text"'; is copyright('the WIPO copyright treaty '), '', 'bogus identifier followed by " treaty"'; is copyright('Copyright transferred 2000/09/15 to Artifex'), '', 'bogus identifier followed by " transferred"'; is copyright('copyright tag white point and grayTRC'), '', 'bogus identifier followed by " tag"'; is copyright('change the copyright block at the bottom'), '', 'bogus identifier followed by " block"'; is copyright('These have no copyright, and are of unknown quality.'), '', 'bogus identifier preceded by "no "'; is copyright('we copyright the '), '', 'bogus identifier preceded by "we "'; is copyright('Check for copyright lines'), '', 'bogus identifier preceded by "for "'; is copyright('#define FONT_INFO_COPYRIGHT 0x0040'), '', 'bogus identifier preceded by underscore'; is copyright('missing-license-text-in-dep5-copyright GPL-2\+ *'), '', 'bogus identifier preceded by dash'; is copyright('the United States Copyright Act of 1976'), '', 'bogus identifier "Copyright Act"'; is copyright('the U.S. Copyright Act'), '', 'bogus identifier "Copyright Act"'; is copyright('the US Copyright Act'), '', 'bogus identifier "Copyright Act"'; is copyright('the repressive Digital Millennium Copyright Act'), '', 'bogus identifier "Copyright Act"'; is copyright('copyright the library, '), '', 'bogus identifier followed by " the library,"'; is copyright('copyright the software, '), '', 'bogus identifier followed by " the software,"'; is copyright('COPYRIGHT 1999 The Software Studio '), '1999:The Software Studio ', 'identifier followed by non-bogus "The Software Studio"'; is copyright('copyright-at-end-flag: t'), '', 'bogus identifier followed by dash'; is copyright('COPYRIGHT This software is copyright (c) 2004 by Foo'), '2004:Foo', 'bogus identifier followed by " This ", then real identifier'; my $todo = todo 'not implemented yet'; is copyright( 'Copyright 1995 - 2013 by Andreas Koenig, Copyright 2013 by Kenichi Ishigaki' ), '1995-2013:Andreas Koenig', 'dual entries on one line'; done_testing; 50_owner.t000644001750001750 1007614347334266 16772 0ustar00jonasjonas000000000000String-Copyright-0.003014/tuse Test2::V0; plan 52; use String::Copyright { format => sub { join ':', $_->[0] || '', $_->[1] || '' } }; is copyright("© 1999 12345 Steps"), '1999:12345 Steps', 'year-like owner'; is copyright("© 1999 1234 Steps"), '1234, 1999:Steps', 'too-year-like owner'; is copyright("© Foo"), ':Foo', 'year-less owner'; is copyright("© , Foo"), ':Foo', 'messy owner starting with comma'; is copyright("Copyright,, Foo"), '', 'messy owner starting with dual comma'; is copyright("Copyright, , Foo"), '', 'messy owner starting with dual comma'; is copyright("© - Foo"), ':Foo', 'owner after dash'; is copyright("© -- Foo"), ':Foo', 'owner after double dash'; is copyright("© 1999 - Foo"), '1999:Foo', 'owner after year and dash'; is copyright("© 1999 -- Foo"), '1999:Foo', 'owner after year and double-dash'; is copyright("© -Foo"), '', 'bogus owner starting with dash'; is copyright("© --Foo"), '', 'bogus owner starting with double dash'; is copyright("© [yyyy] Foo"), '', 'bogus owner starting with template year'; is copyright("© (Foo)"), ':(Foo)', 'owner starting with paranthesis'; is copyright('© Foo (Bar) Baz'), ':Foo (Bar) Baz', 'owner with non-first word in parenthesis'; is copyright('© Foo (Bar Baz)'), ':Foo (Bar Baz)', 'owner with non-first words in parenthesis'; is copyright('© (Foo) Bar Baz'), ':(Foo) Bar Baz', 'owner with first word in parenthesis'; # TODO: either exclude these or reduce owner initial regexp is copyright('© ?Foo'), ':Foo', 'messy owner starting with question mark'; is copyright('© *Foo'), ':*Foo', 'messy owner starting with asterisk'; is copyright('© ,Foo'), ':Foo', 'messy owner starting with comma'; is copyright('© Foo'), '', 'bogus owner starting with end chevron'; is copyright('© =Foo'), '', 'bogus owner starting with equals'; is copyright('© ]Foo'), '', 'bogus owner starting with end bracket'; is copyright('© \Foo'), '', 'bogus owner starting with backslash'; is copyright('© ^Foo'), '', 'bogus owner starting with caret'; is copyright('© _Foo'), '', 'bogus owner starting with underscore'; is copyright('© `Foo'), '', 'bogus owner starting with backtick'; is copyright('© }Foo'), '', 'bogus owner starting with end brace'; is copyright('© |Foo'), '', 'bogus owner starting with pipe'; is copyright('© ~Foo'), '', 'bogus owner starting with tilde'; is copyright("Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER"), '', 'bogus owner starting with YEAR'; is copyright('© Foo, all rights reserved.'), ':Foo', 'boilerplate'; is copyright('© Foo, all rights reserved. Bar'), ':Foo', 'boilerplate, then noise'; my $todo = todo 'not yet handled'; is copyright('© Foo, all rights reserved. © Bar'), ":Foo\n:Bar", 'boilerplate, then another copyright'; done_testing; 50_range.t000644001750001750 533414347334266 16715 0ustar00jonasjonas000000000000String-Copyright-0.003014/tuse Test2::V0; plan 29; use String::Copyright { format => sub { join ':', $_->[0] || '', $_->[1] || '' } }; is copyright("© 1999,2000 \n , 2001 ,2002, 2003 Foo"), '1999-2003:Foo', 'comma list'; is copyright("© 1999,2000 \n 2001 ,2002, 2003 Foo"), '1999-2003:Foo', 'non-comma list'; is copyright("© 1999-2000 , 2001 - 2002\n, 2003 Foo"), '1999-2003:Foo', 'single-year ranges'; is copyright("© 1999-2000 , 2001\n - 2002\n, 2003 Foo"), '1999-2001:2002', 'range w/ newline before hyphen and before comma'; is copyright("© 1999,2000,2003,2005,2006 Foo"), '1999-2000, 2003, 2005-2006:Foo', 'range non-range range'; is copyright("© 1999-2000 , 2001 -\n 2002\n, 2003 Foo"), '1999-2003:Foo', 'range w/ newline after hyphen'; is copyright("© 1999-2002, 2003 Foo"), '1999-2003:Foo', 'multi-year ranges'; is copyright("© 1999\n, 2003 Foo"), '1999, 2003:Foo', 'newline before year-delimiting comma'; is copyright("© 1999-2000 -2004-2005 Foo"), '1999-2000:-2004-2005 Foo', 'broken range - bogus multi-range'; is copyright("(c) Foo"), '', 'bogus dummy year ""'; is copyright("Copyright (C) 19xx name of author"), '', 'bogus dummy year "19xx"'; is copyright("(c) 19yy Foo"), '', 'bogus dummy year "19yy"'; is copyright("(c) yyyy Foo"), '', 'bogus dummy year "yyyy"'; my $todo = todo 'not yet handled'; is copyright("© 1999-2000-2004-2005 Foo"), ':1999-2000-2004-2005 Foo', 'broken range - bogus multi-nonspace-range'; is copyright("© 1999-2000-2005-2004 Foo"), '1999-2000-2005-2004:Foo', 'broken range - bogus multi-range wrong order'; is copyright("© 1999,2000 \n - 2000 ,2002, 2003 \nFoo"), '1999-2000, 2002-2003:Foo', 'broken range - same year'; is copyright("© 1999,2000 \n - 1999 ,2002, 2003 \nFoo"), '1999, 2000:- 1999, 2002-2003 Foo', 'broken range - earlier year'; $todo = undef; is copyright("© 1999,2000 , 2001 ,200\n2, 2003 Foo"), '1999-2001:200', 'broken range - newline in year'; is copyright("© 1999"), '1999:', 'owner-less year'; is copyright("© . 1999"), '', 'bogus owner-less year starting with dot'; is copyright("© , 1999, 2000"), '1999-2000:', 'initial comma'; is copyright("© -1999, 2000"), ':-1999, 2000', 'not-treated-as-year starting with dash'; is copyright("© 2001, 2001"), '2001:', 'duplicate year'; is copyright("© 2001-2001"), '2001:', 'single-year range'; is copyright("© 2002-2000"), '2000-2002:', 'backwards range'; $todo = todo 'not yet handled'; is copyright("© 2000-03"), '2000-2003:', 'sloppy range-end, 2 digits'; is copyright("© 2005-7"), '2005-2007:', 'sloppy range-end, 1 digit'; is copyright("Copyright (c) Foo, 2000"), '2000:Foo', 'year at end'; is copyright("Copyright (c) Foo, 2000,\n 2001"), '2000-2001:Foo', 'year at end and next line'; done_testing; Copyright.pm000644001750001750 2466114347334266 21233 0ustar00jonasjonas000000000000String-Copyright-0.003014/lib/Stringuse 5.008001; use strict; use warnings; use utf8; use re (qw/eval/); my $CAN_RE2; BEGIN { eval { require re::engine::RE2 }; $CAN_RE2 = $@ ? '' : 1; } package String::Copyright; =encoding UTF-8 =head1 NAME String::Copyright - Representation of text-based copyright statements =head1 VERSION Version 0.003014 =cut our $VERSION = '0.003014'; # Dependencies use parent 'Exporter::Tiny'; use Carp (); use Set::IntSpan; our @EXPORT = qw/copyright/; use constant { PLAINTEXT => 0, BLOCKS => 1, FORMAT => 2, }; use overload ( q{""} => '_compose', fallback => 1, ); =head1 SYNOPSIS use String::Copyright; my $copyright = copyright(<<'END'); copr. © 1999,2000 Foo Barbaz and Acme Corp. Copyright (c) 2001,2004 Foo (work address) Copyright 2003, Foo B. and friends © 2000, 2002 Foo Barbaz END print $copyright; # Copyright 1999-2000 Foo Barbaz and Acme Corp. # Copyright 2000, 2002 Foo Barbaz and Acme Corp. # Copyright 2001, 2004 Foo (work address) # Copyright 2003 Foo B. and friends =head1 DESCRIPTION L identifies copyright statements in a string and serializes them in a normalized format. =head1 OPTIONS Options can be set as an argument to the 'use' statement. =head2 threshold, threshold_before, threshold_after use String::Copyright { threshold_after => 5 }; Stop parsing after this many lines without copyright information, before or after having found any copyright information at all. C sets both C and C. By default unset: All lines are parsed. =head2 format( \&sub ) use String::Copyright { format => \&GNU_style } }; sub GNU_style { my ( $years, $owners ) = @_; return 'Copyright (C) ' . join ' ', $years || '', $owners || ''; } =head1 FUNCTIONS Exports one function: C. This module uses L to export functions, which allows for flexible import options; see the L documentation for details. =cut # OR'ed strings have regular variable name and are already grouped # AND'ed strings have name ending in underscore: must be grouped if repeated my $blank = '[ \t]'; my $blank_or_break_ = "$blank*\\n?$blank*"; my $dash = '[-˗‐‑‒–—―⁃−﹣-]'; my $colons_ = "$blank?:{1,2}"; my $strictlabel = 'SPDX-FileCopyrightText:'; my $label = '(?i:copyright(?:-holders?)?\b|copr\.)'; my $sign = '[©⒞Ⓒⓒ🄒🄫🅒]'; my $nroff_sign_ = '\\\\[(]co'; my $pseudo_sign_ = '[({][Cc][})]'; my $vague_sign_ = '-[Cc]-'; my $broken_sign_ = "\\?$blank*"; # high-bit © noise, caused by misparsing UTF-8 as latin1 # except \xAE (latin1 ©), \xAE (MacRoman ©), \xE2 (latin1 © lowercased after misparse) my $nonsign_ = '[\x80-\xAB\xAD-\xC1\xC3-\xE1\xE3-\xFF]\xA9'; my $nonidentifier_ = "(?:no |_|$dash)copyright|copyright-[^h]|(?:Digital Millennium|U.S.|US|United States) Copyright Act|\\b(?:for|we) copyright\\b"; # this should cause *no* false positives, and stop-chars therefore # exclude e.g. email address building blocks; tested against the code # corpus at https://codesearch.debian.net/ (tricky: its RE2 engine lacks # support for negative groups) using searches like these: # (?i)copyright (?:(?:claim|holder|info|information|notice|owner|ownership|statement|string)s?|in|is|to)@\w # (?i)copyright (?:(?:claim|holder|info|information|notice|owner|ownership|statement|string)s?|in|is|to)@\b[-_@] # (?im)copyright (?:(?:claim|holder|info|information|notice|owner|ownership|statement|string)s?|in|is|to)[^ $] my $identifier_action = '(?i:apply|applied|applies|assigned|generated|transfer|transferred)'; my $identifier_thing_ = '(?i:block|claim|date|disclaimer|holder|info|information|interest|law|license|notice|owner|ownership|permission|sign|statement|string|symbol|tag|text)s?'; my $identifier_misc = "(?i:and|are|at|eq|for|if|in|is|of|on|or|,${blank}patent|this|to|the (?:library|software),|treaty)"; my $identifier_chatter = "(?:$identifier_action|$identifier_thing_|$identifier_misc)"; my $the_notname = '(?i:concrete|fault|first|immediately|least|min\/max|one|outer|previous|ratio|sum|user)'; my $the_sentence_ = "(?:\\w+$blank+){1,10}(?i:are|can(?:not)?|in|is|must|was)"; my $pseudosign_chatter_ = "(?:(?:the$blank+(?:$the_notname|$the_sentence_)|all begin|there|you must)\\b|,? \\(?\\w\\))"; my $chatter = "(?im:$nonsign_|$nonidentifier_|copyright$blank_or_break_$identifier_chatter(?:\\z|@\\W|[^a-zA-Z0-9@_-])|$blank*$pseudo_sign_(?:$blank_or_break_)+$pseudosign_chatter_)"; my $nonyears_ = '\W?(?i:year|19[xy]{2}|[xy]{4})\W?'; my $year_ = '\b[0-9]{4}\b'; my $comma_spacy = "(?:$blank*,$blank_or_break_|$blank_or_break_,?$blank*)"; my $dash_spacy_ = "$blank*$dash(?:$blank_or_break_)*"; my $colon_or_dash = "(?:$colons_$blank_or_break_|$blank?$dash\{1,2}$blank)"; my $delimiter = "(?:$colon_or_dash|$comma_spacy)"; my $vague_year_ = "(?:$dash$blank?)?[0-9]{1,5}"; my $owner_intro_ = "(?:$colon_or_dash|$pseudo_sign_$blank?|\\bby$blank_or_break_)"; my $owner_prefix = '[(*<@\[{]'; my $owner_initial = '[^\s!"#$%&\'()*+,./:;<=>?@[\\\\\]^_`{|}~-]'; my $signs = "(?m:$strictlabel$blank*|(?:$label|$sign|$nroff_sign_|(?:^|$blank)$pseudo_sign_)(?:$colon_or_dash?$blank*(?:$label|$sign|$pseudo_sign_))*)"; my $yearspan_ = "$year_(?:$dash_spacy_$year_)?"; my $years_ = "$yearspan_(?:$comma_spacy$yearspan_)*"; my $owners_ = "(?:$vague_year_|$owner_prefix*$owner_initial\\S*)(?:$blank*\\S+)*"; # compile regexps in isolation to limit use of RE2 engine my ($dash_spacy_re, $owner_intro_A_re, $boilerplate_X_re, $signs_and_more_re ); { BEGIN { re::engine::RE2->import( -strict => 1 ) if ($CAN_RE2) } $dash_spacy_re = qr/$dash_spacy_/; $owner_intro_A_re = qr/^$owner_intro_/; $boilerplate_X_re = qr/(?i)${comma_spacy}All$blank+Rights$blank+Reserved[.!]?.*/; $signs_and_more_re = qr/$chatter|$signs(?:$blank$vague_sign_)?$delimiter(?:$broken_sign_)?(?:$nonyears_|((?:$years_$delimiter)?(?:(?:$owner_intro_)?$owners_)?))|\n/; } sub _generate_copyright { my ( $class, $name, $args, $globals ) = @_; return sub { my $copyright = shift; Carp::croak("String::Copyright strings require defined parts") unless 1 + @_ == grep {defined} $copyright, @_; # String::Copyright objects are effectively immutable and can be reused if ( !@_ && ref($copyright) eq __PACKAGE__ ) { return $copyright; } # stringify objects $copyright = "$copyright"; # TODO: also parse @_ - but each separately! my @block; my $skipped = 0; while ( $copyright =~ /$signs_and_more_re/g ) { my $owners = $1; if ( $globals->{threshold_before} || $globals->{threshold} ) { last if ( !@block and !length $owners and ++$skipped >= ( $globals->{threshold_before} || $globals->{threshold} ) ); } if ( $globals->{threshold_after} || $globals->{threshold} ) { # "after" detects end of _current_ line so is skewed by one last if ( @block and !length $owners and ++$skipped >= 1 + ( $globals->{threshold_after} || $globals->{threshold} ) ); } next if ( !length $owners ); $skipped = 0; my $years; my @span = $owners =~ /\G($yearspan_)(?:$comma_spacy|\Z)/gm; if (@span) { $owners = $'; # deduplicate my @ranges; for (@span) { my ( $y1, $y2 ) = split /$dash_spacy_re/; if ( !$y2 ) { push @ranges, $y1; } elsif ( $y1 > $y2 ) { push @ranges, [ $y2, $y1 ]; } else { push @ranges, [ $y1, $y2 ]; } } # normalize $years = join ', ', map { $_->[0] == $_->[1] ? $_->[0] : "$_->[0]-$_->[1]" } Set::IntSpan->new( \@ranges )->spans; } if ($owners) { $owners =~ s/$owner_intro_A_re//; $owners =~ s/\s{2,}/ /g; $owners =~ s/$owner_intro_A_re//; $owners =~ s/$boilerplate_X_re//g; } # split owner into owner_id and owner push @block, [ $years || undef, $owners || undef ]; } # TODO: save $skipped_lines to indicate how dirty parsing was my $ext_format = $globals->{format}; my $format = $globals->{format} ? sub { $ext_format->( $_->[0], $_->[1] ) } : sub { join ' ', '©', $_->[0] || (), $_->[1] || () }; bless [ $copyright, \@block, $format ], __PACKAGE__; } } sub new { my ( $self, @data ) = @_; Carp::croak("String::Copyright require defined, positive-length parts") unless 1 + @_ == grep { defined && length } @data; # String::Copyright objects are simply stripped of their string part if ( !@_ && ref($self) eq __PACKAGE__ ) { return bless [ undef, $data[1] ], __PACKAGE__; } # FIXME: properly validate data Carp::croak("String::Copyright blocks must be an array of strings") unless @_ == grep { ref eq 'ARRAY' } @data; bless [ undef, \@data ], __PACKAGE__; } sub _compose { my $format = $_[0]->[FORMAT]; join "\n", map {&$format} @{ $_[0]->[BLOCKS] }; } sub is_normalized { !defined $_[0]->[PLAINTEXT] } =head1 SEE ALSO =over 4 =item * L =item * L =back =head1 BUGS/CAVEATS/etc L operates on strings, not bytes. Data encoded as UTF-8, Latin1 or other formats need to be decoded to strings before use. Only ASCII characters and B<©> (copyright sign) are directly processed. If copyright sign is not detected or accents or multi-byte characters display wrong, then most likely the data was not decoded into a string. If ranges or lists of years are not tidied, then maybe it contained non-ASCII whitespace or digits. =head1 AUTHOR Jonas Smedegaard C<< >> =head1 COPYRIGHT AND LICENSE This program is based on the script "licensecheck" from the KDE SDK, originally introduced by Stefan Westerfeld C<< >>. Copyright © 2007, 2008 Adam D. Barratt Copyright © 2005-2012, 2016, 2018, 2020-2021 Jonas Smedegaard Copyright © 2018, 2020-2021 Purism SPC This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3, 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . =cut 1;