Beispiel #1
0
        if not found:
            raise DistroError("package %r not found" % (sourcename))
        for pkgset in found:
            for filter in self._move_filters:
                filter.move(pkgset, trans, f_mediainfo, t_mediainfo,
                        self.mediaconfs, self.archconfs)
            msg = "moving %s-%s from %s to %s" % (sourcename,
                    pkgset.source().fullversion, frommedia, tomedia)
            trans.install(t_mediainfo, pkgset, msg, touches=(f_mediainfo,))
        trans.execute()

    def init(self):
        for media in self._urpmi_medias:
            media.init()

    def update(self, medianame=None):
        if medianame:
            medias = [self.mediaconfs.byname(medianame)]
        else:
            medias = self.mediaconfs.medias()
        for media in self._urpmi_medias:
            media.update()

distro_types = Registry("distro type")
distro_types.register("mandriva", MandrivaDistro)

def get_distro(distroconf, layoutconf, globalconf):
    klass = distro_types.get_class(distroconf.type)
    distro = klass(distroconf, layoutconf, globalconf)
    return distro
Beispiel #2
0
                trans.install(media, newpkgset, "debug package")

    def move(self, pkgset, trans, srcmedia, dstmedia, mediaset, archset):
        medianame = self._debug_name(srcmedia.name)
        mediainfo = mediaset.byname(medianame)
        if mediainfo is not None:
            sourcename = pkgset.source().name
            for cand in mediainfo.packages_by_source(sourcename):
                if cand.source().fullversion == pkgset.source().fullversion:
                    newname = self._debug_name(dstmedia.name)
                    newmedia = mediaset.byname(newname)
                    if newmedia:
                        trans.install(newmedia, cand, 
                            "moving debug packages",
                            touches=(mediainfo,))
                    else:
                        logger.debug("cannot find target debug media %r",
                                newname)

filters = Registry("layout package filter")
filters.register("default-media", DefaultMedia)
filters.register("package-list", PackageList)
filters.register("required-arch", RequiredArch)
filters.register("older", Older)
filters.register("release", Release)
filters.register("sign", Sign)
filters.register("debug", Debug)

def get_filter(name, distroconf):
    return filters.get_instance(name, distroconf)