mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 12:04:27 +01:00
zip-img: factor out for main() python calling
This commit is contained in:
11
release
11
release
@@ -1,10 +1,15 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
import common
|
import common
|
||||||
subprocess.check_call(['./build-all'])
|
zip_img = imp.load_source('zip_img', os.path.join(common.root_dir, 'zip-img'))
|
||||||
subprocess.check_call(['./zip-img'])
|
|
||||||
|
subprocess.check_call([os.path.join(common.root_dir, 'build-all')])
|
||||||
|
zip_img.main()
|
||||||
tag = 'sha-{}'.format(common.sha)
|
tag = 'sha-{}'.format(common.sha)
|
||||||
subprocess.check_call(['git', 'tag' tag])
|
subprocess.check_call(['git', 'tag', tag])
|
||||||
subprocess.check_call(['git', 'push' '--tags'])
|
subprocess.check_call(['git', 'push' '--tags'])
|
||||||
# TODO
|
# TODO
|
||||||
# - https://stackoverflow.com/questions/41022470/curl-request-to-add-file-to-github-release
|
# - https://stackoverflow.com/questions/41022470/curl-request-to-add-file-to-github-release
|
||||||
|
|||||||
22
zip-img
22
zip-img
@@ -6,12 +6,16 @@ import zipfile
|
|||||||
|
|
||||||
import common
|
import common
|
||||||
|
|
||||||
outfile = os.path.join(common.out_dir, 'lkmc-{}.zip'.format(common.sha))
|
def main():
|
||||||
if os.path.exists(outfile):
|
outfile = os.path.join(common.out_dir, 'lkmc-{}.zip'.format(common.sha))
|
||||||
os.unlink(outfile)
|
if os.path.exists(outfile):
|
||||||
zipf = zipfile.ZipFile(outfile, 'w', zipfile.ZIP_DEFLATED)
|
os.unlink(outfile)
|
||||||
for arch in common.arches:
|
zipf = zipfile.ZipFile(outfile, 'w', zipfile.ZIP_DEFLATED)
|
||||||
common.setup(common.get_argparse(default_args={'arch': arch}))
|
for arch in common.arches:
|
||||||
zipf.write(common.qcow2_file, arcname=os.path.relpath(common.qcow2_file, common.root_dir))
|
common.setup(common.get_argparse(default_args={'arch': arch}))
|
||||||
zipf.write(common.linux_image, arcname=os.path.relpath(common.linux_image, common.root_dir))
|
zipf.write(common.qcow2_file, arcname=os.path.relpath(common.qcow2_file, common.root_dir))
|
||||||
zipf.close()
|
zipf.write(common.linux_image, arcname=os.path.relpath(common.linux_image, common.root_dir))
|
||||||
|
zipf.close()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user