mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-10 22:38:44 +02:00
fix(updater): don't fail AppImage installs when the temp dir is another mount of the same file system (#3688)
* fix(updater): skip a backup location the AppImage cannot be renamed into Two mounts of one file system share st_dev, so install_appimage could pick a bind-mounted or private temp dir and then fail every install with EXDEV. Move on to the next location instead; the last one is the AppImage's own directory. * Apply suggestion from @lucasfernog --------- Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
This commit is contained in:
1 parent
fce235c3fb
commit
b6f39cc51c
2 files changed
+11
-1
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
updater: patch
|
||||||
|
updater-js: patch
|
||||||
|
---
|
||||||
|
|
||||||
|
On Linux, installing an AppImage update no longer fails with `Invalid cross-device link (os error 18)` when the temp or cache directory is a separate mount of the AppImage's file system, such as a bind-mounted or private `/tmp`. The backup now moves on to the next location, ending with the AppImage's own directory.
|
||||||
@@ -1234,7 +1234,11 @@ impl Update {
|
|||||||
let permissions = std::fs::metadata(&self.extract_path)?.permissions();
|
let permissions = std::fs::metadata(&self.extract_path)?.permissions();
|
||||||
|
|
||||||
// create a backup of our current app image
|
// create a backup of our current app image
|
||||||
std::fs::rename(&self.extract_path, tmp_app_image)?;
|
match std::fs::rename(&self.extract_path, tmp_app_image) {
|
||||||
|
Ok(()) => {}
|
||||||
|
Err(err) if err.kind() == std::io::ErrorKind::CrossesDevices => continue,
|
||||||
|
Err(err) => return Err(err.into()),
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "zip")]
|
#[cfg(feature = "zip")]
|
||||||
if infer::archive::is_gz(bytes) {
|
if infer::archive::is_gz(bytes) {
|
||||||
|
|||||||
Reference in new issue
Block a user