Changeset 4a26b1204839743e2d7d6eda1cebec0548655602
- Timestamp:
- 11/13/08 01:44:11 (2 months ago)
- Author:
- njs@…
- Branch:
- org.vorpus.parti
- Parent:
- d1f9fd273d45a48775411b0499141f17f24b793d
- Message:
-
Correctly save the working dir in run-xpra.sh (thanks to Paul Marks for the catch)
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r3503..
|
r4a26..
|
|
| | 1 | |
| 1 | 2 | # DO NOT IMPORT GTK HERE: see http://partiwm.org/ticket/34 |
| 2 | 3 | # (also do not import anything that imports gtk) |
| … |
… |
|
| 89 | 90 | return "\"%s\"" % ("".join(quoted_chars),) |
| 90 | 91 | |
| 91 | | def xpra_runner_shell_script(xpra_file): |
| | 92 | def xpra_runner_shell_script(xpra_file, starting_dir): |
| 92 | 93 | script = [] |
| 93 | 94 | script.append("#!/bin/sh\n") |
| … |
… |
|
| 103 | 104 | # We ignore failures in cd'ing, b/c it's entirely possible that we were |
| 104 | 105 | # started from some temporary directory and all paths are absolute. |
| 105 | | script.append("cd %s\n" % sh_quotemeta(os.getcwd())) |
| | 106 | script.append("cd %s\n" % sh_quotemeta(starting_dir)) |
| 106 | 107 | script.append("_XPRA_PYTHON=%s\n" % (sh_quotemeta(sys.executable),)) |
| 107 | 108 | script.append("_XPRA_SCRIPT=%s\n" % (sh_quotemeta(xpra_file),)) |
| … |
… |
|
| 148 | 149 | # than expected. |
| 149 | 150 | scriptpath = os.path.join(sockdir.dir(), "run-xpra") |
| | 151 | |
| | 152 | # Save the starting dir now, because we'll lose track of it when we |
| | 153 | # daemonize: |
| | 154 | starting_dir = os.getcwd() |
| 150 | 155 | |
| 151 | 156 | # Daemonize: |
| … |
… |
|
| 188 | 193 | # Write out a shell-script so that we can start our proxy in a clean |
| 189 | 194 | # environment: |
| 190 | | open(scriptpath, "w").write(xpra_runner_shell_script(xpra_file)) |
| | 195 | open(scriptpath, "w").write(xpra_runner_shell_script(xpra_file, |
| | 196 | starting_dir)) |
| 191 | 197 | # Unix is a little silly sometimes: |
| 192 | 198 | umask = os.umask(0) |