Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
84acb0c4
Commit
84acb0c4
authored
Mar 16, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove fetch_libevent.py
parent
4fa1733d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
65 deletions
+0
-65
fetch_libevent.py
fetch_libevent.py
+0
-65
No files found.
fetch_libevent.py
deleted
100755 → 0
View file @
4fa1733d
#! /usr/bin/env python
"""download and extract the libevent source archive
"""
import
sys
import
os
import
urllib
import
tarfile
import
StringIO
import
tempfile
import
shutil
import
copy
try
:
from
hashlib
import
md5
except
ImportError
:
from
md5
import
md5
# python 2.4's tarfile doesn't have extractall.
def
extractall
(
self
,
path
=
"."
):
for
tarinfo
in
self
:
if
tarinfo
.
isdir
():
# Extract directories with a safe mode.
tarinfo
=
copy
.
copy
(
tarinfo
)
tarinfo
.
mode
=
0700
self
.
extract
(
tarinfo
,
path
)
def
download_and_extract
(
url
,
digest
):
assert
url
.
endswith
(
".tar.gz"
),
"can only download .tar.gz files"
dst
=
os
.
path
.
abspath
(
"libevent-src"
)
if
os
.
path
.
exists
(
dst
):
sys
.
exit
(
"Error: path %s already exists"
%
dst
)
tmpdir
=
tempfile
.
mkdtemp
(
prefix
=
"tmp-libevent-src"
,
dir
=
"."
)
try
:
dirname
=
os
.
path
.
join
(
tmpdir
,
url
.
split
(
"/"
)[
-
1
][:
-
len
(
".tar.gz"
)])
print
"downloading libevent source from %s"
%
url
tgz
=
urllib
.
urlopen
(
url
).
read
()
if
md5
(
tgz
).
hexdigest
()
!=
digest
:
sys
.
exit
(
"Error: wrong md5 sum"
)
print
"extracting to %s"
%
dst
tf
=
tarfile
.
open
(
"libevent-src.tar.gz"
,
fileobj
=
StringIO
.
StringIO
(
tgz
),
mode
=
'r:gz'
)
extractall
(
tf
,
tmpdir
)
os
.
rename
(
dirname
,
dst
)
print
"setup.py will now build libevent and link with it statically"
finally
:
shutil
.
rmtree
(
tmpdir
)
if
__name__
==
'__main__'
:
os
.
chdir
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
if
"-1"
in
sys
.
argv
:
download_and_extract
(
"http://monkey.org/~provos/libevent-1.4.14b-stable.tar.gz"
,
"a00e037e4d3f9e4fe9893e8a2d27918c"
)
else
:
download_and_extract
(
"https://downloads.sourceforge.net/sourceforge/levent/libevent-2.0.10-stable.tar.gz"
,
"a37401d26cbbf28185211d582741a3d4"
)
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