summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2014-01-18 15:59:14 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2014-01-18 16:00:32 +0100
commite7ff81f2d7ff55bef128c0eacdc43f16080ec8a0 (patch)
treee3198eac4800c4ec4f8e3ad432e322750bc7245d
parentdf310704d3d5da44a99d8dd199d41cefcba0443f (diff)
gentree: create *.tar.gz instead of *.tar.bz for kernel.orgbackports-20131224-2
kernel.org does not support bzip2 any more, use gzip instead. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rwxr-xr-xgentree.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/gentree.py b/gentree.py
index af9b7a88..f6f766fe 100755
--- a/gentree.py
+++ b/gentree.py
@@ -4,7 +4,7 @@
#
import argparse, sys, os, errno, shutil, re, subprocess
-import tarfile, bz2
+import tarfile, gzip
# find self
source_dir = os.path.abspath(os.path.dirname(__file__))
@@ -357,9 +357,9 @@ def get_rel_prep(rel):
paths_to_create = paths)
return rel_prep
-def create_tar_and_bz2(tar_name, dir_to_tar):
+def create_tar_and_gz(tar_name, dir_to_tar):
"""
- We need both a tar file and bzip2 for kernel.org, the tar file
+ We need both a tar file and gzip for kernel.org, the tar file
gets signed, then we upload the compressed version, kup-server
in the backend decompresses and verifies the tarball against
our signature.
@@ -371,9 +371,9 @@ def create_tar_and_bz2(tar_name, dir_to_tar):
tar_file = open(tar_name, "r")
- bz2_file = bz2.BZ2File(tar_name + ".bz2", 'wb', compresslevel=9)
- bz2_file.write(tar_file.read())
- bz2_file.close()
+ gz_file = gzip.GzipFile(tar_name + ".gz", 'wb')
+ gz_file.write(tar_file.read())
+ gz_file.close()
def upload_release(args, rel_prep, logwrite=lambda x:None):
"""
@@ -406,9 +406,9 @@ def upload_release(args, rel_prep, logwrite=lambda x:None):
parent = os.path.dirname(args.outdir)
release = os.path.basename(args.outdir)
tar_name = parent + '/' + release + ".tar"
- bzip2_name = tar_name + ".bz2"
+ gzip_name = tar_name + ".gz"
- create_tar_and_bz2(tar_name, args.outdir)
+ create_tar_and_gz(tar_name, args.outdir)
logwrite(gpg.sign(tar_name, extra_args=['--armor', '--detach-sign']))
@@ -428,13 +428,13 @@ def upload_release(args, rel_prep, logwrite=lambda x:None):
logwrite(kup.mkdir(korg_path))
korg_path += '/'
if (not args.kup_test):
- logwrite("upload file %s to %s" % (bzip2_name, korg_path))
- logwrite(kup.put(bzip2_name, tar_name + '.asc', korg_path))
+ logwrite("upload file %s to %s" % (gzip_name, korg_path))
+ logwrite(kup.put(gzip_name, tar_name + '.asc', korg_path))
logwrite("\nFinished upload!\n")
logwrite("Target path contents:")
logwrite(kup.ls(path=korg_path))
else:
- kup_cmd = "kup put /\n\t\t%s /\n\t\t%s /\n\t\t%s" % (bzip2_name, tar_name + '.asc', korg_path)
+ kup_cmd = "kup put /\n\t\t%s /\n\t\t%s /\n\t\t%s" % (gzip_name, tar_name + '.asc', korg_path)
logwrite("kup-test: skipping cmd: %s" % kup_cmd)
def _main():