7 个版本
0.1.13 | 2024年7月16日 |
---|---|
0.1.12 | 2024年6月24日 |
0.1.8 | 2024年2月22日 |
0.1.7 | 2023年11月29日 |
0.1.2 | 2023年10月28日 |
#1457 in 解析器实现
5,814 个月下载量
在 4 个crate中使用了(2 个直接使用)
73KB
2K SLoC
Debian 版权 (DEP5) 文件的无损解析器
此crate包含对使用DEP-5文件格式的Debian版权文件的无损解析器。
解析后,文件可以进行检查以及更改,然后再写回磁盘。
示例
let copyright: debian_copyright::Copyright = r#"\
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: lintian-brush
Upstream-Contact: Jelmer Vernooij <[email protected]>
Source: https://salsa.debian.org/jelmer/lintian-brush
Files: *
Copyright:
2018-2019 Jelmer Vernooij <[email protected]>
License: GPL-2+
Files: lintian_brush/systemd.py
Copyright: 2001, 2002, 2003 Python Software Foundation
2004-2008 Paramjit Oberoi <param.cs.wisc.edu>
2007 Tim Lauridsen <[email protected]>
2019 Jelmer Vernooij <[email protected]>
License: MIT
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
License: GPL-2+
On Debian systems, the full text of the GNU General Public License is available
in /usr/share/common-licenses/GPL-2.
"#.parse().unwrap();
let header = copyright.header().unwrap();
assert_eq!(
"https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/",
header.format_string().unwrap());
依赖关系
~3–5MB
~88K SLoC