Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hiro
GetTor
Commits
c66101e8
Commit
c66101e8
authored
Feb 15, 2016
by
ilv
Browse files
Changes for production in github uploader
parent
f3524221
Changes
2
Show whitespace changes
Inline
Side-by-side
gettor/utils.py
View file @
c66101e8
...
@@ -20,9 +20,9 @@ import hashlib
...
@@ -20,9 +20,9 @@ import hashlib
LOGGING_FORMAT
=
"[%(levelname)s] %(asctime)s; %(message)s"
LOGGING_FORMAT
=
"[%(levelname)s] %(asctime)s; %(message)s"
DATE_FORMAT
=
"%Y-%m-%d"
# %H:%M:%S
DATE_FORMAT
=
"%Y-%m-%d"
# %H:%M:%S
windows_regex
=
'^torbrowser-install-\d\.\d\.\d
_
\w\w(-\w\w)?\.exe$'
windows_regex
=
'^torbrowser-install-\d\.\d
(
\.\d
)?_(
\w\w
)
(-\w\w)?\.exe$'
linux_regex
=
'^tor-browser-linux\d\d-\d\.\d\.\d_(\w\w)(-\w\w)?\.tar\.xz$'
linux_regex
=
'^tor-browser-linux
(
\d\d
)
-\d\.\d
(
\.\d
)?
_(\w\w)(-\w\w)?\.tar\.xz$'
osx_regex
=
'^TorBrowser-\d\.\d\.\d-osx\d\d_(\w\w)(-\w\w)?\.dmg$'
osx_regex
=
'^TorBrowser-\d\.\d
(
\.\d
)?
-osx\d\d_(\w\w)(-\w\w)?\.dmg$'
def
get_logging_format
():
def
get_logging_format
():
...
@@ -70,11 +70,11 @@ def get_bundle_info(filename, osys=None):
...
@@ -70,11 +70,11 @@ def get_bundle_info(filename, osys=None):
m_osx
=
re
.
search
(
osx_regex
,
filename
)
m_osx
=
re
.
search
(
osx_regex
,
filename
)
if
m_windows
:
if
m_windows
:
return
'windows'
,
'32/64'
,
m_windows
.
group
(
1
)
return
'windows'
,
'32/64'
,
m_windows
.
group
(
2
)
elif
m_linux
:
elif
m_linux
:
return
'linux'
,
m_linux
.
group
(
1
),
m_linux
.
group
(
2
)
return
'linux'
,
m_linux
.
group
(
1
),
m_linux
.
group
(
3
)
elif
m_osx
:
elif
m_osx
:
return
'osx'
,
m_osx
.
group
(
1
)
,
m_osx
.
group
(
2
)
return
'osx'
,
'64'
,
m_osx
.
group
(
2
)
else
:
else
:
raise
ValueError
(
"Invalid bundle format %s"
%
file
)
raise
ValueError
(
"Invalid bundle format %s"
%
file
)
...
...
upload/bundles2github.py
View file @
c66101e8
...
@@ -67,33 +67,28 @@ if __name__ == '__main__':
...
@@ -67,33 +67,28 @@ if __name__ == '__main__':
help
=
'Create links file with files already uploaded.'
help
=
'Create links file with files already uploaded.'
)
)
parser
.
add_argument
(
'-v'
,
'--version'
,
default
=
None
,
help
=
'Version of Tor Browser.'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
config
=
ConfigParser
.
ConfigParser
()
config
=
ConfigParser
.
ConfigParser
()
config
.
read
(
'github-local.cfg'
)
config
.
read
(
'github.cfg'
)
tbb_version_path
=
config
.
get
(
'general'
,
'version_cfg_path'
)
# this script should be called after fetching the latest Tor Browser,
# and specifying the latest version
if
args
.
version
:
version
=
args
.
version
else
:
tbb_version_config
=
ConfigParser
.
ConfigParser
()
tbb_version_config
=
ConfigParser
.
ConfigParser
()
tbb_version_config
.
read
(
'latest_torbrowser.cfg'
)
tbb_version_config
.
read
(
tbb_version_path
)
version
=
tbb_version_config
.
get
(
'version'
,
'current'
)
version
=
tbb_version_config
.
get
(
'version'
,
'current'
)
# the token allow us to run this script without GitHub user/pass
# the token allow us to run this script without GitHub user/pass
github_access_token
=
config
.
get
(
'app'
,
'access_token'
)
github_access_token
=
config
.
get
(
'app'
,
'access_token'
)
# path to the fingerprint that signed the packages
# path to the fingerprint that signed the packages
tb_key
=
os
.
path
.
abspath
(
'tbb
-
key
-torbrowserteam.asc
'
)
tb_key
=
config
.
get
(
'general'
,
'tbb
_
key
_path
'
)
# path to the latest version of Tor Browser
# path to the latest version of Tor Browser
tb_path
=
os
.
path
.
abspath
(
'latest'
)
tb_path
=
config
.
get
(
'general'
,
'latest_path'
)
# path to gettor code configuration
core_path
=
config
.
get
(
'general'
,
'core_path'
)
# user and repository where we upload Tor Browser
# user and repository where we upload Tor Browser
github_user
=
config
.
get
(
'app'
,
'user'
)
github_user
=
config
.
get
(
'app'
,
'user'
)
...
@@ -139,13 +134,13 @@ if __name__ == '__main__':
...
@@ -139,13 +134,13 @@ if __name__ == '__main__':
release
.
edit
(
draft
=
False
)
release
.
edit
(
draft
=
False
)
# Create the links file for this release
# Create the links file for this release
core
=
gettor
.
core
.
Core
(
os
.
path
.
abspath
(
'../core.cfg'
)
)
core
=
gettor
.
core
.
Core
(
core_path
)
# Erase old links if any and create a new empty one
# Erase old links if any and create a new empty one
core
.
create_links_file
(
'GitHub'
,
readable_fp
)
core
.
create_links_file
(
'GitHub'
,
readable_fp
)
print
(
"Creating links file"
)
print
(
"Creating links file"
)
for
asset
in
release
.
assets
:
for
asset
in
release
.
assets
()
:
url
=
asset
.
browser_download_url
url
=
asset
.
browser_download_url
if
url
.
endswith
(
'.asc'
):
if
url
.
endswith
(
'.asc'
):
continue
continue
...
...
Write
Preview
Supports
Markdown
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