Merge lp:~raoul-snyman/brz/1818947-windows-fix into lp:brz/3.0

Proposed by Raoul Snyman on 2019-03-08
Status: Merged
Approved by: Jelmer Vernooij on 2019-03-09
Approved revision: 7306
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~raoul-snyman/brz/1818947-windows-fix
Merge into: lp:brz/3.0
Diff against target: 25 lines (+1/-9)
1 file modified
setup.py (+1/-9)
To merge this branch: bzr merge lp:~raoul-snyman/brz/1818947-windows-fix
Reviewer Review Type Date Requested Status
Jelmer Vernooij 2019-03-08 Approve on 2019-03-09
Review via email: mp+364182@code.launchpad.net

Commit message

Refactor some code in setup.py that was used when installing brz on Windows.

To post a comment you must log in.
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'setup.py'
--- setup.py 2019-03-04 10:39:09 +0000
+++ setup.py 2019-03-08 20:58:45 +0000
@@ -149,8 +149,7 @@
149 script_path = self._quoted_path(os.path.join(scripts_dir,149 script_path = self._quoted_path(os.path.join(scripts_dir,
150 "brz"))150 "brz"))
151 python_exe = self._quoted_path(sys.executable)151 python_exe = self._quoted_path(sys.executable)
152 args = self._win_batch_args()152 batch_str = "@%s %s %%*" % (python_exe, script_path)
153 batch_str = "@%s %s %s" % (python_exe, script_path, args)
154 batch_path = os.path.join(self.install_dir, "brz.bat")153 batch_path = os.path.join(self.install_dir, "brz.bat")
155 with open(batch_path, "w") as f:154 with open(batch_path, "w") as f:
156 f.write(batch_str)155 f.write(batch_str)
@@ -164,13 +163,6 @@
164 return '"' + path + '"'163 return '"' + path + '"'
165 else:164 else:
166 return path165 return path
167
168 def _win_batch_args(self):
169 from breezy.win32utils import winver
170 if winver == 'Windows NT':
171 return '%*'
172 else:
173 return '%1 %2 %3 %4 %5 %6 %7 %8 %9'
174#/class my_install_scripts166#/class my_install_scripts
175167
176168

Subscribers

People subscribed via source and target branches