--- Begin Message ---
Package: elan
Version: 1.3.1-3
Severity: serious
Tags: patch
A number of rust crates have been updated recently, as a result your
package no longer builds, I have updated the patches to relax the
dependencies and was able to succesfully build the package, I have not
tested it beyond that.
From: Christopher Hoskin <mans0...@debian.org>
Date: Wed, 26 Jan 2022 19:46:47 +0000
Subject: Revert "feat: support tar.zst archives"
This reverts commit 3241c307cfcff08f02ae9856aa505c05fc14fcd7.
---
Cargo.lock | 39 ----------------------------------
src/elan-dist/Cargo.toml | 1 -
src/elan-dist/src/component/package.rs | 16 --------------
src/elan-dist/src/download.rs | 4 ++--
src/elan-dist/src/manifestation.rs | 25 +++++++++++-----------
5 files changed, 15 insertions(+), 70 deletions(-)
Index: elan-1.3.1/Cargo.lock
===================================================================
--- elan-1.3.1.orig/Cargo.lock
+++ elan-1.3.1/Cargo.lock
@@ -394,7 +394,6 @@ dependencies = [
"winapi 0.3.9",
"winreg 0.8.0",
"zip",
- "zstd",
]
[[package]]
@@ -778,15 +777,6 @@ source = "registry+https://github.com/ru
checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
-name = "jobserver"
-version = "0.1.24"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
-dependencies = [
- "libc",
-]
-
-[[package]]
name = "js-sys"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1873,32 +1863,3 @@ dependencies = [
"thiserror",
"time 0.1.43",
]
-
-[[package]]
-name = "zstd"
-version = "0.9.0+zstd.1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "07749a5dc2cb6b36661290245e350f15ec3bbb304e493db54a1d354480522ccd"
-dependencies = [
- "zstd-safe",
-]
-
-[[package]]
-name = "zstd-safe"
-version = "4.1.1+zstd.1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c91c90f2c593b003603e5e0493c837088df4469da25aafff8bce42ba48caf079"
-dependencies = [
- "libc",
- "zstd-sys",
-]
-
-[[package]]
-name = "zstd-sys"
-version = "1.6.1+zstd.1.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "615120c7a2431d16cf1cf979e7fc31ba7a5b5e5707b29c8a99e5dbf8a8392a33"
-dependencies = [
- "cc",
- "libc",
-]
Index: elan-1.3.1/src/elan-dist/Cargo.toml
===================================================================
--- elan-1.3.1.orig/src/elan-dist/Cargo.toml
+++ elan-1.3.1/src/elan-dist/Cargo.toml
@@ -14,7 +14,6 @@ itertools = "0.10.0"
url = "2.2.1"
tar = "0.4.33"
flate2 = "1.0.14"
-zstd = "0.9"
walkdir = "2.3.1"
toml = "0.5.8"
sha2 = ">= 0.9.2, <0.11"
Index: elan-1.3.1/src/elan-dist/src/component/package.rs
===================================================================
--- elan-1.3.1.orig/src/elan-dist/src/component/package.rs
+++ elan-1.3.1/src/elan-dist/src/component/package.rs
@@ -4,7 +4,6 @@
extern crate filetime;
extern crate flate2;
-extern crate zstd;
extern crate tar;
use errors::*;
@@ -140,21 +139,6 @@ impl<'a> TarGzPackage<'a> {
TarPackage::unpack(stream, path)
}
- pub fn unpack_file(path: &Path, into: &Path) -> Result<()> {
- let file = File::open(path).chain_err(|| ErrorKind::ExtractingPackage)?;
- Self::unpack(file, into)
- }
-}
-
-#[derive(Debug)]
-pub struct TarZstdPackage<'a>(TarPackage<'a>);
-
-impl<'a> TarZstdPackage<'a> {
- pub fn unpack<R: Read>(stream: R, path: &Path) -> Result<()> {
- let stream = zstd::stream::read::Decoder::new(stream)?;
-
- TarPackage::unpack(stream, path)
- }
pub fn unpack_file(path: &Path, into: &Path) -> Result<()> {
let file = File::open(path).chain_err(|| ErrorKind::ExtractingPackage)?;
Self::unpack(file, into)
Index: elan-1.3.1/src/elan-dist/src/download.rs
===================================================================
--- elan-1.3.1.orig/src/elan-dist/src/download.rs
+++ elan-1.3.1/src/elan-dist/src/download.rs
@@ -99,9 +99,9 @@ impl<'a> DownloadCfg<'a> {
Ok(())
}
- pub fn download_and_check(&self, url_str: &str) -> Result<temp::File<'a>> {
+ pub fn download_and_check(&self, url_str: &str, ext: &str) -> Result<temp::File<'a>> {
let url = utils::parse_url(url_str)?;
- let file = self.temp_cfg.new_file()?;
+ let file = self.temp_cfg.new_file_with_ext("", ext)?;
utils::download_file(&url, &file, None, &|n| (self.notify_handler)(n.into()))?;
Index: elan-1.3.1/src/elan-dist/src/manifestation.rs
===================================================================
--- elan-1.3.1.orig/src/elan-dist/src/manifestation.rs
+++ elan-1.3.1/src/elan-dist/src/manifestation.rs
@@ -1,6 +1,6 @@
//! Manifest a particular Lean version by installing it from a distribution server.
-use component::{TarGzPackage, TarZstdPackage, ZipPackage};
+use component::{TarGzPackage, ZipPackage};
use download::DownloadCfg;
use elan_utils::utils;
use errors::*;
@@ -57,15 +57,20 @@ impl Manifestation {
} else {
unreachable!();
};
- let url_substring = informal_target.clone() + ".";
+ let ext = if cfg!(target_os = "linux") {
+ ".tar.gz"
+ } else {
+ ".zip"
+ };
+ let url_suffix = informal_target.clone() + ext;
let re = Regex::new(format!(r#"/{}/releases/download/[^"]+"#, origin).as_str()).unwrap();
- let download_page_file = dlcfg.download_and_check(&url)?;
+ let download_page_file = dlcfg.download_and_check(&url, "")?;
let mut html = String::new();
fs::File::open(&download_page_file as &::std::path::Path)?.read_to_string(&mut html)?;
let url = re
.find_iter(&html)
.map(|m| m.as_str().to_string())
- .find(|m| m.contains(&url_substring));
+ .find(|m| m.contains(&url_suffix));
if url.is_none() {
return Err(
format!("binary package was not provided for '{}'", informal_target).into(),
@@ -73,7 +78,7 @@ impl Manifestation {
}
let url = format!("https://github.com/{}", url.unwrap());
- let installer_file = dlcfg.download_and_check(&url)?;
+ let installer_file = dlcfg.download_and_check(&url, ext)?;
let prefix = self.prefix.path();
@@ -91,15 +96,11 @@ impl Manifestation {
})?;
// Extract new files
- if url.ends_with(".tar.gz") {
+ if cfg!(target_os = "linux") {
TarGzPackage::unpack_file(&installer_file, prefix)?
- } else if url.ends_with(".tar.zst") {
- TarZstdPackage::unpack_file(&installer_file, prefix)?
- } else if url.ends_with(".zip") {
- ZipPackage::unpack_file(&installer_file, prefix)?
} else {
- return Err(format!("unsupported archive format: {}", url).into())
- }
+ ZipPackage::unpack_file(&installer_file, prefix)?
+ };
Ok(())
}
From: Christopher Hoskin <mans0...@debian.org>
Date: Wed, 26 Jan 2022 19:36:13 +0000
Subject: dependencies
Forwarded: not-needed
---
Cargo.toml | 19 +++++++------------
src/elan-dist/Cargo.toml | 11 +++--------
src/elan-utils/Cargo.toml | 15 +++++----------
3 files changed, 15 insertions(+), 30 deletions(-)
Index: elan-1.3.1/Cargo.toml
===================================================================
--- elan-1.3.1.orig/Cargo.toml
+++ elan-1.3.1/Cargo.toml
@@ -32,30 +32,25 @@ error-chain = "0.12.4"
itertools = "0.10.0"
libc = "0.2.82"
markdown = "0.3.0"
-rand = "0.8.2"
+rand = "^0.8.2"
regex = "1.4.3"
-remove_dir_all = "0.6.1"
+remove_dir_all = ">= 0.5.2, < 0.8.0"
same-file = "1.0.6"
scopeguard = "1.1.0"
serde = "1.0.119"
serde_derive = "1.0.119"
-serde_json = "1.0.61"
-sha2 = "0.9.2"
-tempfile = "3.2.0"
-term = "0.7.0"
+serde_json = "^1.0.41"
+sha2 = ">= 0.9.2, < 0.11.0"
+tempfile = "^3.1.0"
+term = "^0.5.2"
time = "0.3.4"
toml = "0.5.8"
url = "2.2.0"
-wait-timeout = "0.2.0"
+wait-timeout = "^0.1.5"
zip = "0.5.9"
tar = ">=0.4.36"
flate2 = "1.0.14"
-json = "0.12.4"
-
-[target."cfg(windows)".dependencies]
-winapi = { version = "0.3.9", features = ["jobapi", "jobapi2", "processthreadsapi", "psapi", "synchapi", "winuser"] }
-winreg = "0.8.0"
-gcc = "0.3.55"
+json = "0.12.0"
[workspace]
members = ["src/download", "src/elan-dist", "src/elan-utils"]
Index: elan-1.3.1/src/elan-dist/Cargo.toml
===================================================================
--- elan-1.3.1.orig/src/elan-dist/Cargo.toml
+++ elan-1.3.1/src/elan-dist/Cargo.toml
@@ -11,25 +11,20 @@ license = "MIT OR Apache-2.0"
[dependencies]
regex = "1.4.3"
itertools = "0.10.0"
-ole32-sys = "0.2.0"
url = "2.2.1"
tar = "0.4.33"
flate2 = "1.0.14"
zstd = "0.9"
walkdir = "2.3.1"
toml = "0.5.8"
-sha2 = "0.9.3"
-remove_dir_all = "0.7.0"
+sha2 = ">= 0.9.2, <0.11"
+remove_dir_all = ">= 0.5.2, <0.8"
elan-utils = { path = "../elan-utils" }
error-chain = "0.12.4"
-json = "0.12.4"
+json = "^0.12.0"
zip = "0.5.13"
filetime = "0.2.14"
-[target."cfg(windows)".dependencies]
-winapi = { version = "0.3.9", features = ["handleapi", "sysinfoapi", "tlhelp32", "winnt"] }
-winreg = "0.8.0"
-
[target."cfg(not(windows))".dependencies]
libc = "0.2.88"
Index: elan-1.3.1/src/elan-utils/Cargo.toml
===================================================================
--- elan-1.3.1.orig/src/elan-utils/Cargo.toml
+++ elan-1.3.1/src/elan-utils/Cargo.toml
@@ -11,19 +11,14 @@ license = "MIT OR Apache-2.0"
download = { path = "../download" }
error-chain = "0.12.4"
libc = "0.2.88"
-rand = "0.8.3"
-remove_dir_all = "0.7.0"
+rand = "^0.8.3"
+remove_dir_all = ">= 0.5.2, <0.8"
scopeguard = "1.1.0"
-semver = "0.11.0"
-sha2 = "0.9.3"
+semver = "0.9.0"
+sha2 = ">= 0.9.2, < 0.11"
toml = "0.5.8"
url = "2.2.1"
curl = "0.4.34"
-openssl = { version = "0.10", features = ["vendored"] }
+openssl = { version = "0.10" }
regex = "1.4.3"
dirs = "3.0.1"
-
-[target."cfg(windows)".dependencies]
-winapi = { version = "0.3.9", features = ["combaseapi", "errhandlingapi", "fileapi", "handleapi",
- "ioapiset", "minwindef", "processthreadsapi", "shlobj", "shtypes", "userenv", "winbase", "winerror", "winnt", "winioctl"] }
-winreg = "0.8.0"
--- End Message ---