File: 0001-Use-the-temporary-directory-instead-of-the-home-dire.patch

package info (click to toggle)
openshot-qt 3.1.1%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 166,304 kB
  • sloc: python: 475,634; javascript: 34,891; xml: 3,397; makefile: 218; sh: 156
file content (27 lines) | stat: -rw-r--r-- 939 bytes parent folder | download | duplicates (2)
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
From: "Dr. Tobias Quathamer" <toddy@debian.org>
Date: Sat, 5 Mar 2022 16:21:40 +0100
Subject: Use the temporary directory instead of the home directory for
 package building

---
 src/classes/info.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/classes/info.py b/src/classes/info.py
index 3c837a6..847f5fe 100644
--- a/src/classes/info.py
+++ b/src/classes/info.py
@@ -49,6 +49,13 @@ EXPORT_PRESETS_PATH = os.path.join(PATH, "presets")
 
 # User paths
 HOME_PATH = os.path.join(os.path.expanduser("~"))
+# If the home directory does not exist, use the
+# temporay directory. This is needed during the
+# package build, otherwise the sphinx docs cannot
+# be built.
+if not os.path.exists(HOME_PATH.encode("UTF-8")):
+    import tempfile
+    HOME_PATH = tempfile.gettempdir()
 USER_PATH = os.path.join(HOME_PATH, ".openshot_qt")
 BACKUP_PATH = os.path.join(USER_PATH)
 RECOVERY_PATH = os.path.join(USER_PATH, "recovery")