Exemplo n.º 1
0
    def add_dependencies(self, dependencies):
        # special case of given one dependency package
        # with depedency versioning info [**kw, name]
        # [{"versionFrom":"0.4.2"}, "udev"]
        if type(dependencies[0]) == dict:
            dep = Dependency()
            (kw, dep.package) = dependencies
            dep.__dict__[list(kw.keys())[0]] = list(kw.values())[0]
            self.package.packageDependencies.append(dep)
            return

        for depname in dependencies:
            dep = Dependency()
            dep.package = depname
            self.package.packageDependencies.append(dep)
Exemplo n.º 2
0
    def set_package(self, dependencies, conflicts):
        self.package.name = self.name

        if dependencies:
            for depname in dependencies:
                dep = Dependency()
                dep.package = depname
                self.package.packageDependencies.append(dep)

        if conflicts:
            for package in conflicts:
                conflict = Conflict()
                conflict.package = package
                self.package.conflicts.append(conflict)

        self.pspec.packages.append(self.package)