<commit_before>'''
Created on Dec 26, 2012

__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2013, Intel Corp."
__credits__ = ["<NAME>"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
'''

from buildbot.steps.shell import ShellCommand
import os
from twisted.python import log

class CreateAutoConf(ShellCommand):
    haltOnFailure = False 
    flunkOnFailure = True 
    name = "CreateAutoConf" 
    def __init__(self, factory, argdict=None, **kwargs):
        self.machine=""
        self.buildapp=""
        self.distro="poky"
        self.packages=None
        self.buildhistory=False
        self.gplv3=True
        self.multilib=False
        self.swabber=False
        self.x32=False
        self.atext=None
        self.emgd=False
        self.pvr=False
        self.atextprepend=None
        self.atextappend=None
        self.SDKMACHINE="i686"
        self.adtdev=False
        self.factory = factory
        self.buildappsrcrev = "${AUTOREV}"
        self.initmgr=None
        self.kwargs = kwargs
        for k, v in argdict.iteritems():
            if type(v) is bool:
                setattr(self, k, str(v))
            else:
                setattr(self, k, v)
        self.description = "Create Auto Configuration"
        ShellCommand.__init__(self, **kwargs)

    def start(self):
        buildername=self.getProperty("buildername")
        distroversion=self.getProperty("distroversion")
        layerversion = self.getProperty("layerversion_yoctobsp")
        fout = ""
        #check to see if we have a prepend
        if self.atextprepend:
            fout = fout + self.atextprepend
        #check to see if we have text override
        if self.atext:
            fout = fout+self.atext
        else:
            if self.distro != "oecore":
                fout = fout + 'DISTRO = "' + self.distro + '"\n'
            if self.packages:
                self.classes = [ "package_%s" % p for p in self.packages.split() ]
                fout = fout + 'PACKAGE_CLASSES = "' + " ".join(self.classes) + '"\n'
            else:
                fout = fout + 'PACKAGE_CLASSES = "package_rpm package_deb package_ipk"\n'
            fout = fout + 'BB_NUMBER_THREADS = "' + os.environ.get('BB_NUMBER_THREADS') + '"\n'
            fout = fout + 'PARALLEL_MAKE = "-j ' + os.environ.get('PARALLEL_MAKE') + '"\n'
            fout = fout + 'SDKMACHINE ?= "' + self.SDKMACHINE + '"\n'
            buildprops = self.getProperties().asDict()
            for k, v in buildprops.iteritems():
                if "buildappsrcrev" in k:
                    self.buildappsrcrev=v[0]
            if self.buildapp == "True":
                if self.buildappsrcrev == "AUTOREV":
                    self.buildappsrcrev="${AUTOREV}"
                fout = fout + 'DL_DIR ?= "${TOPDIR}/downloads"\n'
                fout = fout + 'INHERIT += "own-mirrors"\n'
                fout = fout + 'SOURCE_MIRROR_URL = "file:///' + os.environ.get('SOURCE_DL_DIR') +'"\n'
                if self.buildappsrcrev != "DEFAULT":
                    fout = fout + 'SRCREV_pn-build-appliance-image = "' + self.buildappsrcrev + '"\n'
            else:
                fout = fout + 'DL_DIR = "' + os.environ.get('SOURCE_DL_DIR')+'"\n'
            if self.emgd == "True":
                fout = fout + 'LICENSE_FLAGS_WHITELIST = "license_emgd-driver-bin" \n'
            if self.pvr == "True":
                fout = fout + 'LICENSE_FLAGS_WHITELIST += "license_cdv-pvr-driver" \n'
                fout = fout + 'PVR_LICENSE = "yes" \n'
            if self.multilib:
                fout = fout + 'require conf/multilib.conf \n'
                if self.multilib == "True" or self.multilib == "lib32":
                    fout = fout + 'MULTILIBS = "multilib:lib32" \n'
                    fout = fout + 'DEFAULTTUNE_virtclass-multilib-lib32 = "x86" \n'
                elif self.multilib == "lib64":
                    fout = fout + 'MULTILIBS = "multilib:lib64" \n'
                    fout = fout + 'DEFAULTTUNE_virtclass-multilib-lib64 = "x86-64" \n'
                fout = fout + 'SSTATE_DIR ?= "' + os.environ.get("SSTATE_PUBLISH_DIR") + '/multilib" \n'
            else:<commit_msg>CreateAutoConf: LICENSE_FLAGS_WHITELIST to +=<commit_after>'''
Created on Dec 26, 2012

__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2013, Intel Corp."
__credits__ = ["<NAME>"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
'''

