pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/difftastic devel/difftastic: fix package



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5ae2ce3a30c0
branches:  trunk
changeset: 390517:5ae2ce3a30c0
user:      pin <pin%pkgsrc.org@localhost>
date:      Wed Dec 21 14:19:42 2022 +0000

description:
devel/difftastic: fix package

 - Fix panic for empty strings.

diffstat:

 devel/difftastic/Makefile                                                                    |   3 +-
 devel/difftastic/distinfo                                                                    |   5 +-
 devel/difftastic/patches/patch-Cargo.toml                                                    |   6 +-
 devel/difftastic/patches/patch-vendor_tree__magic__mini-3.0.3_src_fdo__magic_builtin_init.rs |  56 ++++++++++
 4 files changed, 64 insertions(+), 6 deletions(-)

diffs (102 lines):

diff -r 9bc82da47356 -r 5ae2ce3a30c0 devel/difftastic/Makefile
--- a/devel/difftastic/Makefile Wed Dec 21 14:14:17 2022 +0000
+++ b/devel/difftastic/Makefile Wed Dec 21 14:19:42 2022 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.12 2022/12/19 11:17:17 pin Exp $
+# $NetBSD: Makefile,v 1.13 2022/12/21 14:19:42 pin Exp $
 
 DISTNAME=      difftastic-0.39.0
+PKGREVISION=    1
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=Wilfred/}
 
diff -r 9bc82da47356 -r 5ae2ce3a30c0 devel/difftastic/distinfo
--- a/devel/difftastic/distinfo Wed Dec 21 14:14:17 2022 +0000
+++ b/devel/difftastic/distinfo Wed Dec 21 14:19:42 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.12 2022/12/19 11:17:17 pin Exp $
+$NetBSD: distinfo,v 1.13 2022/12/21 14:19:42 pin Exp $
 
 BLAKE2s (aho-corasick-0.7.18.crate) = 8925e88e2df4b5ca3b31783f527e1bb31dbe27846f409f631148fa239f3b2935
 SHA512 (aho-corasick-0.7.18.crate) = 7a23b16231a90d23ee60ad4c81bc225410599a4560d33d3a203138fc540c39cf1000100fed3aed40dcc371c3635656a3792545dca5dd1aefbde00d8774eebd00
@@ -264,4 +264,5 @@
 BLAKE2s (wu-diff-0.1.2.crate) = 6e1850ebdcf02e87b768685a99067acb0f7cf78b1bf0d5af66ed09813998176d
 SHA512 (wu-diff-0.1.2.crate) = 6d93c8854dba66f48f736db3f9e997d11d07a0fef3e13219716e553c0f5936f1d00468b88d9164329cfd195271aa242ec7dfd58560074f1a41e8558719ba5af0
 Size (wu-diff-0.1.2.crate) = 33439 bytes
-SHA1 (patch-Cargo.toml) = 6bfb3de0a43516060bf61e0c121237d85c3faa69
+SHA1 (patch-Cargo.toml) = cf269ba416aae2aa152b97e312b63ba6cedbb781
+SHA1 (patch-vendor_tree__magic__mini-3.0.3_src_fdo__magic_builtin_init.rs) = b57ed890c013a90cabfc6c0dc2ef919a1753e953
diff -r 9bc82da47356 -r 5ae2ce3a30c0 devel/difftastic/patches/patch-Cargo.toml
--- a/devel/difftastic/patches/patch-Cargo.toml Wed Dec 21 14:14:17 2022 +0000
+++ b/devel/difftastic/patches/patch-Cargo.toml Wed Dec 21 14:19:42 2022 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-Cargo.toml,v 1.1 2022/12/19 11:17:17 pin Exp $
+$NetBSD: patch-Cargo.toml,v 1.2 2022/12/21 14:19:42 pin Exp $
 
-Don't patch tree_magic_mini crate.
-Required changes have been merged upstream.
+Don't pull from a specific pull-request.
+Patch tree_magic_mini crate within pkgsrc.
 
 --- Cargo.toml.orig    2022-12-19 07:55:22.000000000 +0000
 +++ Cargo.toml
diff -r 9bc82da47356 -r 5ae2ce3a30c0 devel/difftastic/patches/patch-vendor_tree__magic__mini-3.0.3_src_fdo__magic_builtin_init.rs
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/difftastic/patches/patch-vendor_tree__magic__mini-3.0.3_src_fdo__magic_builtin_init.rs      Wed Dec 21 14:19:42 2022 +0000
@@ -0,0 +1,56 @@
+$NetBSD: patch-vendor_tree__magic__mini-3.0.3_src_fdo__magic_builtin_init.rs,v 1.1 2022/12/21 14:19:42 pin Exp $
+
+Don't pull from a specific pull-request.
+Patch tree_magic_mini crate within pkgsrc.
+
+--- ../vendor/tree_magic_mini-3.0.3/src/fdo_magic/builtin/init.rs.orig 1973-11-29 21:33:09.000000000 +0000
++++ ../vendor/tree_magic_mini-3.0.3/src/fdo_magic/builtin/init.rs
+@@ -21,11 +21,15 @@ fn subclasses() -> &'static str {
+ pub fn get_aliaslist() -> FnvHashMap<MIME, MIME> {
+     aliases()
+         .lines()
+-        .map(|line| {
+-            let mut parts = line.split_whitespace();
+-            let a = parts.next().unwrap();
+-            let b = parts.next().unwrap();
+-            (a, b)
++        .filter_map(|line| {
++            if !line.is_empty() {
++                let mut parts = line.split_whitespace();
++                let a = parts.next().unwrap();
++                let b = parts.next().unwrap();
++                Some((a, b))
++            } else {
++                None
++            }
+         })
+         .collect()
+ }
+@@ -39,16 +43,20 @@ pub fn get_supported() -> Vec<MIME> {
+ pub fn get_subclasses() -> Vec<(MIME, MIME)> {
+     subclasses()
+         .lines()
+-        .map(|line| {
+-            let mut parts = line.split_whitespace();
++        .filter_map(|line| {
++            if !line.is_empty() {
++                let mut parts = line.split_whitespace();
+ 
+-            let child = parts.next().unwrap();
+-            let child = super::ALIASES.get(child).copied().unwrap_or(child);
++                let child = parts.next().unwrap();
++                let child = super::ALIASES.get(child).copied().unwrap_or(child);
+ 
+-            let parent = parts.next().unwrap();
+-            let parent = super::ALIASES.get(parent).copied().unwrap_or(parent);
++                let parent = parts.next().unwrap();
++                let parent = super::ALIASES.get(parent).copied().unwrap_or(parent);
+ 
+-            (parent, child)
++            Some((parent, child))
++            } else {
++                None
++            }
+         })
+         .collect()
+ }



Home | Main Index | Thread Index | Old Index