diff --git a/0001-Make-sure-Paths.bottles-exists.patch b/0001-Make-sure-Paths.bottles-exists.patch new file mode 100644 index 0000000..1507b65 --- /dev/null +++ b/0001-Make-sure-Paths.bottles-exists.patch @@ -0,0 +1,34 @@ +From f43e05d590e21634e05b5ff836c874237eddede1 Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Mon, 4 Mar 2024 20:28:49 +0100 +Subject: [PATCH 1/3] Make sure Paths.bottles exists + +When calling `bottles foo.exe` either from the command line or by +opening the executable from the file browser with Bottles, Bottles will +throw a FileNotFoundError if Paths.bottles does not exist. + +It seems check_app_dirs() is never called in that situation. +--- + bottles/backend/managers/manager.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/bottles/backend/managers/manager.py b/bottles/backend/managers/manager.py +index 8b04c30e..970df26d 100644 +--- a/bottles/backend/managers/manager.py ++++ b/bottles/backend/managers/manager.py +@@ -813,7 +813,11 @@ class Manager(metaclass=Singleton): + Check for local bottles and update the local_bottles list. + Will also mark the broken ones if the configuration file is missing + """ +- bottles = os.listdir(Paths.bottles) ++ try: ++ bottles = os.listdir(Paths.bottles) ++ except FileNotFoundError: ++ self.check_app_dirs() ++ bottles = [] + + # Empty local bottles + self.local_bottles = {} +-- +2.47.0 + diff --git a/0002-Catch-AttributeError-in-set_manager.patch b/0002-Catch-AttributeError-in-set_manager.patch new file mode 100644 index 0000000..34537a0 --- /dev/null +++ b/0002-Catch-AttributeError-in-set_manager.patch @@ -0,0 +1,33 @@ +From 202a3cd999e8685549aee4b9c206bdcfa003c82a Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Mon, 4 Mar 2024 21:45:51 +0100 +Subject: [PATCH 2/3] Catch AttributeError in set_manager() + +Return empty list if AttributeError is raised. +--- + bottles/frontend/windows/window.py | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/bottles/frontend/windows/window.py b/bottles/frontend/windows/window.py +index bddd3f34..c5cf2b37 100644 +--- a/bottles/frontend/windows/window.py ++++ b/bottles/frontend/windows/window.py +@@ -213,9 +213,12 @@ class BottlesWindow(Adw.ApplicationWindow): + def set_manager(result: Manager, error=None): + self.manager = result + +- tmp_runners = [ +- x for x in self.manager.runners_available if not x.startswith("sys-") +- ] ++ try: ++ tmp_runners = [ ++ x for x in self.manager.runners_available if not x.startswith("sys-") ++ ] ++ except AttributeError: ++ tmp_runners = [] + if len(tmp_runners) == 0: + self.show_onboard_view() + +-- +2.47.0 + diff --git a/0003-Catch-AttributeError-when-window-is-closed.patch b/0003-Catch-AttributeError-when-window-is-closed.patch new file mode 100644 index 0000000..2777d9e --- /dev/null +++ b/0003-Catch-AttributeError-when-window-is-closed.patch @@ -0,0 +1,33 @@ +From e2ce1892c557f1f81ba5883eee1d19a120abb2c2 Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Sat, 9 Nov 2024 13:42:00 +0100 +Subject: [PATCH 3/3] Catch AttributeError when window is closed + +In certain situations Bottles crashes with: + +__quit:AttributeError: 'Bottles' object has no attribute 'win' + +This should allow Bottles to exit without error. +--- + bottles/frontend/main.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/bottles/frontend/main.py b/bottles/frontend/main.py +index f6a07b15..ea3d7ad1 100644 +--- a/bottles/frontend/main.py ++++ b/bottles/frontend/main.py +@@ -267,7 +267,10 @@ class Bottles(Adw.Application): + logging.info( + _("[Quit] request received."), + ) +- self.win.on_close_request() ++ try: ++ self.win.on_close_request() ++ except AttributeError: ++ pass + quit() + + @staticmethod +-- +2.47.0 + diff --git a/1001-Revert-meson-Add-check-for-Flatpak.patch b/1001-Revert-meson-Add-check-for-Flatpak.patch new file mode 100644 index 0000000..7f1eb50 --- /dev/null +++ b/1001-Revert-meson-Add-check-for-Flatpak.patch @@ -0,0 +1,33 @@ +From 387213dd5c1179f1dbf8352ac389cbf8323a0d6f Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Sun, 8 Dec 2024 11:11:27 +0100 +Subject: [PATCH 1001/1005] Revert "meson: Add check for Flatpak" + +We still want to package Bottle as RPM for our users, despite upstream +having a very strong, almost hostile, preference for Flatpak. + +This reverts commit 6206301992c3218060761e5b574b83da485b759a. +--- + bottles/frontend/meson.build | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/bottles/frontend/meson.build b/bottles/frontend/meson.build +index 6ff7c011..c26ea0b9 100644 +--- a/bottles/frontend/meson.build ++++ b/bottles/frontend/meson.build +@@ -23,12 +23,6 @@ params_file = configure_file( + configuration: conf + ) + +-fs = import('fs') +- +-if not fs.is_file('/' + '.flatpak-info') +- error('file does not exist') +-endif +- + bottles_sources = [ + '__init__.py', + 'main.py', +-- +2.49.0 + diff --git a/1002-Change-issue-URL-to-Bugzilla.patch b/1002-Change-issue-URL-to-Bugzilla.patch new file mode 100644 index 0000000..9806185 --- /dev/null +++ b/1002-Change-issue-URL-to-Bugzilla.patch @@ -0,0 +1,27 @@ +From bd5ebc6dc6ae529c933ae2655b27f9ee04a1dc44 Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Sun, 8 Dec 2024 11:22:42 +0100 +Subject: [PATCH 1002/1005] Change issue URL to Bugzilla + +Since upstream does not whish to receive bug reports from non-Flatpak +users, direct them to Bugzilla instead. +--- + data/com.usebottles.bottles.metainfo.xml.in.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/data/com.usebottles.bottles.metainfo.xml.in.in b/data/com.usebottles.bottles.metainfo.xml.in.in +index 52f33b91..d4c1e49d 100644 +--- a/data/com.usebottles.bottles.metainfo.xml.in.in ++++ b/data/com.usebottles.bottles.metainfo.xml.in.in +@@ -70,7 +70,7 @@ + @APP_ID@ + + https://usebottles.com +- https://github.com/bottlesdevs/Bottles/issues ++ https://bugz.fedoraproject.org/bottles + https://docs.usebottles.com + https://usebottles.com/funding + https://hosted.weblate.org/engage/bottles +-- +2.49.0 + diff --git a/1003-Display-warning-regarding-issue-tracker.patch b/1003-Display-warning-regarding-issue-tracker.patch new file mode 100644 index 0000000..eb29c08 --- /dev/null +++ b/1003-Display-warning-regarding-issue-tracker.patch @@ -0,0 +1,58 @@ +From 946114f3aba1913d4cd9c9498a35cee2da1d0cf0 Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Sun, 8 Dec 2024 12:21:57 +0100 +Subject: [PATCH 1003/1005] Display warning regarding issue tracker + +Make sure users know where to report bugs regarding the RPM package of +Bottles. Revert upstream's outright denial of usage. +--- + bottles/frontend/windows/window.py | 23 ++++++++++------------- + 1 file changed, 10 insertions(+), 13 deletions(-) + +diff --git a/bottles/frontend/windows/window.py b/bottles/frontend/windows/window.py +index 802b08b5..d31d0cf7 100644 +--- a/bottles/frontend/windows/window.py ++++ b/bottles/frontend/windows/window.py +@@ -102,29 +102,26 @@ class BottlesWindow(Adw.ApplicationWindow): + + def response(dialog, response, *args): + if response == "close": +- quit(1) ++ return + + body = _( +- "Bottles is only supported within a sandboxed environment. Official sources of Bottles are available at" ++ "Bottles developers (upstream) only support Flatpak. Please report any issues with the RPM package in" + ) +- download_url = "usebottles.com/download" ++ bug_url = "bugz.fedoraproject.org/bottles" + + error_dialog = Adw.AlertDialog.new( +- _("Unsupported Environment"), +- f"{body} {download_url}.", ++ _("RPM Package Note"), ++ f"{body} Bugzilla." + ) + +- error_dialog.add_response("close", _("Close")) ++ error_dialog.add_response("close", _("Understood")) + error_dialog.set_body_use_markup(True) + error_dialog.connect("response", response) + error_dialog.present(self) +- logging.error( +- _( +- "Bottles is only supported within a sandboxed format. Official sources of Bottles are available at:" +- ) +- ) +- logging.error("https://usebottles.com/download/") +- return ++ logging.warn(_("Bottles is only supported within a sandboxed environment. Official sources of Bottles are available at:")) ++ logging.warn("https://usebottles.com/download/") ++ logging.warn(_("Please report any issues using the RPM package to:")) ++ logging.warn("https://bugz.fedoraproject.org/bottles") + + # Loading view + self.page_loading = LoadingView() +-- +2.49.0 + diff --git a/1004-Do-not-require-Xdp.patch b/1004-Do-not-require-Xdp.patch new file mode 100644 index 0000000..806637c --- /dev/null +++ b/1004-Do-not-require-Xdp.patch @@ -0,0 +1,195 @@ +From e1c62b61b00b89d0ce39c68cf62556fa38ddc1a3 Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Wed, 8 Jan 2025 09:44:32 +0100 +Subject: [PATCH 1004/1005] Do not require Xdp + +This is used for Flatpak introspection. No need to depend on Xdp in the +RPM package. We will never run in a sandboxed environment. +--- + bottles/frontend/main.py | 1 - + bottles/frontend/views/bottle_details.py | 16 +------- + bottles/frontend/views/bottle_preferences.py | 4 +- + bottles/frontend/views/list.py | 5 +-- + bottles/frontend/views/new_bottle_dialog.py | 4 +- + bottles/frontend/windows/window.py | 42 ++++++++++---------- + 6 files changed, 27 insertions(+), 45 deletions(-) + +diff --git a/bottles/frontend/main.py b/bottles/frontend/main.py +index f6a07b15..5bbf548c 100644 +--- a/bottles/frontend/main.py ++++ b/bottles/frontend/main.py +@@ -34,7 +34,6 @@ from bottles.frontend.params import ( + gi.require_version("Gtk", "4.0") + gi.require_version("Adw", "1") + gi.require_version("GtkSource", "5") +-gi.require_version("Xdp", "1.0") + # gi.require_version("XdpGtk4", "1.0") + + # ruff: noqa: E402 +diff --git a/bottles/frontend/views/bottle_details.py b/bottles/frontend/views/bottle_details.py +index 65667ea9..ebf7079a 100644 +--- a/bottles/frontend/views/bottle_details.py ++++ b/bottles/frontend/views/bottle_details.py +@@ -21,7 +21,7 @@ from datetime import datetime + from gettext import gettext as _ + from typing import List, Optional + +-from gi.repository import Gtk, Gio, Adw, Gdk, GLib, Xdp ++from gi.repository import Gtk, Gio, Adw, Gdk, GLib + + from bottles.backend.managers.backup import BackupManager + from bottles.backend.models.config import BottleConfig +@@ -437,19 +437,7 @@ class BottleView(Adw.PreferencesPage): + dialog.show() + + if Xdp.Portal.running_under_sandbox(): +- if self.window.settings.get_boolean("show-sandbox-warning"): +- dialog = Adw.MessageDialog.new( +- self.window, +- _("Be Aware of Sandbox"), +- _( +- "Bottles is running in a sandbox, a restricted permission environment needed to keep you safe. If the program won't run, consider moving inside the bottle (3 dots icon on the top), then launch from there." +- ), +- ) +- dialog.add_response("dismiss", _("_Dismiss")) +- dialog.connect("response", show_chooser) +- dialog.present() +- else: +- show_chooser() ++ show_chooser() + + def __backup(self, widget, backup_type): + """ +diff --git a/bottles/frontend/views/bottle_preferences.py b/bottles/frontend/views/bottle_preferences.py +index 288e693b..4e989fb2 100644 +--- a/bottles/frontend/views/bottle_preferences.py ++++ b/bottles/frontend/views/bottle_preferences.py +@@ -20,7 +20,7 @@ import os + import re + from gettext import gettext as _ + +-from gi.repository import Gtk, Adw, Xdp ++from gi.repository import Gtk, Adw + + from bottles.backend.globals import ( + gamemode_available, +@@ -139,7 +139,7 @@ class PreferencesView(Adw.PreferencesPage): + self.queue = details.queue + self.details = details + +- if not gamemode_available or not Xdp.Portal.running_under_sandbox(): ++ if not gamemode_available: + return + + _not_available = _("This feature is unavailable on your system.") +diff --git a/bottles/frontend/views/list.py b/bottles/frontend/views/list.py +index 43ab9c22..a8f6c587 100644 +--- a/bottles/frontend/views/list.py ++++ b/bottles/frontend/views/list.py +@@ -18,7 +18,7 @@ + from datetime import datetime + from gettext import gettext as _ + +-from gi.repository import Gtk, GLib, Adw, Xdp ++from gi.repository import Gtk, GLib, Adw + + from bottles.backend.models.config import BottleConfig + from bottles.backend.models.result import Result +@@ -82,9 +82,6 @@ class BottlesBottleRow(Adw.ActionRow): + + def run_executable(self, *_args): + """Display file dialog for executable""" +- if not Xdp.Portal.running_under_sandbox(): +- return +- + def set_path(_dialog, response): + if response != Gtk.ResponseType.ACCEPT: + return +diff --git a/bottles/frontend/views/new_bottle_dialog.py b/bottles/frontend/views/new_bottle_dialog.py +index a8b007d4..81fa102e 100644 +--- a/bottles/frontend/views/new_bottle_dialog.py ++++ b/bottles/frontend/views/new_bottle_dialog.py +@@ -17,7 +17,7 @@ + + from gettext import gettext as _ + from typing import Any, Optional +-from gi.repository import Gtk, Adw, Pango, Gio, Xdp, GObject, GLib ++from gi.repository import Gtk, Adw, Pango, Gio, GObject, GLib + + from bottles.backend.models.config import BottleConfig + from bottles.backend.utils.threading import RunAsync +@@ -80,7 +80,7 @@ class BottlesNewBottleDialog(Adw.Dialog): + super().__init__(**kwargs) + # common variables and references + self.window = GtkUtils.get_parent_window() +- if not self.window or not Xdp.Portal.running_under_sandbox(): ++ if not self.window: + return + + self.app = self.window.get_application() +diff --git a/bottles/frontend/windows/window.py b/bottles/frontend/windows/window.py +index d31d0cf7..c8adde1c 100644 +--- a/bottles/frontend/windows/window.py ++++ b/bottles/frontend/windows/window.py +@@ -21,7 +21,7 @@ import webbrowser + from gettext import gettext as _ + from typing import Optional + +-from gi.repository import Gtk, GLib, Gio, Adw, GObject, Gdk, Xdp ++from gi.repository import Gtk, GLib, Gio, Adw, GObject, Gdk + + from bottles.backend.globals import Paths + from bottles.backend.health import HealthChecker +@@ -98,30 +98,28 @@ class BottlesWindow(Adw.ApplicationWindow): + manager.set_color_scheme(Adw.ColorScheme.FORCE_DARK) + + # Be VERY explicit that non-sandboxed environments are unsupported +- if not Xdp.Portal.running_under_sandbox(): ++ def response(dialog, response, *args): ++ if response == "close": ++ return + +- def response(dialog, response, *args): +- if response == "close": +- return +- +- body = _( +- "Bottles developers (upstream) only support Flatpak. Please report any issues with the RPM package in" +- ) +- bug_url = "bugz.fedoraproject.org/bottles" ++ body = _( ++ "Bottles developers (upstream) only support Flatpak. Please report any issues with the RPM package in" ++ ) ++ bug_url = "bugz.fedoraproject.org/bottles" + +- error_dialog = Adw.AlertDialog.new( +- _("RPM Package Note"), +- f"{body} Bugzilla." +- ) ++ error_dialog = Adw.AlertDialog.new( ++ _("RPM Package Note"), ++ f"{body} Bugzilla." ++ ) + +- error_dialog.add_response("close", _("Understood")) +- error_dialog.set_body_use_markup(True) +- error_dialog.connect("response", response) +- error_dialog.present(self) +- logging.warn(_("Bottles is only supported within a sandboxed environment. Official sources of Bottles are available at:")) +- logging.warn("https://usebottles.com/download/") +- logging.warn(_("Please report any issues using the RPM package to:")) +- logging.warn("https://bugz.fedoraproject.org/bottles") ++ error_dialog.add_response("close", _("Understood")) ++ error_dialog.set_body_use_markup(True) ++ error_dialog.connect("response", response) ++ error_dialog.present(self) ++ logging.warn(_("Bottles is only supported within a sandboxed environment. Official sources of Bottles are available at:")) ++ logging.warn("https://usebottles.com/download/") ++ logging.warn(_("Please report any issues using the RPM package to:")) ++ logging.warn("https://bugz.fedoraproject.org/bottles") + + # Loading view + self.page_loading = LoadingView() +-- +2.49.0 + diff --git a/1005-Revert-bottle-row-Port-to-AdwWrapBox.patch b/1005-Revert-bottle-row-Port-to-AdwWrapBox.patch new file mode 100644 index 0000000..00e97f8 --- /dev/null +++ b/1005-Revert-bottle-row-Port-to-AdwWrapBox.patch @@ -0,0 +1,68 @@ +From 4c4f5f2274bfe174e82d7c68627fb6c95b04fd8b Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Wed, 15 Jan 2025 20:59:47 +0100 +Subject: [PATCH 1005/1005] Revert "bottle-row: Port to AdwWrapBox" + +AdwWrapBox is still deemed unstable and only available since 1.7. + +This reverts commit eb81c0306ef20aa5e4c0104a0a6d55779996b027. +--- + bottles/frontend/ui/bottle-row.blp | 16 ++++++++++------ + bottles/frontend/views/list.py | 6 +++--- + 2 files changed, 13 insertions(+), 9 deletions(-) + +diff --git a/bottles/frontend/ui/bottle-row.blp b/bottles/frontend/ui/bottle-row.blp +index 163900ea..2598ed52 100644 +--- a/bottles/frontend/ui/bottle-row.blp ++++ b/bottles/frontend/ui/bottle-row.blp +@@ -5,13 +5,17 @@ template $BottlesBottleRow: Adw.ActionRow { + activatable: true; + use-markup: false; + +- Adw.WrapBox wrap_box { +- valign: center; ++ Box { ++ spacing: 6; + +- styles [ +- "tag", +- "caption", +- ] ++ Label label_env { ++ valign: center; ++ ++ styles [ ++ "tag", ++ "caption", ++ ] ++ } + } + + Button button_run { +diff --git a/bottles/frontend/views/list.py b/bottles/frontend/views/list.py +index a8f6c587..91a52e2b 100644 +--- a/bottles/frontend/views/list.py ++++ b/bottles/frontend/views/list.py +@@ -37,7 +37,7 @@ class BottlesBottleRow(Adw.ActionRow): + + # region Widgets + button_run = Gtk.Template.Child() +- wrap_box = Gtk.Template.Child() ++ label_env = Gtk.Template.Child() + + # endregion + +@@ -74,8 +74,8 @@ class BottlesBottleRow(Adw.ActionRow): + self.set_title(self.config.Name) + if self.window.settings.get_boolean("update-date"): + self.set_subtitle(update_date) +- +- self.wrap_box.append(Gtk.Label.new(self.config.Environment)) ++ self.label_env.set_text(_(self.config.Environment)) ++ self.label_env.add_css_class("tag-%s" % self.config.Environment.lower()) + + # Set tooltip text + self.button_run.set_tooltip_text(_(f"Run executable in “{self.config.Name}”")) +-- +2.49.0 + diff --git a/README.packit b/README.packit index f592284..f5cc99f 100644 --- a/README.packit +++ b/README.packit @@ -1,3 +1,3 @@ This repository is maintained by packit. https://packit.dev/ -The file was generated using packit 0.91.0.post1.dev4+ge6fd4a25. +The file was generated using packit 1.2.0.post1.dev13+g55ed4527. diff --git a/bottles.spec b/bottles.spec index 63c38f3..f5edbfb 100644 --- a/bottles.spec +++ b/bottles.spec @@ -1,11 +1,10 @@ -%global forgeurl https://github.com/bottlesdevs/Bottles - Name: bottles Epoch: 1 -Version: 51.11 +Version: 51.21 Release: %autorelease Summary: Run Windows in a Bottle +%global forgeurl https://github.com/bottlesdevs/Bottles %global tag %{version} %forgemeta @@ -16,13 +15,22 @@ License: GPL-3.0-or-later AND MIT URL: %{forgeurl} Source0: %{forgesource} # Make sure bottles dir exists when opening executable directly -Patch: ensure_bottles_dir_exists.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2249922 +# https://bugzilla.redhat.com/show_bug.cgi?id=2257180 +Patch: 0001-Make-sure-Paths.bottles-exists.patch # Don't fail on AttributeError -Patch: catch_exception_in_set_manager.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2260135 +Patch: 0002-Catch-AttributeError-in-set_manager.patch +# Catch AttributeError when closing window +# https://bugzilla.redhat.com/show_bug.cgi?id=2313567 +Patch: 0003-Catch-AttributeError-when-window-is-closed.patch +# Downstream only patches counteracting upstream's enforcement of Flatpak +Patch: 1001-Revert-meson-Add-check-for-Flatpak.patch +Patch: 1002-Change-issue-URL-to-Bugzilla.patch +Patch: 1003-Display-warning-regarding-issue-tracker.patch +Patch: 1004-Do-not-require-Xdp.patch +Patch: 1005-Revert-bottle-row-Port-to-AdwWrapBox.patch -# blueprint-compiler does not work on s390x: -# https://gitlab.gnome.org/jwestman/blueprint-compiler/-/issues/96 -ExcludeArch: s390x BuildArch: noarch BuildRequires: desktop-file-utils @@ -69,6 +77,21 @@ Requires: python3dist(pefile) # Requirements not listed in upstream's `requirements.txt` Requires: python3dist(vkbasalt-cli) +# Optional dependencies which may be required for running 32-bit bottles. +# We recommend those in order to allow users to opt out. +Recommends: freetype.i686 +Recommends: mesa-dri-drivers.i686 +Recommends: mesa-filesystem.i686 +Recommends: mesa-libEGL.i686 +Recommends: mesa-libgbm.i686 +Recommends: mesa-libglapi.i686 +Recommends: mesa-libGL.i686 +Recommends: mesa-libGLU.i686 +Recommends: mesa-va-drivers.i686 +Recommends: mesa-vulkan-drivers.i686 +Recommends: SDL2.i686 +Recommends: vulkan-loader.i686 + %description Bottles lets you run Windows software on Linux, such as applications and games. It introduces a workflow that helps you organize by @@ -89,6 +112,9 @@ Features: %prep %forgeautosetup -p1 +# F40 only has meson 1.4.1. Lower requirement. +sed -r -i 's/(meson_version.*)1\.[0-9]\.[0-9]/\11.4.1/' meson.build + %build %meson diff --git a/catch_exception_in_set_manager.patch b/catch_exception_in_set_manager.patch deleted file mode 100644 index 08c1794..0000000 --- a/catch_exception_in_set_manager.patch +++ /dev/null @@ -1,28 +0,0 @@ -commit 3e1db3c75fee5eedb2190e7dba71239e923affb7 -Author: Sandro -Date: Mon Mar 4 21:45:51 2024 +0100 - - Catch AttributeError in set_manager() - - Return empty list if AttributeError is raised. - -diff --git a/bottles/frontend/windows/main_window.py b/bottles/frontend/windows/main_window.py -index 5fb9a15c..cd26408b 100644 ---- a/bottles/frontend/windows/main_window.py -+++ b/bottles/frontend/windows/main_window.py -@@ -178,9 +178,12 @@ class MainWindow(Adw.ApplicationWindow): - def set_manager(result: Manager, error=None): - self.manager = result - -- tmp_runners = [ -- x for x in self.manager.runners_available if not x.startswith("sys-") -- ] -+ try: -+ tmp_runners = [ -+ x for x in self.manager.runners_available if not x.startswith("sys-") -+ ] -+ except AttributeError: -+ tmp_runners = [] - if len(tmp_runners) == 0: - self.show_onboard_view() - diff --git a/ensure_bottles_dir_exists.patch b/ensure_bottles_dir_exists.patch deleted file mode 100644 index 12ac255..0000000 --- a/ensure_bottles_dir_exists.patch +++ /dev/null @@ -1,29 +0,0 @@ -commit 7eed7bbfa5d1da924b4c4e0659f0bf86b0fd7d7b -Author: Sandro -Date: Mon Mar 4 20:28:49 2024 +0100 - - Make sure Paths.bottles exists - - When calling `bottles foo.exe` either from the command line or by - opening the executable from the file browser with Bottles, Bottles will - throw a FileNotFoundError if Paths.bottles does not exist. - - It seems check_app_dirs() is never called in that situation. - -diff --git a/bottles/backend/managers/manager.py b/bottles/backend/managers/manager.py -index 01b0039e..9d8ef000 100644 ---- a/bottles/backend/managers/manager.py -+++ b/bottles/backend/managers/manager.py -@@ -811,7 +811,11 @@ class Manager(metaclass=Singleton): - Check for local bottles and update the local_bottles list. - Will also mark the broken ones if the configuration file is missing - """ -- bottles = os.listdir(Paths.bottles) -+ try: -+ bottles = os.listdir(Paths.bottles) -+ except FileNotFoundError: -+ self.check_app_dirs() -+ bottles = [] - - # Empty local bottles - self.local_bottles = {} diff --git a/sources b/sources index 8baf231..cd90561 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Bottles-51.11.tar.gz) = 42c503a4910a8e6c408caecd723edf1405aa034558d61313937a69c7d5ffb20ba4675fc9022775491cbbe6ba4a35ffac508b4721f9c971c57cbcb888345d546b +SHA512 (Bottles-51.21.tar.gz) = cfeea2b3ce46305638d2ad7b0778b8a821793e476fc220040469da51b6454547a5189de93d05c7c0bf1d4ec58fabd8a491ab75dd226510e50637ad00c170414a