Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Side by Side Diff: Lib/msilib/__init__.py

Issue 7639: bdist_msi fails on files with long names
Patch Set: Created 10 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- coding: iso-8859-1 -*- 1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2005 Martin v. Löwis 2 # Copyright (C) 2005 Martin v. Löwis
3 # Licensed to PSF under a Contributor Agreement. 3 # Licensed to PSF under a Contributor Agreement.
4 from _msi import * 4 from _msi import *
5 import os, string, re, sys 5 import os, string, re, sys
6 6
7 AMD64 = "AMD64" in sys.version 7 AMD64 = "AMD64" in sys.version
8 Itanium = "Itanium" in sys.version 8 Itanium = "Itanium" in sys.version
9 Win64 = AMD64 or Itanium 9 Win64 = AMD64 or Itanium
10 10
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 [(component, uuid, self.logical, flags, None, keyid)]) 281 [(component, uuid, self.logical, flags, None, keyid)])
282 if feature is None: 282 if feature is None:
283 feature = current_feature 283 feature = current_feature
284 add_data(self.db, "FeatureComponents", 284 add_data(self.db, "FeatureComponents",
285 [(feature.id, component)]) 285 [(feature.id, component)])
286 286
287 def make_short(self, file): 287 def make_short(self, file):
288 parts = file.split(".") 288 parts = file.split(".")
289 if len(parts)>1: 289 if len(parts)>1:
290 suffix = parts[-1].upper() 290 suffix = parts[-1].upper()
291 prefix = "".join(parts[:-1]).upper()
291 else: 292 else:
292 suffix = None 293 suffix = None
293 prefix = parts[0].upper() 294 prefix = file.upper()
294 if len(prefix) <= 8 and (not suffix or len(suffix)<=3): 295 file = None
296 if len(parts)<3 and len(prefix)<=8 and (not suffix or len(suffix)<=3):
295 if suffix: 297 if suffix:
296 file = prefix+"."+suffix 298 file = prefix+"."+suffix
297 else: 299 else:
298 file = prefix 300 file = prefix
299 assert file not in self.short_names 301 if file is None or file in self.short_names:
300 else:
301 prefix = prefix[:6] 302 prefix = prefix[:6]
302 if suffix: 303 if suffix:
303 suffix = suffix[:3] 304 suffix = suffix[:3]
304 pos = 1 305 pos = 1
305 while 1: 306 while 1:
306 if suffix: 307 if suffix:
307 file = "%s~%d.%s" % (prefix, pos, suffix) 308 file = "%s~%d.%s" % (prefix, pos, suffix)
308 else: 309 else:
309 file = "%s~%d" % (prefix, pos) 310 file = "%s~%d" % (prefix, pos)
310 if file not in self.short_names: break 311 if file not in self.short_names: break
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 return self.control(name, "PushButton", x, y, w, h, attr, None, text, ne xt, None) 459 return self.control(name, "PushButton", x, y, w, h, attr, None, text, ne xt, None)
459 460
460 def radiogroup(self, name, x, y, w, h, attr, prop, text, next): 461 def radiogroup(self, name, x, y, w, h, attr, prop, text, next):
461 add_data(self.db, "Control", 462 add_data(self.db, "Control",
462 [(self.name, name, "RadioButtonGroup", 463 [(self.name, name, "RadioButtonGroup",
463 x, y, w, h, attr, prop, text, next, None)]) 464 x, y, w, h, attr, prop, text, next, None)])
464 return RadioButtonGroup(self, name, prop) 465 return RadioButtonGroup(self, name, prop)
465 466
466 def checkbox(self, name, x, y, w, h, attr, prop, text, next): 467 def checkbox(self, name, x, y, w, h, attr, prop, text, next):
467 return self.control(name, "CheckBox", x, y, w, h, attr, prop, text, next , None) 468 return self.control(name, "CheckBox", x, y, w, h, attr, prop, text, next , None)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+