File: configurer_zypper.go

package info (click to toggle)
golang-github-juju-utils 0.0~git20171220.f38c0b0-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,748 kB
  • sloc: makefile: 20
file content (32 lines) | stat: -rw-r--r-- 1,130 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright 2017 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.
// Copied from configurer_yum.go (with all pending TODOs)

package config

import (
	"github.com/juju/utils/packaging"
)

// yumConfigurer is the PackagingConfigurer implementation for apt-based systems.
type zypperConfigurer struct {
	*baseConfigurer
}

// RenderSource is defined on the PackagingConfigurer interface.
func (c *zypperConfigurer) RenderSource(src packaging.PackageSource) (string, error) {
	return src.RenderSourceFile(ZypperSourceTemplate)
}

// RenderPreferences is defined on the PackagingConfigurer interface.
func (c *zypperConfigurer) RenderPreferences(src packaging.PackagePreferences) (string, error) {
	// TODO (aznashwan): research a way of using zypper-priorities in the context
	// of single/multiple package pinning and implement it.
	return "", nil
}

// ApplyCloudArchiveTarget is defined on the PackagingConfigurer interface.
func (c *zypperConfigurer) ApplyCloudArchiveTarget(pack string) []string {
	// TODO (aznashwan): implement target application when archive is available.
	return []string{pack}
}