mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(npm): skip extracting pax_global_header from tarballs (#15677)
This commit is contained in:
parent
f3a0e48d4e
commit
54be07d05e
20 changed files with 26 additions and 0 deletions
|
@ -123,6 +123,13 @@ fn extract_tarball(data: &[u8], output_folder: &Path) -> Result<(), AnyError> {
|
|||
let mut entry = entry?;
|
||||
let path = entry.path()?;
|
||||
let entry_type = entry.header().entry_type();
|
||||
|
||||
// Some package tarballs contain "pax_global_header", these entries
|
||||
// should be skipped.
|
||||
if entry_type == EntryType::XGlobalHeader {
|
||||
continue;
|
||||
}
|
||||
|
||||
// skip the first component which will be either "package" or the name of the package
|
||||
let relative_path = path.components().skip(1).collect::<PathBuf>();
|
||||
let absolute_path = output_folder.join(relative_path);
|
||||
|
|
|
@ -110,6 +110,13 @@ itest!(sub_paths {
|
|||
http_server: true,
|
||||
});
|
||||
|
||||
itest!(tarball_with_global_header {
|
||||
args: "run --unstable -A --quiet npm/tarball_with_global_header/main.js",
|
||||
output: "npm/tarball_with_global_header/main.out",
|
||||
envs: env_vars(),
|
||||
http_server: true,
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn parallel_downloading() {
|
||||
let (out, _err) = util::run_and_collect_output_with_args(
|
||||
|
|
BIN
cli/tests/testdata/npm/registry/asn1/asn1-0.2.6.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/asn1/asn1-0.2.6.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/asn1/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/asn1/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/bcrypt-pbkdf/bcrypt-pbkdf-1.0.2.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/bcrypt-pbkdf/bcrypt-pbkdf-1.0.2.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/bcrypt-pbkdf/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/bcrypt-pbkdf/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/buildcheck/buildcheck-0.0.3.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/buildcheck/buildcheck-0.0.3.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/buildcheck/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/buildcheck/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/cpu-features/cpu-features-0.0.4.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/cpu-features/cpu-features-0.0.4.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/cpu-features/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/cpu-features/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/nan/nan-2.16.0.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/nan/nan-2.16.0.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/nan/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/nan/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
cli/tests/testdata/npm/registry/safer-buffer/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/safer-buffer/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/safer-buffer/safer-buffer-2.1.2.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/safer-buffer/safer-buffer-2.1.2.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/ssh2/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/ssh2/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/ssh2/ssh2-1.11.0.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/ssh2/ssh2-1.11.0.tgz
vendored
Normal file
Binary file not shown.
1
cli/tests/testdata/npm/registry/tweetnacl/registry.json
vendored
Normal file
1
cli/tests/testdata/npm/registry/tweetnacl/registry.json
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
cli/tests/testdata/npm/registry/tweetnacl/tweetnacl-0.14.5.tgz
vendored
Normal file
BIN
cli/tests/testdata/npm/registry/tweetnacl/tweetnacl-0.14.5.tgz
vendored
Normal file
Binary file not shown.
3
cli/tests/testdata/npm/tarball_with_global_header/main.js
vendored
Normal file
3
cli/tests/testdata/npm/tarball_with_global_header/main.js
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
import { Client } from "npm:ssh2";
|
||||
|
||||
console.log(Client);
|
1
cli/tests/testdata/npm/tarball_with_global_header/main.out
vendored
Normal file
1
cli/tests/testdata/npm/tarball_with_global_header/main.out
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
[Function: bound Client]
|
Loading…
Reference in a new issue