diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-13 15:02:07 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-13 15:04:53 +0200 |
commit | fee46540e9c760f4edddce8fd8ec4e20bf0a48e9 (patch) | |
tree | 027f53fe7e694f62654899b5d65f9581df0cf58d /testing/cargo | |
parent | 654b9799cca846df8c5ea35fec5ecc5f5e4e9cd8 (diff) | |
download | aports-fee46540e9c760f4edddce8fd8ec4e20bf0a48e9.tar.bz2 aports-fee46540e9c760f4edddce8fd8ec4e20bf0a48e9.tar.xz |
testing/cargo: fix test build-auth:http_auth_offered
Diffstat (limited to 'testing/cargo')
-rw-r--r-- | testing/cargo/APKBUILD | 6 | ||||
-rw-r--r-- | testing/cargo/fix-test-build-auth.patch | 46 |
2 files changed, 50 insertions, 2 deletions
diff --git a/testing/cargo/APKBUILD b/testing/cargo/APKBUILD index 7c70fcd6b0..8df628e119 100644 --- a/testing/cargo/APKBUILD +++ b/testing/cargo/APKBUILD @@ -21,7 +21,8 @@ subpackages="$pkgname-doc _ctarget="$CARCH-unknown-linux-musl" source="$pkgname-$pkgver.tar.gz::https://github.com/rust-lang/$pkgname/archive/$pkgver.tar.gz https://github.com/rust-lang/rust-installer/archive/$_installer_gitrev/rust-installer-$_installer_gitrev.tar.gz - cargo-$_bootstrap_gitrev-$_ctarget.tar.gz::https://s3.amazonaws.com/rust-lang-ci/cargo-builds/$_bootstrap_gitrev/cargo-nightly-$_ctarget.tar.gz" + cargo-$_bootstrap_gitrev-$_ctarget.tar.gz::https://s3.amazonaws.com/rust-lang-ci/cargo-builds/$_bootstrap_gitrev/cargo-nightly-$_ctarget.tar.gz + fix-test-build-auth.patch" builddir="$srcdir/$pkgname-$pkgver" _bootstrap_cargo="$srcdir/cargo-nightly-$_ctarget/cargo/bin/cargo" @@ -102,4 +103,5 @@ _mv() { sha512sums="5ea9a382ab48ee714b5cd1412f11ae72c6065913e2ce56cf84fe43f9061fd383f32c16a6525e5400f3fec9c10eaa3e7a149b026ae9c64af0955e91678b032650 cargo-0.17.0.tar.gz 9ceb4755890ad3ae68ce141231c5114077261e0279d3a9a6208053f8d3386c9198e6b94d6321b456648dd5baa86dfc3ae81df44b67d41b428d11afd6763f0cff rust-installer-4f994850808a572e2cc8d43f968893c8e942e9bf.tar.gz -4df33353b6be1af822220ca03f9ec5a3b6421c9b10ec17b864be586ba495c6210bac70d904b0e0b35eff62ef2c9a681ded526e5cbd37e326dc3146742aa659de cargo-6e0c18cccc8b0c06fba8a8d76486f81a792fb420-x86_64-unknown-linux-musl.tar.gz" +4df33353b6be1af822220ca03f9ec5a3b6421c9b10ec17b864be586ba495c6210bac70d904b0e0b35eff62ef2c9a681ded526e5cbd37e326dc3146742aa659de cargo-6e0c18cccc8b0c06fba8a8d76486f81a792fb420-x86_64-unknown-linux-musl.tar.gz +d93f6beeeb6b1207c38ee216f4a9475c7cc5cb11b52e3b52dbd3c4ad4ed5ca19118c1bc4a24c097aaa20e914e1c3d6a972fd438bae2db2d843319915dc4a3609 fix-test-build-auth.patch" diff --git a/testing/cargo/fix-test-build-auth.patch b/testing/cargo/fix-test-build-auth.patch new file mode 100644 index 0000000000..7269f195a6 --- /dev/null +++ b/testing/cargo/fix-test-build-auth.patch @@ -0,0 +1,46 @@ +From: Jakub Jirutka <jakub@jirutka.cz> +Date: Thu, 13 Aug 2016 14:47:00 +0200 +Subject: [PATCH] Fix test build-auth:http_auth_offered + +The test fails because of hard-coded libgit2 version, that may not be +the same as actually used libgit2... + +--- a/tests/build-auth.rs ++++ b/tests/build-auth.rs +@@ -20,7 +20,7 @@ + let addr = server.local_addr().unwrap(); + + fn headers(rdr: &mut BufRead) -> HashSet<String> { +- let valid = ["GET", "Authorization", "Accept", "User-Agent"]; ++ let valid = ["GET", "Authorization", "Accept"]; + rdr.lines().map(|s| s.unwrap()) + .take_while(|s| s.len() > 2) + .map(|s| s.trim().to_string()) +@@ -33,11 +33,6 @@ + let t = thread::spawn(move|| { + let mut conn = BufStream::new(server.accept().unwrap().0); + let req = headers(&mut conn); +- let user_agent = if cfg!(windows) { +- "User-Agent: git/1.0 (libgit2 0.25.0)" +- } else { +- "User-Agent: git/2.0 (libgit2 0.25.0)" +- }; + conn.write_all(b"\ + HTTP/1.1 401 Unauthorized\r\n\ + WWW-Authenticate: Basic realm=\"wheee\"\r\n +@@ -46,7 +41,6 @@ + assert_eq!(req, vec![ + "GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1", + "Accept: */*", +- user_agent, + ].into_iter().map(|s| s.to_string()).collect()); + drop(conn); + +@@ -61,7 +55,6 @@ + "GET /foo/bar/info/refs?service=git-upload-pack HTTP/1.1", + "Authorization: Basic Zm9vOmJhcg==", + "Accept: */*", +- user_agent, + ].into_iter().map(|s| s.to_string()).collect()); + }); + |