mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix crash when local package is missing and make OpenSSL optional in typst-kit (#4720)
This commit is contained in:
parent
d06f3f180c
commit
70931ac1f6
@ -28,7 +28,7 @@ ureq = { workspace = true, optional = true }
|
|||||||
# Explicitly depend on OpenSSL if applicable, so that we can add the
|
# Explicitly depend on OpenSSL if applicable, so that we can add the
|
||||||
# `openssl/vendored` feature to it if `vendor-openssl` is enabled.
|
# `openssl/vendored` feature to it if `vendor-openssl` is enabled.
|
||||||
[target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios", target_os = "watchos", target_os = "tvos")))'.dependencies]
|
[target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios", target_os = "watchos", target_os = "tvos")))'.dependencies]
|
||||||
openssl = { workspace = true }
|
openssl = { workspace = true, optional = true }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["fonts", "packages"]
|
default = ["fonts", "packages"]
|
||||||
@ -37,7 +37,7 @@ default = ["fonts", "packages"]
|
|||||||
fonts = ["dep:fontdb", "fontdb/memmap", "fontdb/fontconfig"]
|
fonts = ["dep:fontdb", "fontdb/memmap", "fontdb/fontconfig"]
|
||||||
|
|
||||||
# Add generic downloading utilities
|
# Add generic downloading utilities
|
||||||
downloads = ["dep:env_proxy", "dep:native-tls", "dep:ureq"]
|
downloads = ["dep:env_proxy", "dep:native-tls", "dep:ureq", "dep:openssl"]
|
||||||
|
|
||||||
# Add package downloading utilities, implies `downloads`
|
# Add package downloading utilities, implies `downloads`
|
||||||
packages = ["downloads", "dep:dirs", "dep:flate2", "dep:tar"]
|
packages = ["downloads", "dep:dirs", "dep:flate2", "dep:tar"]
|
||||||
|
@ -85,9 +85,11 @@ impl PackageStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Download from network if it doesn't exist yet.
|
// Download from network if it doesn't exist yet.
|
||||||
self.download_package(spec, &dir, progress)?;
|
if spec.namespace == "preview" {
|
||||||
if dir.exists() {
|
self.download_package(spec, &dir, progress)?;
|
||||||
return Ok(dir);
|
if dir.exists() {
|
||||||
|
return Ok(dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user