from buildbot.steps.shell import ShellCommand
import os
from twisted.python import log

class CreateAutoConf(ShellCommand):
    haltOnFailure = False 
    flunkOnFailure = True 
    name = "CreateAutoConf" 
    def __init__(self, factory, argdict=None, **kwargs):
        self.machine=""
        self.buildapp=""
        self.distro="poky"
        self.packages=None
        self.buildhistory=False
        self.gplv3=True
        self.multilib=False
        self.swabber=False
        self.x32=False
        self.atext=None
        self.emgd=False
        self.pvr=False
        self.atextprepend=None
        self.atextappend=None
        self.SDKMACHINE="i686"
        self.adtdev=False
        self.factory = factory
        self.buildappsrcrev = "${AUTOREV}"
        self.initmgr=None
        self.kwargs = kwargs
        for k, v in argdict.iteritems():
            if type(v) is bool:
                setattr(self, k, str(v))
            else:
                setattr(self, k, v)
        self.description = "Create Auto Configuration"
        ShellCommand.__init__(self, **kwargs)

    def start(self):
        buildername=self.getProperty("buildername")
        distroversion=self.getProperty("distroversion")
        layerversion = self.getProperty("layerversion_yoctobsp")
        fout = ""
        #check to see if we have a prepend
        if self.atextprepend:
            fout = fout + self.atextprepend
        #check to see if we have text override
        if self.atext:
            fout = fout+self.atext
        else:
            if self.distro != "oecore":
                fout = fout + 'DISTRO = "' + self.distro + '"\n'
            if self.packages:
                self.classes = [ "package_%s" % p for p in self.packages.split() ]
                fout = fout + 'PACKAGE_CLASSES = "' + " ".join(self.classes) + '"\n'
            else:
                fout = fout + 'PACKAGE_CLASSES = "package_rpm package_deb package_ipk"\n'
            fout = fout + 'BB_NUMBER_THREADS = "' + os.environ.get('BB_NUMBER_THREADS') + '"\n'
            fout = fout + 'PARALLEL_MAKE = "-j ' + os.environ.get('PARALLEL_MAKE') + '"\n'
            fout = fout + 'SDKMACHINE ?= "' + self.SDKMACHINE + '"\n'
            buildprops = self.getProperties().asDict()
            for k, v in buildprops.iteritems():
                if "buildappsrcrev" in k:
                    self.buildappsrcrev=v[0]
            if self.buildapp == "True":
                if self.buildappsrcrev == "AUTOREV":
                    self.buildappsrcrev="${AUTOREV}"
                fout = fout + 'DL_DIR ?= "${TOPDIR}/downloads"\n'
                fout = fout + 'INHERIT += "own-mirrors"\n'
                fout = fout + 'SOURCE_MIRROR_URL = "file:///' + os.environ.get('SOURCE_DL_DIR') +'"\n'
                if self.buildappsrcrev != "DEFAULT":
                    fout = fout + 'SRCREV_pn-build-appliance-image = "' + self.buildappsrcrev + '"\n'
            else:
                fout = fout + 'DL_DIR = "' + os.environ.get('SOURCE_DL_DIR')+'"\n'
            if self.emgd == "True":
                fout = fout + 'LICENSE_FLAGS_WHITELIST += "license_emgd-driver-bin" \n'
            if self.pvr == "True":
                fout = fout + 'LICENSE_FLAGS_WHITELIST += "license_cdv-pvr-driver" \n'
                fout = fout + 'PVR_LICENSE = "yes" \n'
            if self.multilib:
                fout = fout + 'require conf/multilib.conf \n'
                if self.multilib == "True" or self.multilib == "lib32":
                    fout = fout + 'MULTILIBS = "multilib:lib32" \n'
                    fout = fout + 'DEFAULTTUNE_virtclass-multilib-lib32 = "x86" \n'
                elif self.multilib == "lib64":
                    fout = fout + 'MULTILIBS = "multilib:lib64" \n'
                    fout = fout + 'DEFAULTTUNE_virtclass-multilib-lib64 = "x86-64" \n'
                fout = fout + 'SSTATE_DIR ?= "' + os.environ.get("SSTATE_PUBLISH_DIR") + '/multilib" \n'
            else:
{'fraction_non_alphanumeric': 0.1289030281607164, 'fraction_numerical': 0.008719217626958879, 'mean_word_length': 1.8870748299319728, 'pattern_counts': {'":': 16, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '679385', 'n_tokens_mistral': 2874, 'n_tokens_neox': 2755, 'n_words': 564}