FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
diffpy.pdffit2/fix_setuptools_chmod.py at master · cfarrow/diffpy.pdffit2 · GitHub
cfarrow
diffpy.pdffit2
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
diffpy.pdffit2
/
fix_setuptools_chmod.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
64 lines (48 loc) · 1.65 KB
Breadcrumbs
diffpy.pdffit2
/
fix_setuptools_chmod.py
Copy path
File metadata and controls
64 lines (48 loc) · 1.65 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Quick and dirty trick to fix executable permissions spuriously
# set by setuptools.
__all__
=
[]
# version
__id__
=
"$Id$"
import
os
import
stat
import
setuptools
from
pkg_resources
import
parse_version
# adjusted from setuptools-0.6c8
try
:
from
os
import
chmod
as
_chmod
except
ImportError
:
# Jython compatibility
def
_chmod
(
*
args
):
pass
def
chmod
(
path
,
mode
):
from
distutils
import
log
log
.
debug
(
"changing mode of %s to %o"
,
path
,
mode
)
try
:
_chmod
(
path
,
mode
)
except
os
.
error
,
e
:
log
.
debug
(
"chmod failed: %s"
,
e
)
def
fixed_unpack_and_compile
(
self
,
egg_path
,
destination
):
from
setuptools
.
archive_util
import
unpack_archive
to_compile
=
[];
to_chmod
=
[]
def
pf
(
src
,
dst
):
if
dst
.
endswith
(
'.py'
)
and
not
src
.
startswith
(
'EGG-INFO/'
):
to_compile
.
append
(
dst
)
to_chmod
.
append
(
dst
)
elif
dst
.
endswith
(
'.dll'
)
or
dst
.
endswith
(
'.so'
):
to_chmod
.
append
(
dst
)
self
.
unpack_progress
(
src
,
dst
)
return
not
self
.
dry_run
and
dst
or
None
unpack_archive
(
egg_path
,
destination
,
pf
)
self
.
byte_compile
(
to_compile
)
if
not
self
.
dry_run
:
for
f
in
to_chmod
:
# mode = ((os.stat(f)[stat.ST_MODE]) | 0555) & 07755
mode
=
((
os
.
stat
(
f
)[
stat
.
ST_MODE
])
|
0444
)
&
07755
chmod
(
f
,
mode
)
to_compile
=
[];
to_chmod
=
[]
return
# Hack the easy_install class for versions compatible with
# fixed_unpack_and_compile.
if
parse_version
(
setuptools
.
__version__
)
<=
parse_version
(
'0.6c9'
):
from
setuptools
.
command
.
easy_install
import
easy_install
easy_install
.
unpack_and_compile
=
fixed_unpack_and_compile
# End of file
Back
|
FazBrowse Home
|
New Git URL