<commit_before>#!/usr/bin/python -u

import sys
import os
import subprocess
import time
import datetime
import shutil
import tempfile
import hashlib
import re

debug = False

################
#### Telegraf Variables
################

# Packaging variables
PACKAGE_NAME = "telegraf"
INSTALL_ROOT_DIR = "/usr/bin"
LOG_DIR = "/var/log/telegraf"
SCRIPT_DIR = "/usr/lib/telegraf/scripts"
CONFIG_DIR = "/etc/telegraf"
LOGROTATE_DIR = "/etc/logrotate.d"

INIT_SCRIPT = "scripts/init.sh"
SYSTEMD_SCRIPT = "scripts/telegraf.service"
LOGROTATE_SCRIPT = "etc/logrotate.d/telegraf"
DEFAULT_CONFIG = "etc/telegraf.conf"
DEFAULT_WINDOWS_CONFIG = "etc/telegraf_windows.conf"
POSTINST_SCRIPT = "scripts/post-install.sh"
PREINST_SCRIPT = "scripts/pre-install.sh"

# Default AWS S3 bucket for uploads
DEFAULT_BUCKET = "get.influxdb.org/telegraf"

CONFIGURATION_FILES = [
    CONFIG_DIR + '/telegraf.conf',
    LOGROTATE_DIR + '/telegraf',
]

# META-PACKAGE VARIABLES
PACKAGE_LICENSE = "MIT"
PACKAGE_URL = "https://github.com/influxdata/telegraf"
MAINTAINER = "<EMAIL>"
VENDOR = "InfluxData"
DESCRIPTION = "Plugin-driven server agent for reporting metrics into InfluxDB."

# SCRIPT START
prereqs = [ 'git', 'go' ]
go_vet_command = "go tool vet -composites=true ./"
optional_prereqs = [ 'gvm', 'fpm', 'rpmbuild' ]

fpm_common_args = "-f -s dir --log error \
 --vendor {} \
 --url {} \
 --license {} \
 --maintainer {} \
 --config-files {} \
 --config-files {} \
 --after-install {} \
 --before-install {} \
 --description \"{}\"".format(
    VENDOR,
    PACKAGE_URL,
    PACKAGE_LICENSE,
    MAINTAINER,
    CONFIG_DIR + '/telegraf.conf',
    LOGROTATE_DIR + '/telegraf',
    POSTINST_SCRIPT,
    PREINST_SCRIPT,
    DESCRIPTION)

targets = {
    'telegraf' : './cmd/telegraf',
}

supported_builds = {
    "darwin": [ "amd64", "i386" ],
    "windows": [ "amd64", "i386" ],
    "linux": [ "amd64", "i386", "armhf", "armel", "arm64" ],
    "freebsd": [ "amd64" ]
}

supported_packages = {
    "darwin": [ "tar", "zip" ],
    "linux": [ "deb", "rpm", "tar" ],
    "windows": [ "zip" ],
    "freebsd": [ "tar" ]
}

supported_tags = {
    # "linux": {
    #     "amd64": ["sensors"]
    # }
}

prereq_cmds = {
    # "linux": "sudo apt-get install lm-sensors libsensors4-dev"
}

################
#### Telegraf Functions
################

def create_package_fs(build_root):<commit_msg>Removed i386 as a target for darwin, as it currently doesnt compile.<commit_after>#!/usr/bin/python -u

import sys
import os
import subprocess
import time
import datetime
import shutil
import tempfile
import hashlib
import re

debug = False

################
#### Telegraf Variables
################

# Packaging variables
PACKAGE_NAME = "telegraf"
INSTALL_ROOT_DIR = "/usr/bin"
LOG_DIR = "/var/log/telegraf"
SCRIPT_DIR = "/usr/lib/telegraf/scripts"
CONFIG_DIR = "/etc/telegraf"
LOGROTATE_DIR = "/etc/logrotate.d"

INIT_SCRIPT = "scripts/init.sh"
SYSTEMD_SCRIPT = "scripts/telegraf.service"
LOGROTATE_SCRIPT = "etc/logrotate.d/telegraf"
DEFAULT_CONFIG = "etc/telegraf.conf"
DEFAULT_WINDOWS_CONFIG = "etc/telegraf_windows.conf"
POSTINST_SCRIPT = "scripts/post-install.sh"
PREINST_SCRIPT = "scripts/pre-install.sh"

# Default AWS S3 bucket for uploads
DEFAULT_BUCKET = "get.influxdb.org/telegraf"

CONFIGURATION_FILES = [
    CONFIG_DIR + '/telegraf.conf',
    LOGROTATE_DIR + '/telegraf',
]

# META-PACKAGE VARIABLES
PACKAGE_LICENSE = "MIT"
PACKAGE_URL = "https://github.com/influxdata/telegraf"
MAINTAINER = "<EMAIL>"
VENDOR = "InfluxData"
DESCRIPTION = "Plugin-driven server agent for reporting metrics into InfluxDB."

# SCRIPT START
prereqs = [ 'git', 'go' ]
go_vet_command = "go tool vet -composites=true ./"
optional_prereqs = [ 'gvm', 'fpm', 'rpmbuild' ]

fpm_common_args = "-f -s dir --log error \
 --vendor {} \
 --url {} \
 --license {} \
 --maintainer {} \
 --config-files {} \
 --config-files {} \
 --after-install {} \
 --before-install {} \
 --description \"{}\"".format(
    VENDOR,
    PACKAGE_URL,
    PACKAGE_LICENSE,
    MAINTAINER,
    CONFIG_DIR + '/telegraf.conf',
    LOGROTATE_DIR + '/telegraf',
    POSTINST_SCRIPT,
    PREINST_SCRIPT,
    DESCRIPTION)

targets = {
    'telegraf' : './cmd/telegraf',
}

supported_builds = {
    "darwin": [ "amd64" ],
    "windows": [ "amd64", "i386" ],
    "linux": [ "amd64", "i386", "armhf", "armel", "arm64" ],
    "freebsd": [ "amd64" ]
}

supported_packages = {
    "darwin": [ "tar", "zip" ],
    "linux": [ "deb", "rpm", "tar" ],
    "windows": [ "zip" ],
    "freebsd": [ "tar" ]
}

supported_tags = {
    # "linux": {
    #     "amd64": ["sensors"]
    # }
}

prereq_cmds = {
    # "linux": "sudo apt-get install lm-sensors libsensors4-dev"
}

################
#### Telegraf Functions
################

def create_package_fs(build_root):
{'fraction_non_alphanumeric': 0.18790678144026873, 'fraction_numerical': 0.009657778710896493, 'mean_word_length': 3.754491017964072, 'pattern_counts': {'":': 22, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1306293', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1765, 'n_words': 349}