[PATCH] Fix prereq flag checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Currently createrepo on Fedora >= 10 flags all dependencies in the generated 
metadata as "pre" ones.  Fix attached, more info in its description.

From 61d2124502a336024d4dd3adc73449a8d225d781 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@xxxxxx>
Date: Thu, 26 Mar 2009 23:49:16 +0200
Subject: [PATCH] Fix prereq flag checking, flag Requires(pre) and Requires(post) as pre=1.

The fix affects rpm versions that define RPMSENSE_PREREQ as 0, such as
vanilla upstream rpm >= 4.4 and Fedora's rpm >= 4.6 - with those
versions, all dependencies were flagged as "pre" ones.
---
 yum/packages.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/yum/packages.py b/yum/packages.py
index bb43b6c..4783b3e 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -1172,13 +1172,12 @@ class YumHeaderPackage(YumAvailablePackage):
            is a pre-requires or a not"""
         # FIXME this should probably be put in rpmUtils.miscutils since 
         # - that's what it is
-        newflag = flag
         if flag is not None:
-            newflag = flag & rpm.RPMSENSE_PREREQ
-            if newflag == rpm.RPMSENSE_PREREQ:
+            # Note: RPMSENSE_PREREQ == 0 since rpm-4.4'ish
+            if flag & (rpm.RPMSENSE_PREREQ |
+                       rpm.RPMSENSE_SCRIPT_PRE |
+                       rpm.RPMSENSE_SCRIPT_POST):
                 return 1
-            else:
-                return 0
         return 0
 
     def _requires_with_pre(self):
-- 
1.6.0.6

_______________________________________________
Yum mailing list
Yum@xxxxxxxxxxxxxxxxx
http://lists.baseurl.org/mailman/listinfo/yum

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux