~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/utils/packaging/config/centos_constants.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2015 Canonical Ltd.
 
2
// Copyright 2015 Cloudbase Solutions SRL
 
3
// Licensed under the LGPLv3, see LICENCE file for details.
 
4
 
 
5
package config
 
6
 
 
7
import (
 
8
        "github.com/juju/utils/packaging"
 
9
)
 
10
 
 
11
const (
 
12
        // CentOSCloudArchiveUrl is the url of the (future) cloud archive for CentOS.
 
13
        // TODO (people of the distant future): add this when it is available.
 
14
        // CentOSCloudArchiveUrl = "http://fill-me-in.com/cloud-archive.repo"
 
15
 
 
16
        // CentOSSourcesFile is the default file which lists all core sources
 
17
        // for yum packages on CentOS.
 
18
        CentOSSourcesFile = "/etc/yum/repos.d/CentOS-Base.repo"
 
19
 
 
20
        // ReplaceCentOSMirror is a mini-script which replaces the default CentOS
 
21
        // mirros with the one formatted in.
 
22
        ReplaceCentOSMirror = "sed -r -i -e 's|^mirrorlist|#mirrorlist|g' -e 's|#baseurl=.*|baseurl=%s|g' " +
 
23
                CentOSSourcesFile
 
24
)
 
25
 
 
26
// CentOSDefaultPackages is the default package set we'd like installed
 
27
// on all CentOS machines.
 
28
var CentOSDefaultPackages = append(DefaultPackages, []string{
 
29
        // TODO (aznashwan, all): further populate this list.
 
30
        "epel-release",
 
31
        "yum-utils",
 
32
}...)
 
33
 
 
34
// cloudArchivePackagesCentOS maintains a list of CentOS packages that
 
35
// Configurer.IsCloudArchivePackage will reference when determining the
 
36
// repository from which to install a package.
 
37
var cloudArchivePackagesCentOS = map[string]struct{}{
 
38
// TODO (aznashwan, all): if a separate repository for
 
39
// CentOS 7+ especially for Juju is to ever occur, please add the relevant
 
40
// package listings here.
 
41
}
 
42
 
 
43
// centOSToUbuntuPackageNameMap is a map for converting package names from
 
44
// their names as found in CentOS repositories to their equivalent in Ubuntu.
 
45
// It is implemented as the flipped package mapper for Ubuntu.
 
46
var centOSToUbuntuPackageNameMap = flipMap(ubuntuToCentOSPackageNameMap)
 
47
 
 
48
// configureCloudArchiveSourceCentOS is a helper function which returns the
 
49
// cloud archive PackageSource and PackagePreferences for the given series for
 
50
// CentOS machines.
 
51
func configureCloudArchiveSourceCentOS(series string) (packaging.PackageSource, packaging.PackagePreferences) {
 
52
        // TODO (aznashwan, all): implement this when the
 
53
        // archive for CentOS goes up.
 
54
        return packaging.PackageSource{}, packaging.PackagePreferences{}
 
55
}
 
56
 
 
57
// getTargetReleaseSpecifierCentOS returns the specifier that can be passed to
 
58
// yum in order to ensure that it pulls the package from that particular source.
 
59
func getTargetReleaseSpecifierCentOS(series string) string {
 
60
        // TODO (aznashwan, all): add these when the archive for CentOS goes up.
 
61
        return ""
 
62
}