[Bug 825158] New: Createrepo crashes if --changelog-limit commandline option is used
https://bugzilla.novell.com/show_bug.cgi?id=825158 https://bugzilla.novell.com/show_bug.cgi?id=825158#c0 Summary: Createrepo crashes if --changelog-limit commandline option is used Classification: openSUSE Product: openSUSE 12.2 Version: Final Platform: All OS/Version: openSUSE 12.2 Status: NEW Severity: Critical Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: eduard.bartosh@intel.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Usage of --changelog-limit option causes this crash of createrepo: Worker 0: Traceback (most recent call last): Worker 0: File "/usr/share/createrepo/worker.py", line 101, in <module> Worker 0: main(sys.argv[1:]) Worker 0: File "/usr/share/createrepo/worker.py", line 89, in main Worker 0: globalopts.get('clog_limit', None))) Worker 0: File "/usr/lib64/python2.7/site-packages/yum/packages.py", line 1392, in xml_dump_other_metadata Worker 0: msg += "%s\n</package>\n" % misc.to_unicode(self._dump_changelog(clog_limit)) Worker 0: File "/usr/lib64/python2.7/site-packages/yum/packages.py", line 1339, in _dump_changelog Worker 0: clogs = self.changelog[:clog_limit] Worker 0: TypeError: slice indices must be integers or None or have an __index__ method This bug was introduced in createrepo 0.9.9 release, so most probably createrepo also crashes on OpenSUSE 12.3. I didn't check it though. Bug was fixed in upstream long time ago, but has never been released. Here is the fix from their master: commit 4f5e572f7241cbf7e32c771a4e113130634cde27 Author: Seth Vidal <skvidal@fedoraproject.org> Date: Thu Jan 27 14:02:45 2011 -0500 make sure the changelog_limit is an int (or None) and not something else diff --git a/worker.py b/worker.py index eb35ef7..591a922 100755 --- a/worker.py +++ b/worker.py @@ -83,8 +83,10 @@ def main(args): external_data=external_data) pri.write(pkg.xml_dump_primary_metadata()) fl.write(pkg.xml_dump_filelists_metadata()) - other.write(pkg.xml_dump_other_metadata(clog_limit= - globalopts.get('clog_limit', None))) + clog_limit=globalopts.get('clog_limit', None) + if clog_limit is not None: + clog_limit = int(clog_limit) + other.write(pkg.xml_dump_other_metadata(clog_limit=clog_limit)) except yum.Errors.YumBaseError, e: print >> sys.stderr, "Error: %s" % e continue Reproducible: Always Steps to Reproduce: 1. Chdir to some repository with packages 2. run createrepo with --changelog-limit option: createrepo --changelog-limit=10 ./ Actual Results: createrepo crashes Worker 0: Traceback (most recent call last): Worker 0: File "/usr/share/createrepo/worker.py", line 101, in <module> Worker 0: main(sys.argv[1:]) Worker 0: File "/usr/share/createrepo/worker.py", line 89, in main Worker 0: globalopts.get('clog_limit', None))) Worker 0: File "/usr/lib64/python2.7/site-packages/yum/packages.py", line 1392, in xml_dump_other_metadata Worker 0: msg += "%s\n</package>\n" % misc.to_unicode(self._dump_changelog(clog_limit)) Worker 0: File "/usr/lib64/python2.7/site-packages/yum/packages.py", line 1339, in _dump_changelog Worker 0: clogs = self.changelog[:clog_limit] Worker 0: TypeError: slice indices must be integers or None or have an __index__ method Expected Results: Crash must not happen. Repository should be created instead. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=825158 https://bugzilla.novell.com/show_bug.cgi?id=825158#c1 --- Comment #1 from Ed Bartosh <eduard.bartosh@intel.com> 2013-06-16 03:12:49 UTC --- I've noticed that fix is also present in OpenSUSE createrepo tree at https://github.com/openSUSE/createrepo. However, it was not included into the released createrepo for OpenSUSE 12.2 and may be even for 12.3 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=825158 https://bugzilla.novell.com/show_bug.cgi?id=825158#c2 --- Comment #2 from Ed Bartosh <eduard.bartosh@intel.com> 2013-06-16 03:23:27 UTC --- Created pull request: https://github.com/openSUSE/createrepo/pull/1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=825158 https://bugzilla.novell.com/show_bug.cgi?id=825158#c Ye Yuan <yyuan@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yyuan@suse.com AssignedTo|bnc-team-screening@forge.pr |mbarringer@suse.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com