aports/testing/py3-netifaces2/upgrade-nix-to-0.28.0.patch
2024-02-25 11:08:18 +00:00

153 lines
4.3 KiB
Diff

From 5e18338142d899eac0b9c2c514d860aaaad6f632 Mon Sep 17 00:00:00 2001
From: "lauren n. liberda" <lauren@selfisekai.rocks>
Date: Sat, 24 Feb 2024 17:40:51 +0100
Subject: [PATCH] upgrade nix to 0.28.0
---
Cargo.lock | 46 ++++++++++++++++++++++++++++++----------------
Cargo.toml | 5 +++--
src/linux.rs | 3 +--
3 files changed, 34 insertions(+), 20 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index a39034f..cd17c6e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -14,12 +14,24 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+[[package]]
+name = "bitflags"
+version = "2.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
+
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+[[package]]
+name = "cfg_aliases"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
+
[[package]]
name = "indoc"
version = "1.0.7"
@@ -28,9 +40,9 @@ checksum = "adab1eaa3408fb7f0c777a73e7465fd5656136fc93b670eb6df3c88c2c1344e3"
[[package]]
name = "libc"
-version = "0.2.135"
+version = "0.2.153"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c"
+checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "lock_api"
@@ -51,6 +63,15 @@ dependencies = [
"autocfg",
]
+[[package]]
+name = "memoffset"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
+dependencies = [
+ "autocfg",
+]
+
[[package]]
name = "netifaces"
version = "0.1.0"
@@ -63,16 +84,15 @@ dependencies = [
[[package]]
name = "nix"
-version = "0.25.0"
+version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb"
+checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4"
dependencies = [
- "autocfg",
- "bitflags",
+ "bitflags 2.4.2",
"cfg-if",
+ "cfg_aliases",
"libc",
- "memoffset",
- "pin-utils",
+ "memoffset 0.9.0",
]
[[package]]
@@ -104,12 +124,6 @@ dependencies = [
"windows-sys",
]
-[[package]]
-name = "pin-utils"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-
[[package]]
name = "proc-macro2"
version = "1.0.70"
@@ -128,7 +142,7 @@ dependencies = [
"cfg-if",
"indoc",
"libc",
- "memoffset",
+ "memoffset 0.6.5",
"parking_lot",
"pyo3-build-config",
"pyo3-ffi",
@@ -194,7 +208,7 @@ version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
- "bitflags",
+ "bitflags 1.3.2",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 1b1053a..8de4d12 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -28,5 +28,6 @@ windows = { version = "0.42.0", features = [
version = "0.17.1"
features = ["extension-module", "abi3-py37"]
-[target.'cfg(unix)'.dependencies]
-nix = { version = "0.25.0" }
+[target.'cfg(unix)'.dependencies.nix]
+version = "0.28.0"
+features = ["net"]
diff --git a/src/linux.rs b/src/linux.rs
index 26f4500..234b1a0 100644
--- a/src/linux.rs
+++ b/src/linux.rs
@@ -1,4 +1,3 @@
-use crate::ip_to_string;
use crate::types::{
AddrPairs, IfAddrs, ADDR_ADDR, AF_ALG, AF_INET, AF_INET6, AF_NETLINK, AF_PACKET, AF_VSOCK,
BROADCAST_ADDR, MASK_ADDR, PEER_ADDR,
@@ -73,7 +72,7 @@ pub fn linux_ifaddresses(if_name: &str) -> Result<IfAddrs, Box<dyn std::error::E
if let Some(inet_addr) = address.as_sockaddr_in() {
add_to_types_mat(
AF_INET,
- &ip_to_string(inet_addr.ip()),
+ &inet_addr.ip(),
name,
&mut types_mat,
&mut any,