Skip to content

Commit 723028d

Browse files
author
n3kosempai
committed
[fix] addrees of package
1 parent bf253cc commit 723028d

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

io.github.N3kosempai.klia-store.metainfo.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<binary>klia-store</binary>
3939
</provides>
4040
<releases>
41-
<release version="2.11.0" date="2026-08-02">
41+
<release version="2.11.1" date="2026-08-02">
4242
<description>
4343
<p>Backups have arrived. Pick any installed app, choose whether to include its data and runtime, and Klia Store packs everything into a single portable archive you can restore later — on this machine or a new one. No terminal commands, no guesswork.</p>
4444
<p>You can now support Klia Store directly from the app: after a successful install, an optional "watch an ad to support" button opens a short ad in your browser. It's entirely optional and takes a few seconds — a small way to help keep the project going if you feel like it.</p>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "klia-store",
33
"private": true,
4-
"version": "2.11.0",
4+
"version": "2.11.1",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/src/backup.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ fn home_dir() -> Result<PathBuf, String> {
6767
.map_err(|_| "HOME environment variable not set".to_string())
6868
}
6969

70+
/// Base directory for backup/restore staging. `std::env::temp_dir()` (`/tmp`)
71+
/// lives inside klia-store's own sandbox and is invisible to the `flatpak`
72+
/// process spawned on the host via `flatpak-spawn --host`, which makes
73+
/// `build-bundle`/`install` fail with `opendir: No such file or directory` on
74+
/// paths that are perfectly real from klia-store's point of view. `~/.var/app`
75+
/// is bind-mounted to the real host path by `--filesystem=~/.var/app:create`,
76+
/// so staging there keeps the directory visible on both sides.
77+
fn staging_base_dir() -> Result<PathBuf, String> {
78+
match std::env::var("FLATPAK_ID") {
79+
Ok(id) => Ok(home_dir()?.join(".var/app").join(id).join("cache")),
80+
Err(_) => Ok(std::env::temp_dir()),
81+
}
82+
}
83+
7084
#[derive(Serialize, Deserialize, Clone, Debug)]
7185
pub struct RuntimeRef {
7286
pub id: String,
@@ -639,7 +653,7 @@ pub async fn create_backup(
639653
let dest_root = PathBuf::from(&dest_dir);
640654
let session_id = chrono::Utc::now().format("%Y%m%d-%H%M%S").to_string();
641655

642-
let staging_root = std::env::temp_dir().join(format!("klia-store-backup-{}", session_id));
656+
let staging_root = staging_base_dir()?.join(format!("klia-store-backup-{}", session_id));
643657
let session_dir = staging_root.join(&session_id);
644658
fs::create_dir_all(&session_dir)
645659
.map_err(|e| format!("Failed to create staging directory: {}", e))?;
@@ -1004,7 +1018,7 @@ pub async fn restore_backup(
10041018
}
10051019

10061020
emit_progress("Extrayendo respaldo...");
1007-
let staging_root = std::env::temp_dir().join(format!(
1021+
let staging_root = staging_base_dir()?.join(format!(
10081022
"klia-store-restore-{}",
10091023
chrono::Utc::now().timestamp_millis()
10101024
));

0 commit comments

Comments
 (0)