summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Muetschard <pmuetschard@google.com>2015-10-22 13:26:36 -0700
committerPascal Muetschard <pmuetschard@google.com>2015-10-22 13:28:20 -0700
commitc2a64ddffd397f28c1187da1cc07f29825b7d0fb (patch)
tree4232181bf284748fa1934cda2ae15e39d9e7bdcf
parent745b4ad660f8050045b521c4e15b7d3ac0b3d70e (diff)
downloadgit-repo-c2a64ddffd397f28c1187da1cc07f29825b7d0fb.tar.gz
A couple of fixes to the init command's -p option.
Adds windows as one of the allowed platforms flags. Fixes -p foo to append 'platform-foo', instead of each letter (list.extend expects a list and thus appends each char in the string, rather than the string itself). Change-Id: I73a92127ac29a32fc31b335cc54a246302904140
-rw-r--r--subcmds/init.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/subcmds/init.py b/subcmds/init.py
index dbb6ddda..b8e3de5a 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -179,7 +179,7 @@ to update the working directory files.
179 r.Save() 179 r.Save()
180 180
181 groups = re.split(r'[,\s]+', opt.groups) 181 groups = re.split(r'[,\s]+', opt.groups)
182 all_platforms = ['linux', 'darwin'] 182 all_platforms = ['linux', 'darwin', 'windows']
183 platformize = lambda x: 'platform-' + x 183 platformize = lambda x: 'platform-' + x
184 if opt.platform == 'auto': 184 if opt.platform == 'auto':
185 if (not opt.mirror and 185 if (not opt.mirror and
@@ -188,7 +188,7 @@ to update the working directory files.
188 elif opt.platform == 'all': 188 elif opt.platform == 'all':
189 groups.extend(map(platformize, all_platforms)) 189 groups.extend(map(platformize, all_platforms))
190 elif opt.platform in all_platforms: 190 elif opt.platform in all_platforms:
191 groups.extend(platformize(opt.platform)) 191 groups.append(platformize(opt.platform))
192 elif opt.platform != 'none': 192 elif opt.platform != 'none':
193 print('fatal: invalid platform flag', file=sys.stderr) 193 print('fatal: invalid platform flag', file=sys.stderr)
194 sys.exit(1) 194 sys.exit(1)