Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
61f996b2
Kaydet (Commit)
61f996b2
authored
Şub 21, 2012
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12406: prevent case where shortened name could conflict with short name.
üst
dc4170c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
msilib.py
Tools/msi/msilib.py
+10
-8
No files found.
Tools/msi/msilib.py
Dosyayı görüntüle @
61f996b2
...
@@ -408,7 +408,7 @@ class Directory:
...
@@ -408,7 +408,7 @@ class Directory:
self
.
physical
=
physical
self
.
physical
=
physical
self
.
logical
=
logical
self
.
logical
=
logical
self
.
component
=
None
self
.
component
=
None
self
.
short_names
=
sets
.
Set
()
self
.
short_names
=
{}
self
.
ids
=
sets
.
Set
()
self
.
ids
=
sets
.
Set
()
self
.
keyfiles
=
{}
self
.
keyfiles
=
{}
self
.
componentflags
=
componentflags
self
.
componentflags
=
componentflags
...
@@ -456,23 +456,25 @@ class Directory:
...
@@ -456,23 +456,25 @@ class Directory:
[(
feature
.
id
,
component
)])
[(
feature
.
id
,
component
)])
def
make_short
(
self
,
file
):
def
make_short
(
self
,
file
):
long
=
file
file
=
re
.
sub
(
r'[\?|><:/*"+,;=\[\]]'
,
'_'
,
file
)
# restrictions on short names
file
=
re
.
sub
(
r'[\?|><:/*"+,;=\[\]]'
,
'_'
,
file
)
# restrictions on short names
parts
=
file
.
split
(
"."
)
parts
=
file
.
split
(
"."
,
1
)
if
len
(
parts
)
>
1
:
if
len
(
parts
)
>
1
:
suffix
=
parts
[
-
1
]
.
upper
()
suffix
=
parts
[
1
]
.
upper
()
else
:
else
:
suffix
=
None
suffix
=
''
prefix
=
parts
[
0
]
.
upper
()
prefix
=
parts
[
0
]
.
upper
()
if
len
(
prefix
)
<=
8
and
(
not
suffix
or
len
(
suffix
)
<=
3
)
:
if
len
(
prefix
)
<=
8
and
'.'
not
in
suffix
and
len
(
suffix
)
<=
3
:
if
suffix
:
if
suffix
:
file
=
prefix
+
"."
+
suffix
file
=
prefix
+
"."
+
suffix
else
:
else
:
file
=
prefix
file
=
prefix
assert
file
not
in
self
.
short_names
assert
file
not
in
self
.
short_names
,
(
file
,
self
.
short_names
[
file
])
else
:
else
:
prefix
=
prefix
[:
6
]
prefix
=
prefix
[:
6
]
if
suffix
:
if
suffix
:
suffix
=
suffix
[:
3
]
# last three characters of last suffix
suffix
=
suffix
.
rsplit
(
'.'
)[
-
1
][:
3
]
pos
=
1
pos
=
1
while
1
:
while
1
:
if
suffix
:
if
suffix
:
...
@@ -484,7 +486,7 @@ class Directory:
...
@@ -484,7 +486,7 @@ class Directory:
assert
pos
<
10000
assert
pos
<
10000
if
pos
in
(
10
,
100
,
1000
):
if
pos
in
(
10
,
100
,
1000
):
prefix
=
prefix
[:
-
1
]
prefix
=
prefix
[:
-
1
]
self
.
short_names
.
add
(
file
)
self
.
short_names
[
file
]
=
long
return
file
return
file
def
add_file
(
self
,
file
,
src
=
None
,
version
=
None
,
language
=
None
):
def
add_file
(
self
,
file
,
src
=
None
,
version
=
None
,
language
=
None
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment