From 3d0067289593511029888d197ea099c050853a21 Mon Sep 17 00:00:00 2001 From: Mathew Gordon Date: Wed, 20 Nov 2024 00:58:16 -0700 Subject: [PATCH] Update squashfuse-zig, update some more profiles to new format --- profiles/environ_defaults.json | 15 +++ profiles/profile_database_new.json | 180 ++++++++++++++++++----------- zig/build.zig.zon | 8 +- zig/lib/AppImage.zig | 9 +- zig/src/main.zig | 7 +- 5 files changed, 135 insertions(+), 84 deletions(-) create mode 100644 profiles/environ_defaults.json diff --git a/profiles/environ_defaults.json b/profiles/environ_defaults.json new file mode 100644 index 0000000..1e3e946 --- /dev/null +++ b/profiles/environ_defaults.json @@ -0,0 +1,15 @@ +[ + { "XDG_CACHE_HOME": "${HOME}/.cache" }, + { "XDG_CONFIG_HOME": "${HOME}/.config" }, + { "XDG_DATA_HOME": "${HOME}/.local/share" }, + { "XDG_BIN_HOME": "${HOME}/.local/bin" }, + { "XDG_RUNTIME_DIR": "/run/user/${UID}" }, + { "XDG_MUSIC_DIR": "${HOME}/Music" }, + { "XDG_DESKTOP_DIR": "${HOME}/Desktop" }, + { "XDG_DOCUMENTS_DIR": "${HOME}/Documents" }, + { "XDG_DOWNLOAD_DIR": "${HOME}/Downloads" }, + { "XDG_PICTURES_DIR": "${HOME}/Pictures" }, + { "XDG_PUBLICSHARE_DIR": "${HOME}/Public" }, + { "XDG_TEMPLATES_DIR": "${HOME}/Templates" }, + { "XDG_VIDEOS_DIR": "${HOME}/Videos" } +] diff --git a/profiles/profile_database_new.json b/profiles/profile_database_new.json index 0ced3ac..ba644a9 100644 --- a/profiles/profile_database_new.json +++ b/profiles/profile_database_new.json @@ -421,10 +421,13 @@ { "names": [ "dust3d" ], "level": 2, - "filesystem": [ - "xdg-templates:rw", - "xdg-documents:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOCUMENTS_DIR}", + "${XDG_TEMPLATES_DIR}" + ] + }, "devices": [ "dri" ], @@ -436,16 +439,18 @@ { "names": [ "eagle mode" ], "level": 1, - "filesystem": [ - "xdg-documents:rw", - "xdg-publicshare:rw", - "xdg-templates:rw", - "xdg-desktop:rw", - "xdg-documents:rw", - "xdg-download:rw", - "xdg-music:rw", - "xdg-videos:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOCUMENTS_DIR}", + "${XDG_PUBLICSHARE_DIR}", + "${XDG_TEMPLATES_DIR}", + "${XDG_DESKTOP_DIR}", + "${XDG_DOWNLOAD_DIR}", + "${XDG_MUSIC_DIR}", + "${XDG_VIDEOS_DIR}" + ] + }, "devices": [ "dri" ], @@ -458,13 +463,16 @@ { "names": [ "edex-ui" ], "level": 2, - "filesystem": [ - "~/.config/nvim:ro", - "~/.profile:ro", - "~/.bashrc:ro", - "~/.zshrc:ro", - "~/.viminfo:ro" - ], + "filesystem": { + "read_only": [ + "${XDG_CONFIG_HOME}/nvim", + "${HOME}/.profile", + "${HOME}/.bashrc", + "${HOME}/.zshrc", + "${HOME}/.viminfo" + ], + "read_write": null + }, "devices": [ "dri" ], @@ -491,10 +499,13 @@ { "names": [ "endless sky" ], "level": 2, - "filesystem": [ - "xdg-templates:rw", - "xdg-documents:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOCUMENTS_DIR}", + "${XDG_TEMPLATES_DIR}" + ] + }, "devices": [ "dri" ], @@ -534,9 +545,12 @@ { "names": [ "firefox", "firefox beta", "firefox nightly" ], "level": 1, - "filesystem": [ - "xdg-download:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOWNLOAD_DIR}" + ] + }, "devices": [ "dri" ], @@ -551,10 +565,13 @@ { "names": [ "fontforge" ], "level": 2, - "filesystem": [ - "xdg-documents:rw", - "~/.fonts:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOCUMENTS_DIR}", + "${HOME}/.fonts" + ] + }, "devices": [ "dri" ], @@ -578,10 +595,13 @@ { "names": [ "freecad", "freecad conda", "freecad weekly" ], "level": 1, - "filesystem": [ - "xdg-documents:rw", - "xdg-templates:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOCUMENTS_DIR}", + "${XDG_TEMPLATES_DIR}" + ] + }, "devices": [ "dri" ], @@ -593,11 +613,13 @@ { "names": [ "gambatte_qt" ], "level": 2, - "filesystem": [ - "xdg-download:rw", - "~/Games:rw", - "~/Roms:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOWNLOAD_DIR}", + "${HOME}/Games" + ] + }, "devices": [ "dri", "input" @@ -611,9 +633,12 @@ { "names": [ "geometrize" ], "level": 2, - "filesystem": [ - "xdg-pictures:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_PICTURES_DIR}" + ] + }, "devices": [ "dri" ], @@ -625,9 +650,12 @@ { "names": [ "gnu image manipulation program" ], "level": 1, - "filesystem": [ - "xdg-pictures:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_PICTURES_DIR}" + ] + }, "devices": [ "dri" ], @@ -639,9 +667,12 @@ { "names": [ "go" ], "level": 3, - "filesystem": [ - "xdg-documents:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOCUMENTS_DIR}" + ] + }, "devices": null, "sockets": null, "data_dir": true @@ -649,9 +680,12 @@ { "names": [ "google chrome" ], "level": 2, - "filesystem": [ - "xdg-download:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOWNLOAD_DIR}" + ] + }, "devices": [ "dri" ], @@ -744,10 +778,13 @@ { "names": [ "imagemagick" ], "level": 3, - "filesystem": [ - "xdg-documents:rw", - "xdg-pictures:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOCUMENTS_DIR}", + "${XDG_PICTURES_DIR}" + ] + }, "devices": [ "dri" ], @@ -757,10 +794,13 @@ { "names": [ "inkscape" ], "level": 2, - "filesystem": [ - "xdg-documents:rw", - "xdg-pictures:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOCUMENTS_DIR}", + "${XDG_PICTURES_DIR}" + ] + }, "devices": [ "dri" ], @@ -784,9 +824,12 @@ { "names": [ "joplin" ], "level": 2, - "filesystem": [ - "xdg-documents:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_DOCUMENTS_DIR}" + ] + }, "devices": [ "dri" ], @@ -799,9 +842,12 @@ { "names": [ "krita" ], "level": 2, - "filesystem": [ - "xdg-pictures:rw" - ], + "filesystem": { + "read_only": null, + "read_write": [ + "${XDG_PICTURES_DIR}" + ] + }, "devices": [ "dri" ], diff --git a/zig/build.zig.zon b/zig/build.zig.zon index 114ba02..b758141 100644 --- a/zig/build.zig.zon +++ b/zig/build.zig.zon @@ -1,13 +1,13 @@ .{ .name = "aisap", - .version = "0.10.4-alpha", + .version = "0.10.5-alpha", .minimum_zig_version = "0.13.0", .dependencies = .{ .squashfuse = .{ - //.url = "https://github.com/mgord9518/squashfuse-zig/archive/refs/tags/continuous.tar.gz", - //.hash = "12201e377e845eea92744b4cca7ed590e3cddc84f0ba61bb4f2121a89fde594b80b2", - .path = "../../squashfuse-zig", + .url = "https://github.com/mgord9518/squashfuse-zig/archive/refs/tags/continuous.tar.gz", + .hash = "12209f8ff57fe423ca6f08c9701617a5169f7d721e4ca405aaa0b0b8e839511f3196", + //.path = "../../squashfuse-zig", }, }, diff --git a/zig/lib/AppImage.zig b/zig/lib/AppImage.zig index 971553c..f5841a3 100644 --- a/zig/lib/AppImage.zig +++ b/zig/lib/AppImage.zig @@ -39,8 +39,6 @@ pub fn open(allocator: std.mem.Allocator, file: std.fs.File) !AppImage { _ = try appimage.loadDesktopEntry(&buf); - std.debug.print("offset {d}\n", .{offset}); - return appimage; } @@ -61,12 +59,7 @@ fn loadDesktopEntry(appimage: *AppImage, buf: []u8) !usize { found = true; var file = try root.openFile(entry.name, .{}); - const read_len = try file.reader().readAll(buf); - - std.debug.print("entry {s} {s}\n", .{ - entry.name, - buf[0..read_len], - }); + _ = try file.reader().readAll(buf); } return 0; diff --git a/zig/src/main.zig b/zig/src/main.zig index 5514cea..1350ec3 100644 --- a/zig/src/main.zig +++ b/zig/src/main.zig @@ -9,9 +9,8 @@ pub fn main() !void { var args = std.process.args(); - const stdout_file = std.io.getStdOut().writer(); - var bw = std.io.bufferedWriter(stdout_file); - const stdout = bw.writer(); + const stdout_file = std.io.getStdOut(); + const stdout = stdout_file.writer(); _ = args.next(); @@ -34,6 +33,4 @@ pub fn main() !void { try stdout.print(" kind: {}\n", .{appimage.kind}); try stdout.print(" offset: {d}\n", .{appimage.sqfs.opts.offset}); // try stdout.print(" inode count: {d}\n", .{sqfs.super_block.inode_count}); - - try bw.flush(); }