updates
This commit is contained in:
parent
f2fa4ce26b
commit
f80ce7a583
2 changed files with 24 additions and 6 deletions
24
pybuild.py
24
pybuild.py
|
|
@ -10,8 +10,6 @@ import optparse
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pybuild_lw
|
|
||||||
|
|
||||||
parser = optparse.OptionParser()
|
parser = optparse.OptionParser()
|
||||||
|
|
||||||
parser.add_option('-x', '--cross', dest='cross_compile', default=False, action="store_true")
|
parser.add_option('-x', '--cross', dest='cross_compile', default=False, action="store_true")
|
||||||
|
|
@ -35,7 +33,11 @@ def enter_srcdir():
|
||||||
dir = 'tor-browser'
|
dir = 'tor-browser'
|
||||||
print("cd {}".format(dir))
|
print("cd {}".format(dir))
|
||||||
if not options.no_execute:
|
if not options.no_execute:
|
||||||
|
try:
|
||||||
os.chdir(dir)
|
os.chdir(dir)
|
||||||
|
except:
|
||||||
|
print("fatal error: can't change to '{}' folder.".format(dir))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
def leave_srcdir():
|
def leave_srcdir():
|
||||||
print("cd ..")
|
print("cd ..")
|
||||||
|
|
@ -102,6 +104,21 @@ def execute_mach_env():
|
||||||
leave_srcdir()
|
leave_srcdir()
|
||||||
|
|
||||||
|
|
||||||
|
def execute_reset():
|
||||||
|
if options.src == 'release':
|
||||||
|
print("error: cannot reset -release source as it's not under version control")
|
||||||
|
beep()
|
||||||
|
sys.exit(1)
|
||||||
|
elif options.src == 'nightly':
|
||||||
|
enter_srcdir()
|
||||||
|
exec("hg up -C")
|
||||||
|
exec("hg purge")
|
||||||
|
exec("hg pull -u")
|
||||||
|
leave_srcdir()
|
||||||
|
elif options.src == 'tor-browser':
|
||||||
|
enter_srcdir()
|
||||||
|
exec("git reset --hard")
|
||||||
|
leave_srcidr()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -264,6 +281,8 @@ def main():
|
||||||
execute_rustup()
|
execute_rustup()
|
||||||
elif arg == 'mach_env':
|
elif arg == 'mach_env':
|
||||||
execute_mach_env()
|
execute_mach_env()
|
||||||
|
elif arg == 'reset':
|
||||||
|
execute_reset()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("error: unknown command on command line: ", arg)
|
print("error: unknown command on command line: ", arg)
|
||||||
|
|
@ -311,6 +330,7 @@ help_message = """# Use:
|
||||||
# Utilities:
|
# Utilities:
|
||||||
|
|
||||||
git_subs - git update submodules
|
git_subs - git update submodules
|
||||||
|
reset - use git/mercurial to revert changes to a clean state
|
||||||
git_init - put the source folder in a .git repository
|
git_init - put the source folder in a .git repository
|
||||||
|
|
||||||
deps_deb - install dependencies with apt
|
deps_deb - install dependencies with apt
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue