[master][PATCH] Fix makeupdates' package fetching when no version is specified

Vratislav Podzimek vpodzime at redhat.com
Fri Jul 26 11:42:11 UTC 2013


If no version is specified in Requires, we should search for any version of the
package.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 scripts/makeupdates | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/scripts/makeupdates b/scripts/makeupdates
index 16255c4..6368ec2 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -332,8 +332,16 @@ def check_for_new_packages(tag, arch):
     # parse requires
 
     for req in new_requires:
-        package = req.split()[1]
-        version = req.split().pop()
+        parts = req.split()
+        if len(parts) < 2:
+            # must contain at least "+Requires:" and "some_package"
+            continue
+        package = parts[1]
+        if len(parts) > 2:
+            version = parts.pop()
+        else:
+            version = ""
+
         # handle version variables (%{package-namever})
         if version.startswith("%"):
             # drop the %{ prefix and ver} suffix
@@ -429,6 +437,8 @@ def get_koji_URLS(packages, fedora_number, arch):
     import koji
     kojiclient = koji.ClientSession('http://koji.fedoraproject.org/kojihub', {})
     for name, version in packages.iteritems():
+        if not version:
+            version = "*"
         # check if version contains build number or not
         if len(version.split("-")) == 1:
             version = "%s-*" % version
-- 
1.7.11.7



More information about the anaconda-patches mailing list