<commit_before>#
# Copyright (c) 2007-2009 rPath, Inc.
# All rights reserved
#

import os
import sys
sys.path.insert(0, '/usr/lib/anaconda/installclasses')

from pykickstart.constants import CLEARPART_TYPE_ALL
from rhpl.translate import N_

import bootloader
import iutil
import partRequests
import parted
from fsset import FileSystemType, fileSystemTypeGet, fileSystemTypeGetDefault, fileSystemTypeRegister
from constants import BL_EXTLINUX
from rpathapp import InstallClass as BaseInstallClass


class blankFileSystem(FileSystemType):
    def __init__(self):
        FileSystemType.__init__(self)
        self.partedFileSystemType = parted.file_system_type_get("ext2")
        self.formattable = 1
        self.checked = 0
        self.linuxnativefs = 0
        self.name = "blank"
        self.supported = 0
        self.maxSizeMB = 8 * 1024 * 1024
        self.packages = []

    def formatDevice(self, entry, progress, chroot='/'):
        pass

fileSystemTypeRegister(blankFileSystem())

class InstallClass(BaseInstallClass):
    hidden = 0

    id = "rbuilder"
    name = N_("r_Builder")
    pixmap = "rpath-color-graphic-only.png"
    description = N_("rBuilder Appliance install type.")

    sortPriority = 100
    showLoginChoice = 1

    in_advanced_mode = False

    def setInstallData(self, anaconda):
        BaseInstallClass.setInstallData(self, anaconda)
        anaconda.id.partitions.autoClearPartType = CLEARPART_TYPE_ALL
        anaconda.id.bootloader.setBootLoader(BL_EXTLINUX)

        anaconda.id.rootPassword['password'] = ''
        anaconda.id.rootPassword['<PASSWORD>'] = True

        anaconda.backend.addManifest('jspreload', optional=True)

    def setSteps(self, anaconda):
        BaseInstallClass.setSteps(self, anaconda);
        anaconda.dispatch.skipStep("authentication")
        anaconda.dispatch.skipStep("bootloader", permanent = 1)
        anaconda.dispatch.skipStep("package-selection")
        anaconda.dispatch.skipStep("firewall")
        anaconda.dispatch.skipStep("confirminstall")
        self.set_advanced(False, anaconda)

    def set_advanced(self, enabled, anaconda):
        self.in_advanced_mode = enabled
        anaconda.dispatch.skipStep('parttype', skip=not enabled)
        anaconda.dispatch.skipStep('partition', skip=not enabled)
        anaconda.dispatch.skipStep('network', skip=not enabled)
        anaconda.dispatch.skipStep('timezone', skip=not enabled)
        anaconda.dispatch.skipStep('accounts', skip=not enabled)
        anaconda.dispatch.skipStep('complete', skip=not enabled)

    def setDefaultPartitioning(self, partitions, clear = CLEARPART_TYPE_ALL,
                               doClear = 1):<commit_msg>Add reference to distpreload manifest in anaconda_custom<commit_after>#
# Copyright (c) 2007-2009 rPath, Inc.
# All rights reserved
#

import os
import sys
sys.path.insert(0, '/usr/lib/anaconda/installclasses')

from pykickstart.constants import CLEARPART_TYPE_ALL
from rhpl.translate import N_

import bootloader
import iutil
import partRequests
import parted
from fsset import FileSystemType, fileSystemTypeGet, fileSystemTypeGetDefault, fileSystemTypeRegister
from constants import BL_EXTLINUX
from rpathapp import InstallClass as BaseInstallClass


class blankFileSystem(FileSystemType):
    def __init__(self):
        FileSystemType.__init__(self)
        self.partedFileSystemType = parted.file_system_type_get("ext2")
        self.formattable = 1
        self.checked = 0
        self.linuxnativefs = 0
        self.name = "blank"
        self.supported = 0
        self.maxSizeMB = 8 * 1024 * 1024
        self.packages = []

    def formatDevice(self, entry, progress, chroot='/'):
        pass

fileSystemTypeRegister(blankFileSystem())

class InstallClass(BaseInstallClass):
    hidden = 0

    id = "rbuilder"
    name = N_("r_Builder")
    pixmap = "rpath-color-graphic-only.png"
    description = N_("rBuilder Appliance install type.")

    sortPriority = 100
    showLoginChoice = 1

    in_advanced_mode = False

    def setInstallData(self, anaconda):
        BaseInstallClass.setInstallData(self, anaconda)
        anaconda.id.partitions.autoClearPartType = CLEARPART_TYPE_ALL
        anaconda.id.bootloader.setBootLoader(BL_EXTLINUX)

        anaconda.id.rootPassword['password'] = ''
        anaconda.id.rootPassword['<PASSWORD>'] = True

        anaconda.backend.addManifest('jspreload', optional=True)
        anaconda.backend.addManifest('distpreload', optional=True)

    def setSteps(self, anaconda):
        BaseInstallClass.setSteps(self, anaconda);
        anaconda.dispatch.skipStep("authentication")
        anaconda.dispatch.skipStep("bootloader", permanent = 1)
        anaconda.dispatch.skipStep("package-selection")
        anaconda.dispatch.skipStep("firewall")
        anaconda.dispatch.skipStep("confirminstall")
        self.set_advanced(False, anaconda)

    def set_advanced(self, enabled, anaconda):
        self.in_advanced_mode = enabled
        anaconda.dispatch.skipStep('parttype', skip=not enabled)
        anaconda.dispatch.skipStep('partition', skip=not enabled)
        anaconda.dispatch.skipStep('network', skip=not enabled)
        anaconda.dispatch.skipStep('timezone', skip=not enabled)
        anaconda.dispatch.skipStep('accounts', skip=not enabled)
        anaconda.dispatch.skipStep('complete', skip=not enabled)

    def setDefaultPartitioning(self, partitions, clear = CLEARPART_TYPE_ALL,
                               doClear = 1):
{'fraction_non_alphanumeric': 0.09565534866739686, 'fraction_numerical': 0.01095290251916758, 'mean_word_length': 3.5393537696768846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '87054', 'n_tokens_mistral': 1710, 'n_tokens_neox': 1616, 'n_words': 319}