Update hostname to 0.3

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
epel9
Igor Raits 5 years ago
parent f22e54b8a6
commit d8138d7ff4
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

@ -0,0 +1,52 @@
From c0305a3e4b08d740eb6702b69e9eee079a84fd0a Mon Sep 17 00:00:00 2001
From: Luca BRUNO <luca.bruno@coreos.com>
Date: Thu, 27 Feb 2020 10:50:36 +0000
Subject: [PATCH] cargo: update to latest hostname version
This updates the optional `hostname` dependency to the latest
version (0.3.0).
Signed-off-by: Luca BRUNO <luca.bruno@coreos.com>
---
src/config.rs | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/config.rs b/src/config.rs
index 36b6185..f0074ae 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -4,9 +4,6 @@ use std::slice::Iter;
use {grammar, Network, ParseError, ScopedIp};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
-#[cfg(feature = "system")]
-use hostname::get_hostname;
-
const NAMESERVER_LIMIT:usize = 3;
const SEARCH_LIMIT:usize = 6;
@@ -278,14 +275,19 @@ impl Config {
return self.domain.clone();
}
- get_hostname().and_then(|s| {
+ let hostname = match ::hostname::get().ok() {
+ Some(name) => name.into_string().ok(),
+ None => return None,
+ };
+
+ hostname.and_then(|s| {
if let Some(pos) = s.find('.') {
let hn = s[pos + 1..].to_string();
if !hn.is_empty() {
return Some(hn)
}
};
- return None;
+ None
})
}
}
--
2.25.1

@ -0,0 +1,11 @@
--- resolv-conf-0.6.2/Cargo.toml 1970-01-01T00:00:00+00:00
+++ resolv-conf-0.6.2/Cargo.toml 2020-02-28T12:07:29.374198+00:00
@@ -26,7 +26,7 @@
name = "resolv_conf"
path = "src/lib.rs"
[dependencies.hostname]
-version = "0.1.5"
+version = "0.3"
optional = true
[dependencies.quick-error]

@ -1,4 +1,4 @@
# Generated by rust2rpm 10
# Generated by rust2rpm 13
%bcond_without check
%global debug_package %{nil}
@ -6,13 +6,18 @@
Name: rust-%{crate}
Version: 0.6.2
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Resolv.conf file parser
# Upstream license specification: MIT/Apache-2.0
License: MIT or ASL 2.0
URL: https://crates.io/crates/resolv-conf
Source: %{crates_source}
# Initial patched metadata
# * Update hostname to 0.3, https://github.com/tailhook/resolv-conf/pull/19
Patch0: resolv-conf-fix-metadata.diff
# Finish update of hostname
Patch0001: 0001-cargo-update-to-latest-hostname-version.patch
ExclusiveArch: %{rust_arches}
%if %{__cargo_skip_build}
@ -38,7 +43,7 @@ which use "%{crate}" crate.
%files devel
%license LICENSE-MIT LICENSE-APACHE
%doc README.md
%{cargo_registry}/%{crate}-%{version}/
%{cargo_registry}/%{crate}-%{version_no_tilde}/
%package -n %{name}+default-devel
Summary: %{summary}
@ -50,7 +55,7 @@ This package contains library source intended for building other packages
which use "default" feature of "%{crate}" crate.
%files -n %{name}+default-devel
%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
%package -n %{name}+hostname-devel
Summary: %{summary}
@ -62,7 +67,7 @@ This package contains library source intended for building other packages
which use "hostname" feature of "%{crate}" crate.
%files -n %{name}+hostname-devel
%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
%package -n %{name}+system-devel
Summary: %{summary}
@ -74,7 +79,7 @@ This package contains library source intended for building other packages
which use "system" feature of "%{crate}" crate.
%files -n %{name}+system-devel
%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
@ -96,6 +101,9 @@ which use "system" feature of "%{crate}" crate.
%endif
%changelog
* Fri Feb 28 13:07:29 CET 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 0.6.2-5
- Update hostname to 0.3
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

Loading…
Cancel
Save