Hello, This patch avoids weird output (e.g. "foo <=") if for some reason name and flags but no version get passed to formatRequire().
From 09a5e846af622e70836bd81507e94c6456ceefe6 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@xxxxxx> Date: Sun, 21 Jun 2009 23:11:01 +0300 Subject: [PATCH] Do not format flags if no version is passed to formatRequire. --- rpmUtils/miscutils.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rpmUtils/miscutils.py b/rpmUtils/miscutils.py index 5b792a0..9d94e06 100644 --- a/rpmUtils/miscutils.py +++ b/rpmUtils/miscutils.py @@ -370,7 +370,7 @@ def rpm2cpio(fdno, out=sys.stdout, bufsize=2048): def formatRequire (name, version, flags): s = name - if flags: + if flags and version: if flags & (rpm.RPMSENSE_LESS | rpm.RPMSENSE_GREATER | rpm.RPMSENSE_EQUAL): s = s + " " @@ -380,8 +380,7 @@ def formatRequire (name, version, flags): s = s + ">" if flags & rpm.RPMSENSE_EQUAL: s = s + "=" - if version: - s = "%s %s" %(s, version) + s = "%s %s" % (s, version) return s def flagToString(flags): -- 1.6.0.6
_______________________________________________ Yum mailing list Yum@xxxxxxxxxxxxxxxxx http://lists.baseurl.org/mailman/listinfo/yum