pkgsrc-WIP-changes archive

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

cloudflare-speed-cli: check_if_wireless



Module Name:	pkgsrc-wip
Committed By:	Bartosz Kuzma <bartosz.kuzma%gmail.com@localhost>
Pushed By:	bartosz.kuzma
Date:		Mon Jun 22 17:13:39 2026 +0200
Changeset:	7cdbbcb117a621258080c32dea2f7bc1f72c4498

Modified Files:
	cloudflare-speed-cli/TODO
	cloudflare-speed-cli/distinfo
	cloudflare-speed-cli/patches/patch-src_network.rs

Log Message:
cloudflare-speed-cli: check_if_wireless

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=7cdbbcb117a621258080c32dea2f7bc1f72c4498

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 cloudflare-speed-cli/TODO                         |  1 -
 cloudflare-speed-cli/distinfo                     |  2 +-
 cloudflare-speed-cli/patches/patch-src_network.rs | 21 +++++++++++++++++----
 3 files changed, 18 insertions(+), 6 deletions(-)

diffs:
diff --git a/cloudflare-speed-cli/TODO b/cloudflare-speed-cli/TODO
index 1fec46f993..71eccd2b44 100644
--- a/cloudflare-speed-cli/TODO
+++ b/cloudflare-speed-cli/TODO
@@ -1,2 +1 @@
-check_if_wireless
 get_wireless_ssid
diff --git a/cloudflare-speed-cli/distinfo b/cloudflare-speed-cli/distinfo
index 6947cef71f..401795d6be 100644
--- a/cloudflare-speed-cli/distinfo
+++ b/cloudflare-speed-cli/distinfo
@@ -966,4 +966,4 @@ Size (zune-core-0.4.12.crate) = 17355 bytes
 BLAKE2s (zune-jpeg-0.4.21.crate) = f3bbaa5d70d1efc8c02a3b5d446e3eeab9896bd3d1e3ba619b1bdb8579929eb6
 SHA512 (zune-jpeg-0.4.21.crate) = 838ed690fc2d026f40feaaef9c88d85f9a80b186e95f23e5be01c632816942660a89cb0524f2346902fa92235d5de2228485daa67019fcf06ef60ae147b4073c
 Size (zune-jpeg-0.4.21.crate) = 68268 bytes
-SHA1 (patch-src_network.rs) = 2b14285657810a6afb85164b0504da58088ad62d
+SHA1 (patch-src_network.rs) = b84072fedd58234c5ac20cef9813b71113b5f0f9
diff --git a/cloudflare-speed-cli/patches/patch-src_network.rs b/cloudflare-speed-cli/patches/patch-src_network.rs
index 85009fc261..fb7af6713b 100644
--- a/cloudflare-speed-cli/patches/patch-src_network.rs
+++ b/cloudflare-speed-cli/patches/patch-src_network.rs
@@ -40,19 +40,32 @@ NetBSD specific functions
  #[cfg(target_os = "macos")]
  fn get_default_interface(family: Option<IpFamily>) -> Option<String> {
      // `route -n get -inet6 default` for IPv6; the v4 default otherwise.
-@@ -357,6 +386,11 @@ fn check_if_wireless(iface: &str) -> Opt
+@@ -357,6 +386,24 @@ fn check_if_wireless(iface: &str) -> Opt
      Some(is_wireless)
  }
  
 +#[cfg(target_os = "netbsd")]
-+fn check_if_wireless(_iface: &str) -> Option<bool> {
++fn check_if_wireless(iface: &str) -> Option<bool> {
++    if let Ok(output) = Command::new("ifconfig").arg(iface).output() {
++        if output.status.success() {
++            if let Ok(output_str) = String::from_utf8(output.stdout) {
++                for line in output_str.lines() {
++                    let line = line.trim();
++                    if line.starts_with("ssid ") {
++                        return Some(true);
++                    }
++                }
++            }
++        }
++    }
++
 +    Some(false)
 +}
 +
  #[cfg(target_os = "macos")]
  fn check_if_wireless(iface: &str) -> Option<bool> {
      // Parse `networksetup -listallhardwareports` to check if the interface is Wi-Fi
-@@ -477,6 +511,11 @@ fn get_wireless_ssid(iface: &str) -> Opt
+@@ -477,6 +524,11 @@ fn get_wireless_ssid(iface: &str) -> Opt
      None
  }
  
@@ -64,7 +77,7 @@ NetBSD specific functions
  #[cfg(target_os = "macos")]
  fn get_wireless_ssid(iface: &str) -> Option<String> {
      // Try `networksetup -getairportnetwork <iface>` (public API)
-@@ -576,6 +615,26 @@ fn get_interface_mac(iface: &str) -> Opt
+@@ -576,6 +628,26 @@ fn get_interface_mac(iface: &str) -> Opt
      None
  }
  


Home | Main Index | Thread Index | Old Index