]> granicus.if.org Git - python/commitdiff
Properly generate logical file ids. Fixes #1515998.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 6 Jul 2006 19:28:03 +0000 (19:28 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 6 Jul 2006 19:28:03 +0000 (19:28 +0000)
Also correct typo in Control.mapping.

Lib/msilib/__init__.py
Misc/NEWS

index 0881409e1d80b91b203bd9de4b0ff7dd948a7ffa..4be82b033d40440a1f418dd4ad7d388072b72597 100644 (file)
@@ -187,7 +187,7 @@ class CAB:
         self.filenames = sets.Set()
         self.index = 0
 
-    def gen_id(self, dir, file):
+    def gen_id(self, file):
         logical = _logical = make_id(file)
         pos = 1
         while logical in self.filenames:
@@ -196,9 +196,11 @@ class CAB:
         self.filenames.add(logical)
         return logical
 
-    def append(self, full, logical):
+    def append(self, full, file, logical):
         if os.path.isdir(full):
             return
+        if not logical:
+            logical = self.gen_id(file)
         self.index += 1
         self.files.append((full, logical))
         return self.index, logical
@@ -328,7 +330,7 @@ class Directory:
             logical = self.keyfiles[file]
         else:
             logical = None
-        sequence, logical = self.cab.append(absolute, logical)
+        sequence, logical = self.cab.append(absolute, file, logical)
         assert logical not in self.ids
         self.ids.add(logical)
         short = self.make_short(file)
@@ -403,7 +405,7 @@ class Control:
                  [(self.dlg.name, self.name, event, argument,
                    condition, ordering)])
 
-    def mapping(self, mapping, attribute):
+    def mapping(self, event, attribute):
         add_data(self.dlg.db, "EventMapping",
                  [(self.dlg.name, self.name, event, attribute)])
 
index 5e4004ef11a40f61e0f76fa2e47a927faa1dbf98..67c49a64ec474ba0abd48357c2660319183123f9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -25,6 +25,8 @@ Core and builtins
 Library
 -------
 
+- Bug #1515998: Properly generate logical ids for files in bdist_msi.
+
 - warnings.py now ignores ImportWarning by default
 
 - Patch #1517790: It is now possible to use custom objects in the ctypes