yum插件降级

时间:2015-04-17 14:25:18

标签: python linux redhat yum

我为yum编写了一个插件,用于在降级期间删除特定的rpm。但是我希望在yum更新其他rpms之前删除rpm。 (想要使用yum插件限制订单,而不是在spec文件中执行)

我们可以在yum插件的yum降级/升级/安装过程中限制更新/安装/删除/清除/擦除的顺序吗?

yum插件的内容:

def postresolve_hook(conduit):
        tsInfo = conduit.getTsInfo()
        rpmdb = conduit.getRpmDB()
        oldlen = 0
        while oldlen != len(tsInfo):
                oldlen = len(tsInfo)
                opts , commands = conduit.getCmdLine()
                conduit.info(2, commands[0])
                # If the command line input is 'update'/'upgrade'/'install' and 'sde rpm state is UPDATE' then remove these five rpms. 
                if ( commands[0] == ‘downgrade' ) and ( commands[1] == 'sde' ):
                                for txmbr in tsInfo.getMembersWithState(output_states=[TS_INSTALL]):
                                                if txmbr.name == 'sde' and txmbr.version < '7.30':
                                                                conduit._base.remove(name='tclkit', arch='x86_64')
                                                                conduit._base.downgrade(name='svpermissions', arch='x86_64')  
conduit._base.downgrade(name='svsde', arch='x86_64')    

注意:我想限制突出显示部分的顺序。首先删除然后降级其他rpms。但是yum内部会先进行更新/安装,然后再进行擦除/删除。

0 个答案:

没有答案