Skip to content

Commit

Permalink
Fix compatibility with rpm.org (no rpm.ts.setDFlags)
Browse files Browse the repository at this point in the history
  • Loading branch information
afb committed Mar 9, 2014
1 parent b369aec commit 87cc91c
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions smart/backends/rpm/pm.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,23 @@ def commit(self, changeset, pkgpaths):
flags |= rpm.RPMTRANS_FLAG_TEST
ts.setFlags(flags)

dflags = ts.setDFlags(0)
if sysconf.get("rpm-noupgrade", False):
dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE
if sysconf.get("rpm-norequires", False):
dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES
if sysconf.get("rpm-noconflicts", False):
dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS
if sysconf.get("rpm-noobsoletes", False):
dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES
if sysconf.get("rpm-noparentdirs", False):
dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS
if sysconf.get("rpm-nolinktos", False):
dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS
if sysconf.get("rpm-nosuggest", False):
dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST
ts.setDFlags(dflags)
if hasattr(ts, 'setDFlags'):
dflags = ts.setDFlags(0)
if sysconf.get("rpm-noupgrade", False):
dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE
if sysconf.get("rpm-norequires", False):
dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES
if sysconf.get("rpm-noconflicts", False):
dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS
if sysconf.get("rpm-noobsoletes", False):
dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES
if sysconf.get("rpm-noparentdirs", False):
dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS
if sysconf.get("rpm-nolinktos", False):
dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS
if sysconf.get("rpm-nosuggest", False):
dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST
ts.setDFlags(dflags)

# Set rpm verbosity level.
levelname = sysconf.get('rpm-log-level')
Expand Down

0 comments on commit 87cc91c

Please sign in to comment.