Bump to nix 0.17 and reqwest 0.10

This commit is contained in:
Josh Stone 2020-02-21 12:05:31 -08:00
parent 98ded175cc
commit 8a073e3138
3 changed files with 124 additions and 2 deletions

View File

@ -0,0 +1,83 @@
From 3888ca84dc2696a1c81bcc152395c7d9db6e7f66 Mon Sep 17 00:00:00 2001
From: Luca BRUNO <luca.bruno@coreos.com>
Date: Thu, 16 Jan 2020 09:27:52 +0000
Subject: [PATCH] source: update to new reqwest blocking API
---
src/errors.rs | 8 ++++----
src/source.rs | 11 +++++------
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/errors.rs b/src/errors.rs
index a167b785d425..73949ef4f4ab 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -16,9 +16,9 @@ use error_chain::error_chain;
error_chain! {
foreign_links {
- Io(::std::io::Error);
- Reqwest(::reqwest::Error);
- Url(::reqwest::UrlError);
- Nix(::nix::Error);
+ Io(std::io::Error);
+ Reqwest(reqwest::Error);
+ Url(url::ParseError);
+ Nix(nix::Error);
}
}
diff --git a/src/source.rs b/src/source.rs
index ce8853d0dd8d..d868074ebb92 100644
--- a/src/source.rs
+++ b/src/source.rs
@@ -13,7 +13,7 @@
// limitations under the License.
use error_chain::bail;
-use reqwest::{StatusCode, Url};
+use reqwest::{blocking, StatusCode, Url};
use serde::Deserialize;
use std::collections::HashMap;
use std::fmt::{Display, Formatter};
@@ -156,7 +156,7 @@ impl Display for UrlLocation {
impl ImageLocation for UrlLocation {
fn sources(&self) -> Result<Vec<ImageSource>> {
- let client = reqwest::Client::new();
+ let client = blocking::Client::new();
// fetch signature
let mut resp = client
@@ -240,9 +240,8 @@ impl Display for StreamLocation {
impl ImageLocation for StreamLocation {
fn sources(&self) -> Result<Vec<ImageSource>> {
- let client = reqwest::Client::new();
-
// fetch and parse stream metadata
+ let client = blocking::Client::new();
let stream = fetch_stream(client, &self.stream_url)?;
// descend it
@@ -287,8 +286,8 @@ pub fn list_stream(config: &ListStreamConfig) -> Result<()> {
}
// fetch stream metadata
+ let client = blocking::Client::new();
let stream_url = build_stream_url(&config.stream, config.stream_base_url.as_ref())?;
- let client = reqwest::Client::new();
let stream = fetch_stream(client, &stream_url)?;
// walk formats
@@ -343,7 +342,7 @@ fn build_stream_url(stream: &str, base_url: Option<&Url>) -> Result<Url> {
}
/// Fetch and parse stream metadata.
-fn fetch_stream(client: reqwest::Client, url: &Url) -> Result<Stream> {
+fn fetch_stream(client: blocking::Client, url: &Url) -> Result<Stream> {
// fetch stream metadata
let resp = client
.get(url.clone())
--
2.24.1

View File

@ -0,0 +1,31 @@
--- coreos-installer-0.1.2/Cargo.toml 2020-01-08T21:57:23+00:00
+++ coreos-installer-0.1.2/Cargo.toml 2020-02-21T20:01:19.812443+00:00
@@ -49,7 +49,7 @@
version = "^1.0.13"
[dependencies.nix]
-version = "^0.16.1"
+version = "^0.17"
[dependencies.progress-streams]
version = "^1.1.0"
@@ -58,7 +58,8 @@
version = "1.3.1"
[dependencies.reqwest]
-version = "^0.9.24"
+version = "^0.10.1"
+features = ["blocking"]
[dependencies.serde]
version = "1.0"
@@ -70,6 +71,9 @@
[dependencies.tempdir]
version = "0.3"
+[dependencies.url]
+version = "^2.1.1"
+
[dependencies.xz2]
version = "^0.1.6"
[dev-dependencies.maplit]

View File

@ -1,4 +1,4 @@
# Generated by rust2rpm 12 # Generated by rust2rpm 13
%bcond_without check %bcond_without check
%global __cargo_skip_build 0 %global __cargo_skip_build 0
@ -6,13 +6,18 @@
Name: rust-%{crate} Name: rust-%{crate}
Version: 0.1.2 Version: 0.1.2
Release: 3%{?dist} Release: 4%{?dist}
Summary: Installer for Fedora CoreOS and RHEL CoreOS Summary: Installer for Fedora CoreOS and RHEL CoreOS
# Upstream license specification: Apache-2.0 # Upstream license specification: Apache-2.0
License: ASL 2.0 License: ASL 2.0
URL: https://crates.io/crates/coreos-installer URL: https://crates.io/crates/coreos-installer
Source: %{crates_source} Source: %{crates_source}
# Initial patched metadata
# * Bump to nix 0.17, https://github.com/coreos/coreos-installer/pull/150
# * Bump to reqwest 0.10, https://github.com/coreos/coreos-installer/pull/141
Patch0: coreos-installer-fix-metadata.diff
Patch1: 0001-source-update-to-new-reqwest-blocking-API.patch
ExclusiveArch: %{rust_arches} ExclusiveArch: %{rust_arches}
@ -82,6 +87,9 @@ Systemd service files for %{crate}
%endif %endif
%changelog %changelog
* Fri Feb 21 2020 Josh Stone <jistone@redhat.com> - 0.1.2-4
- Bump to nix 0.17 and reqwest 0.10
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-3 * Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild