From skvidal at osuosl.org Tue Jan 3 22:19:07 2012 From: skvidal at osuosl.org (skvidal at osuosl.org) Date: Tue, 3 Jan 2012 22:19:07 +0000 (UTC) Subject: [Rpm-metadata] createrepo/__init__.py genpkgmetadata.py Message-ID: <20120103221907.D8DDB2347BF@yum.osuosl.org> createrepo/__init__.py | 22 ++++++++++++++++------ genpkgmetadata.py | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) New commits: commit 25a2dea093a3d449ab1a031e42226a7a5af0c6ec Author: Seth Vidal Date: Tue Jan 3 17:17:58 2012 -0500 make compress_type default to 'compat' which makes it use gz for the xml files and bzip2 for the sqlite files - so that rhel5 yum doesn't get pissy diff --git a/createrepo/__init__.py b/createrepo/__init__.py index 2d3514e..3f55700 100644 --- a/createrepo/__init__.py +++ b/createrepo/__init__.py @@ -111,7 +111,7 @@ class MetaDataConfig(object): self.worker_cmd = '/usr/share/createrepo/worker.py' #self.worker_cmd = './worker.py' # helpful when testing self.retain_old_md = 0 - self.compress_type = 'gz' + self.compress_type = 'compat' class SimpleMDCallBack(object): @@ -144,10 +144,15 @@ class MetaDataGenerator: self.files = [] self.rpmlib_reqs = {} self.read_pkgs = [] + self.compat_compress = False if not self.conf.directory and not self.conf.directories: raise MDError, "No directory given on which to run." - + + if self.conf.compress_type == 'compat': + self.compat_compress = True + self.conf.compress_type = None + if not self.conf.compress_type: self.conf.compress_type = 'gz' @@ -982,15 +987,20 @@ class MetaDataGenerator: good_name = '%s.sqlite' % ftype resultpath = os.path.join(repopath, good_name) + # compat compression for rhel5 compatibility from fedora :( + compress_type = self.conf.compress_type + if self.compat_compress: + compress_type = 'bz2' + # rename from silly name to not silly name os.rename(tmp_result_path, resultpath) - ext = self.conf.compress_type - compressed_name = '%s.%s' % (good_name, ext) + compressed_name = '%s.%s' % (good_name, compress_type) result_compressed = os.path.join(repopath, compressed_name) db_csums[ftype] = misc.checksum(sumtype, resultpath) # compress the files - compressFile(resultpath, result_compressed, self.conf.compress_type) + + compressFile(resultpath, result_compressed, compress_type) # csum the compressed file db_compressed_sums[ftype] = misc.checksum(sumtype, result_compressed) @@ -1001,7 +1011,7 @@ class MetaDataGenerator: if self.conf.unique_md_filenames: csum_compressed_name = '%s-%s.%s' % ( - db_compressed_sums[ftype], good_name, ext) + db_compressed_sums[ftype], good_name, compress_type) csum_result_compressed = os.path.join(repopath, csum_compressed_name) os.rename(result_compressed, csum_result_compressed) diff --git a/genpkgmetadata.py b/genpkgmetadata.py index af0ecb4..63fb85b 100755 --- a/genpkgmetadata.py +++ b/genpkgmetadata.py @@ -127,7 +127,7 @@ def parse_args(args, conf): parser.add_option("--xz", default=False, action="store_true", help="use xz for repodata compression") - parser.add_option("--compress-type", default=None, dest="compress_type", + parser.add_option("--compress-type", default='compat', dest="compress_type", help="which compression type to use") From skvidal at osuosl.org Tue Jan 3 22:20:40 2012 From: skvidal at osuosl.org (skvidal at osuosl.org) Date: Tue, 3 Jan 2012 22:20:40 +0000 (UTC) Subject: [Rpm-metadata] genpkgmetadata.py Message-ID: <20120103222040.472652347BF@yum.osuosl.org> genpkgmetadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 998e73a3268975f220fd4287988895f95dd43734 Author: Seth Vidal Date: Tue Jan 3 17:19:52 2012 -0500 fix --xz options with compat compress type diff --git a/genpkgmetadata.py b/genpkgmetadata.py index 63fb85b..ce8e452 100755 --- a/genpkgmetadata.py +++ b/genpkgmetadata.py @@ -164,7 +164,7 @@ def parse_args(args, conf): opts.database = False # xz is just a shorthand for compress_type - if opts.xz and not opts.compress_type: + if opts.xz and opts.compress_type == 'compat': opts.compress_type='xz'