File: 0001-Interactively-ask-for-file-path-on-update.patch

package info (click to toggle)
usbmuxctl 0.1.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 232 kB
  • sloc: python: 887; makefile: 47; xml: 23
file content (28 lines) | stat: -rw-r--r-- 950 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Bastian Germann <bage@debian.org>
Date: Fri, 25 Apr 2025 11:15:37 +0200
Subject: Interactively ask for file path on update

The firmware file is excluded in Debian and not expected to be available,
so ask for the file path.

Signed-off-by: Bastian Germann <bage@debian.org>
---
 usbmuxctl/usbmuxctl.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/usbmuxctl/usbmuxctl.py b/usbmuxctl/usbmuxctl.py
index fc32cfe..8af5c89 100644
--- a/usbmuxctl/usbmuxctl.py
+++ b/usbmuxctl/usbmuxctl.py
@@ -370,6 +370,10 @@ class Mux:
 
         dfu = DFU(path=usb_path)
 
-        dfu_util_flash_firmware(version.FIRMWARE_FILE, dfu.get_path())
+        firmware_file = version.FIRMWARE_FILE
+        import os.path
+        if not os.path.isfile(firmware_file):
+            firmware_file = input("Please enter the firmware file path: ")
+        dfu_util_flash_firmware(firmware_file, dfu.get_path())
 
         dfu.enter_user_code()