aboutsummaryrefslogtreecommitdiff
path: root/build-firmware-package.py
diff options
context:
space:
mode:
Diffstat (limited to 'build-firmware-package.py')
-rwxr-xr-xbuild-firmware-package.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/build-firmware-package.py b/build-firmware-package.py
index 0df116b..de77243 100755
--- a/build-firmware-package.py
+++ b/build-firmware-package.py
@@ -13,7 +13,7 @@ parser.add_argument("tarfile", type = argparse.FileType("wb"), help = "tarball
parser.add_argument("firmware", nargs = "+", help = "firmware files to stuff into tarball")
args = parser.parse_args()
-tar = tarfile.TarFile(mode = "w", fileobj = args.tarfile)
+tar = tarfile.TarFile.open(fileobj = args.tarfile, mode = "w|gz")
head = subprocess.check_output(("git", "rev-parse", "HEAD")).strip()
time = subprocess.check_output(("git", "show", "-s", "--format=%ct", "HEAD")).strip()
commits = [line.split() for line in subprocess.check_output(("git", "submodule", "status")).splitlines()]
@@ -32,3 +32,6 @@ with tempfile.NamedTemporaryFile() as f:
if gpg.wait():
raise subprocess.CalledProcessError(gpg.returncode, "gpg")
tar.add(f.name, "MANIFEST")
+
+tar.close()
+args.tarfile.close()