Пример #1
0
def addInstall(self, item, key, how='u', relocs = None):

    if isinstance(item, str):
        f = file(item)
        header = self.hdrFromFdno(f)
        f.close()
    elif isinstance(item, file):
        header = self.hdrFromFdno(item)
    else:
        header = item

    if not how in ['u', 'i']:
        raise ValueError('how argument must be "u" or "i"')

    upgrade = (how == "u")

    if relocs:
        if type(relocs) == str:
            prefixes = header['prefixes']
            if relocs == '':
                relocs = []
            elif len(prefixes) > 0:
                relocs = [(prefixes[0], relocs)]
            else:
                raise ValueError('prefix given, but package is not relocatable')

        elif type(relocs) != list:
            raise ValueError("relocs argument must be either a string or a list");

        if not _rpmext.addInstall(self, header, key, upgrade, relocs):
            raise rpm.error("adding package to transaction failed")
        return

    if not _rpmts.addInstall(self, header, key, upgrade):
        raise rpm.error("adding package to transaction failed")
Пример #2
0
    def addInstall(self, item, key, how="u"):
        header = self._f2hdr(item)

        if how not in ['u', 'i']:
            raise ValueError('how argument must be "u" or "i"')
        upgrade = (how == "u")

        if not TransactionSetCore.addInstall(self, header, key, upgrade):
            raise rpm.error("adding package to transaction failed")
Пример #3
0
    def addInstall(self, item, key, how="u"):
        header = self._f2hdr(item)

        if not how in ['u', 'i']:
            raise ValueError('how argument must be "u" or "i"')
        upgrade = (how == "u")

        if not TransactionSetCore.addInstall(self, header, key, upgrade):
            raise rpm.error("adding package to transaction failed")
Пример #4
0
    def addInstall(self, item, key, how="u"):
        if isinstance(item, str):
            f = file(item)
            header = self.hdrFromFdno(f)
            f.close()
        elif isinstance(item, file):
            header = self.hdrFromFdno(item)
        else:
            header = item

        if not how in ['u', 'i']:
            raise ValueError('how argument must be "u" or "i"')
        upgrade = (how == "u")

        if not _rpmts.addInstall(self, header, key, upgrade):
            raise rpm.error("adding package to transaction failed")
    def addInstall(self, item, key, how="u"):
        if isinstance(item, _string_types):
            f = open(item)
            header = self.hdrFromFdno(f)
            f.close()
        elif isinstance(item, rpm.hdr):
            header = item
        else:
            header = self.hdrFromFdno(item)

        if not how in ['u', 'i']:
            raise ValueError('how argument must be "u" or "i"')
        upgrade = (how == "u")

        if not TransactionSetCore.addInstall(self, header, key, upgrade):
            raise rpm.error("adding package to transaction failed")
Пример #6
0
    def addInstall(self, item, key, how="u"):
        if isinstance(item, str):
            f = file(item)
            header = self.hdrFromFdno(f)
            f.close()
        elif isinstance(item, file):
            header = self.hdrFromFdno(item)
        else:
            header = item

        if not how in ['u', 'i']:
            raise ValueError('how argument must be "u" or "i"')
        upgrade = (how == "u")

        if not _rpmts.addInstall(self, header, key, upgrade):
            raise rpm.error("adding package to transaction failed")
Пример #7
0
    def addInstall(self, item, key, how="u"):
        if isinstance(item, basestring):
            f = file(item)
            header = self.hdrFromFdno(f)
            f.close()
        elif isinstance(item, file):
            header = self.hdrFromFdno(item)
        else:
            header = item

        if not how in ["u", "i"]:
            raise ValueError('how argument must be "u" or "i"')
        upgrade = how == "u"

        if not TransactionSetCore.addInstall(self, header, key, upgrade):
            raise rpm.error("adding package to transaction failed")