aboutsummaryrefslogtreecommitdiff
blob: 85c6e98ee7fdbec36f4ea9966c998c57513397ca (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#
# xfce.py
#
# Copyright (C) 2010 Fabio Erculiani
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

from installclass import BaseInstallClass
from constants import *
from product import *
from flags import flags
import os, types
import iutil

import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)

import installmethod

from gentoo import Entropy
from gentoo.livecd import LiveCDCopyBackend

class InstallClass(BaseInstallClass):

    id = "gentoo_corecd"
    name = N_("Gentoo Core CD")

    _pixmap_dirs = os.getenv("PIXMAPPATH", "/usr/share/pixmaps").split(":")
    for _pix_dir in _pixmap_dirs:
        _pix_path = os.path.join(_pix_dir, "gentoo-core.png")
        if os.path.isfile(_pix_path):
            pixmap = _pix_path

    dmrc = None
    simplenet = True
    _description = N_("Select this installation type to just install "
         "a Core System without graphical applications. "
         "This is the best choice for Server-oriented "
         "deployments.")
    _descriptionFields = (productName,)
    sortPriority = 10000

    if not Entropy.is_corecd():
        hidden = 1

    def configure(self, anaconda):
        BaseInstallClass.configure(self, anaconda)
        BaseInstallClass.setDefaultPartitioning(self,
            anaconda.storage, anaconda.platform)

    def setSteps(self, anaconda):
        BaseInstallClass.setSteps(self, anaconda)
        anaconda.dispatch.skipStep("welcome", skip = 1)
        #anaconda.dispatch.skipStep("network", skip = 1)

    def getBackend(self):
        return LiveCDCopyBackend

    def productMatches(self, oldprod):
        if oldprod is None:
            return False

        if oldprod.startswith(productName):
            return True

        return False

    def versionMatches(self, oldver):
        try:
            oldVer = float(oldver)
            newVer = float(productVersion)
        except ValueError:
            return True

        return newVer >= oldVer

    def __init__(self):
        BaseInstallClass.__init__(self)