Discussion:
4 commits - createrepo/__init__.py
Ville SkyttÀ
2011-02-24 20:31:53 UTC
Permalink
createrepo/__init__.py | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)

New commits:
commit be08fe4d0a64ed5075cc6878f962db8d78a3244e
Author: Ville SkyttÀ <***@iki.fi>
Date: Thu Feb 24 21:51:11 2011 +0200

Fix writing additional metadata.

This broke at least when merging updateinfos.

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 5b70298..44a9e82 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -1049,7 +1049,7 @@ class MetaDataGenerator:


if self.conf.additional_metadata:
- for md_type, mdfile in self.conf.additional_metadata.items():
+ for md_type, md_file in self.conf.additional_metadata.items():
mdcontent = self._createRepoDataObject(md_file, md_type)
repomd.repoData[mdcontent.type] = mdcontent

commit 794ac74ef51a64cf725975afb1a4a5d60ad0db61
Author: Ville SkyttÀ <***@iki.fi>
Date: Thu Feb 24 21:48:07 2011 +0200

Fix getting YumAvailablePackage local path.

Found when trying to merge two remote repos.

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 45c9183..5b70298 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -584,7 +584,7 @@ class MetaDataGenerator:
po = None
if isinstance(pkg, YumAvailablePackage):
po = pkg
- self.read_pkgs.append(po.localpath)
+ self.read_pkgs.append(po.localPkg())

# if we're dealing with remote pkgs - pitch it over to doing
# them one at a time, for now.
commit ce9d5e3678d39cf8268b2304fb0009cab3b95692
Author: Ville SkyttÀ <***@iki.fi>
Date: Thu Feb 24 21:20:48 2011 +0200

Drop unused imports.

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index fdc459c..45c9183 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -27,11 +27,11 @@ import stat
import fcntl
import subprocess

-from yum import misc, Errors, to_unicode
-from yum.repoMDObject import RepoMD, RepoMDError, RepoData
+from yum import misc, Errors
+from yum.repoMDObject import RepoMD, RepoData
from yum.sqlutils import executeSQL
from yum.packageSack import MetaSack
-from yum.packages import YumAvailablePackage, YumLocalPackage
+from yum.packages import YumAvailablePackage

import rpmUtils.transaction
from utils import _, errorprint, MDError
@@ -609,7 +609,7 @@ class MetaDataGenerator:
# open the files they created and write them out to our metadata
# add up the total pkg counts and return that value
worker_tmp_path = tempfile.mkdtemp()
- worker_chunks = utils.split_list_into_equal_chunks(pkgfiles, self.conf.workers)
+ worker_chunks = split_list_into_equal_chunks(pkgfiles, self.conf.workers)
worker_cmd_dict = {}
worker_jobs = {}
base_worker_cmdline = [self.conf.worker_cmd,
commit caa02d883b9fc5fe5ab0c48de24e0b0e25ddd36a
Author: Ville SkyttÀ <***@iki.fi>
Date: Thu Feb 24 21:19:27 2011 +0200

Drop dead code.

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 07abc27..fdc459c 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -789,7 +789,6 @@ class MetaDataGenerator:
return self._old_package_dict

self._old_package_dict = {}
- opl = []
for d in self.conf.oldpackage_paths:
for f in self.getFileList(d, '.rpm'):
fp = d + '/' + f
@@ -879,7 +878,6 @@ class MetaDataGenerator:

thisdata = RepoData()
thisdata.type = mdtype
- baseloc = None
thisdata.location = (self.conf.baseurl, os.path.join(self.conf.finaldir, sfile))
thisdata.checksum = (self.conf.sumtype, csum)
if compress:
@@ -1115,12 +1113,6 @@ class MetaDataGenerator:
raise MDError, _(
'Could not remove old metadata file: %s: %s') % (oldfile, e)

- # Move everything else back from olddir (eg. repoview files)
- try:
- old_contents = os.listdir(output_old_dir)
- except (OSError, IOError), e:
- old_contents = []
-
for f in os.listdir(output_old_dir):
oldfile = os.path.join(output_old_dir, f)
finalfile = os.path.join(output_final_dir, f)
@@ -1245,7 +1237,6 @@ class SplitMetaDataGenerator(MetaDataGenerator):
self.conf.baseurl = self._getFragmentUrl(self.conf.baseurl, mediano)
try:
self.openMetadataDocs()
- original_basedir = self.conf.basedir
for mydir in self.conf.directories:
self.conf.baseurl = self._getFragmentUrl(self.conf.baseurl, mediano)
self.writeMetadataDocs(filematrix[mydir], mydir)
seth vidal
2011-02-24 20:36:55 UTC
Permalink
Post by Ville SkyttÀ
createrepo/__init__.py | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
commit be08fe4d0a64ed5075cc6878f962db8d78a3244e
Date: Thu Feb 24 21:51:11 2011 +0200
Fix writing additional metadata.
This broke at least when merging updateinfos.
diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 5b70298..44a9e82 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
mdcontent = self._createRepoDataObject(md_file, md_type)
repomd.repoData[mdcontent.type] = mdcontent
thank you.
Post by Ville SkyttÀ
commit caa02d883b9fc5fe5ab0c48de24e0b0e25ddd36a
Date: Thu Feb 24 21:19:27 2011 +0200
Drop dead code.
diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 07abc27..fdc459c 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
return self._old_package_dict
self._old_package_dict = {}
- opl = []
fp = d + '/' + f
thisdata = RepoData()
thisdata.type = mdtype
- baseloc = None
thisdata.location = (self.conf.baseurl, os.path.join(self.conf.finaldir, sfile))
thisdata.checksum = (self.conf.sumtype, csum)
raise MDError, _(
'Could not remove old metadata file: %s: %s') % (oldfile, e)
- # Move everything else back from olddir (eg. repoview files)
- old_contents = os.listdir(output_old_dir)
- old_contents = []
-
hmmm - why?

-sv
Ville Skyttä
2011-02-24 21:47:18 UTC
Permalink
Post by seth vidal
Post by Ville SkyttÀ
commit caa02d883b9fc5fe5ab0c48de24e0b0e25ddd36a
Date: Thu Feb 24 21:19:27 2011 +0200
Drop dead code.
[...]
Post by seth vidal
hmmm - why?
Could you elaborate, why not?

Loading...