serve-mar command added
This commit is contained in:
parent
44773d461d
commit
c5364490f2
2 changed files with 41 additions and 5 deletions
8
Makefile
8
Makefile
|
|
@ -1,4 +1,4 @@
|
||||||
.PHONY : help all clean veryclean fetch build artifacts update full-mar
|
.PHONY : help all clean veryclean fetch build artifacts update full-mar serve-mar
|
||||||
|
|
||||||
help :
|
help :
|
||||||
@echo "Use: make [all] [clean] [veryclean] [check] ..."
|
@echo "Use: make [all] [clean] [veryclean] [check] ..."
|
||||||
|
|
@ -7,7 +7,8 @@ help :
|
||||||
@echo " clean - Remove output files and temporary files."
|
@echo " clean - Remove output files and temporary files."
|
||||||
@echo " veryclean - Like 'clean', but also remove all downloaded files."
|
@echo " veryclean - Like 'clean', but also remove all downloaded files."
|
||||||
@echo " update - update 'version' and 'source_release' files."
|
@echo " update - update 'version' and 'source_release' files."
|
||||||
@echo " full-mar - create mar setup file."
|
@echo " full-mar - create mar setup file, and update.xml."
|
||||||
|
@echo " serve-mar - serve the update files"
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo " fetch - Fetch the latest librewolf source."
|
@echo " fetch - Fetch the latest librewolf source."
|
||||||
@echo " build - Perform './mach build && ./mach package' on it."
|
@echo " build - Perform './mach build && ./mach package' on it."
|
||||||
|
|
@ -51,3 +52,6 @@ artifacts :
|
||||||
|
|
||||||
full-mar :
|
full-mar :
|
||||||
python3 mk.py full-mar
|
python3 mk.py full-mar
|
||||||
|
|
||||||
|
serve-mar :
|
||||||
|
(cd librewolf-$(shell cat version)-$(shell cat source_release)/MAR && python3 -m http.server 8000)
|
||||||
|
|
|
||||||
36
mk.py
36
mk.py
|
|
@ -13,6 +13,9 @@ from assets.tools import exec, patch
|
||||||
def deps_win32():
|
def deps_win32():
|
||||||
exec('rustup target add i686-pc-windows-msvc')
|
exec('rustup target add i686-pc-windows-msvc')
|
||||||
|
|
||||||
|
def serve_mar():
|
||||||
|
pass
|
||||||
|
|
||||||
def full_mar():
|
def full_mar():
|
||||||
with open('version','r') as file:
|
with open('version','r') as file:
|
||||||
version = file.read().rstrip()
|
version = file.read().rstrip()
|
||||||
|
|
@ -28,11 +31,37 @@ def full_mar():
|
||||||
channel = 'default'
|
channel = 'default'
|
||||||
|
|
||||||
exec('mkdir -p MAR') # output folder
|
exec('mkdir -p MAR') # output folder
|
||||||
|
|
||||||
exec('touch {}/dist/firefox/precomplete'.format(objdir))
|
exec('touch {}/dist/firefox/precomplete'.format(objdir))
|
||||||
exec('MAR={}/dist/host/bin/mar.exe MOZ_PRODUCT_VERSION={}-{} MAR_CHANNEL_ID={} ./tools/update-packaging/make_full_update.sh {} {}/dist/firefox'.format(objdir,version,source_release,channel,mar_output_path,objdir))
|
exec('MAR={}/dist/host/bin/mar.exe MOZ_PRODUCT_VERSION={}-{} MAR_CHANNEL_ID={} ./tools/update-packaging/make_full_update.sh {} {}/dist/firefox'.format(objdir,version,source_release,channel,mar_output_path,objdir))
|
||||||
|
|
||||||
# restore state
|
# create config.xml
|
||||||
|
mar_name = 'output.mar'
|
||||||
|
|
||||||
|
# sha512sum
|
||||||
|
hash_sha512 = ''
|
||||||
|
exec("cat MAR/{} | sha512sum | awk '{}' > tmpfile78419".format(mar_name,'{print $1}'))
|
||||||
|
with open('tmpfile78419', 'r') as tmpfile:
|
||||||
|
data = tmpfile.read().rstrip()
|
||||||
|
hash_sha512 = data
|
||||||
|
exec('rm -f tmpfile78419')
|
||||||
|
|
||||||
|
# size in bytes
|
||||||
|
size = os.path.getsize('MAR/{}'.format(mar_name))
|
||||||
|
mar_version = '2000.0a1'
|
||||||
|
build_id = '21181002100236'
|
||||||
|
update_url = 'http://127.0.0.1:8000' # no trailing slash
|
||||||
|
config_xml = '''<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<updates>
|
||||||
|
<update type="minor" displayVersion="{}" appVersion="{}" platformVersion="{}" buildID="{}">
|
||||||
|
<patch type="complete" URL="{}/{}" hashFunction="sha512" hashValue="{}" size="{}"/>
|
||||||
|
</update>
|
||||||
|
</updates>
|
||||||
|
'''.format(mar_version,mar_version,mar_version,build_id,update_url,mar_name,hash_sha512,size)
|
||||||
|
textfile = open('MAR/update.xml','w')
|
||||||
|
textfile.write(config_xml)
|
||||||
|
textfile.close()
|
||||||
|
|
||||||
|
# restore state
|
||||||
os.chdir('..')
|
os.chdir('..')
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
@ -240,6 +269,9 @@ for arg in sys.argv:
|
||||||
elif arg == 'full-mar':
|
elif arg == 'full-mar':
|
||||||
full_mar()
|
full_mar()
|
||||||
done_something = True
|
done_something = True
|
||||||
|
elif arg == 'serve-mar':
|
||||||
|
serve_mar()
|
||||||
|
done_something = True
|
||||||
elif arg == 'upload':
|
elif arg == 'upload':
|
||||||
in_upload = True
|
in_upload = True
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue