Esempio n. 1
0
    def check(self, *args, **kwds):
        _rpmts.check(self, *args, **kwds)

        # compatibility: munge problem strings into dependency tuples of doom
        res = []
        for p in self.problems():
            # is it anything we need to care about?
            if p.type == rpm.RPMPROB_CONFLICT:
                sense = rpm.RPMDEP_SENSE_CONFLICTS
            elif p.type == rpm.RPMPROB_REQUIRES:
                sense = rpm.RPMDEP_SENSE_REQUIRES
            else:
                continue

            # strip arch, split to name, version, release
            nevr = p.pkgNEVR.rsplit('.', 1)[0]
            n, v, r = nevr.rsplit('-', 2)

            # extract the dependency information
            needs = p.altNEVR.split()[1:]
            needname = needs[0]
            needflags = rpm.RPMSENSE_ANY
            if len(needs) == 3:
                needop = needs[1]
                if needop.find('<') >= 0: needflags |= rpm.RPMSENSE_LESS
                if needop.find('=') >= 0: needflags |= rpm.RPMSENSE_EQUAL
                if needop.find('>') >= 0: needflags |= rpm.RPMSENSE_GREATER
                needver = needs[2]
            else:
                needver = ""

            res.append(
                ((n, v, r), (needname, needver), needflags, sense, p.key))

        return res
Esempio n. 2
0
    def check(self, *args, **kwds):
        TransactionSetCore.check(self, *args, **kwds)

        # compatibility: munge problem strings into dependency tuples of doom
        res = []
        for p in self.problems():
            # is it anything we need to care about?
            if p.type == rpm.RPMPROB_CONFLICT:
                sense = rpm.RPMDEP_SENSE_CONFLICTS
            elif p.type == rpm.RPMPROB_REQUIRES:
                sense = rpm.RPMDEP_SENSE_REQUIRES
            else:
                continue

            # strip arch, split to name, version, release
            nevr = p.altNEVR.rsplit('.', 1)[0]
            n, v, r = nevr.rsplit('-', 2)

            # extract the dependency information
            needs = p._str.split()
            needname = needs[0]
            needflags = rpm.RPMSENSE_ANY
            if len(needs) == 3:
                needop = needs[1]
                if needop.find('<') >= 0: needflags |= rpm.RPMSENSE_LESS
                if needop.find('=') >= 0: needflags |= rpm.RPMSENSE_EQUAL
                if needop.find('>') >= 0: needflags |= rpm.RPMSENSE_GREATER
                needver = needs[2]
            else:
                needver = ""

            res.append(((n, v, r),(needname,needver),needflags,sense,p.key))

        return res
Esempio n. 3
0
 def check(self, *args, **kwargs):
     TransactionSetCore.check(self, *args, **kwargs)
     # NOTE: rpm.TransactionSet throws out all problems but these
     return [
         p for p in self.problems()
         if p.type in (rpm.RPMPROB_CONFLICT, rpm.RPMPROB_REQUIRES)
     ]
Esempio n. 4
0
 def check(self, *args, **kwargs):
     TransactionSetCore.check(self, *args, **kwargs)
     # NOTE: rpm.TransactionSet throws out all problems but these
     return [p for p in self.problems()
               if p.type in (rpm.RPMPROB_CONFLICT, rpm.RPMPROB_REQUIRES)]