<commit_before>#!/bin/sh
#
# Copyright (C) 2006 rPath, Inc.
# All Rights Reserved
#

X86_FLAVOR='~X, ~!alternatives, !bootstrap, ~builddocs,~buildtests, ~desktop, ~dietlibc, ~emacs, ~gcj,~gnome, ~gtk, ~ipv6, ~kde, ~krb, ~ldap, ~nptl,pam, ~pcre, ~perl, ~!pie, ~python, ~qt,~readline, ~!sasl, ~!selinux, ssl, ~tcl,tcpwrappers, ~tk, ~!xen, ~!xfce is: x86(~cmov,~i486, ~i586, ~i686, ~mmx, ~sse, ~sse2)'
DATE=$(date +%Y_%m_%d)

function carp {
    echo "snapshot build failed"
    exit 1
}

function carp_rmake {
    jobid=$1
    nail -s 'rBuilder Snapshot Build Failed' $ERROR_MAIL << EOT
The rBuilder appliance build failed:

$(rmake q $jobid --logs)
EOT
exit 1
}

function rewrite_version {
    file=$1
    newver=$2

    sed -ri "s/(\s+)version \= '.+'/\1version \= \'$newver\'/" $file
}

function merge() {
    pushd $RECIPES_PATH
    [ -d $RECIPES_PATH/$1/ ] || cvc co $1
    pushd $1
    cvc merge
    rewrite_version $1.recipe $DATE
    popd
    popd
}

function commit() {
    pushd $RECIPES_PATH/$1
    cvc commit --message "automated commit for $DATE"
    # [ $? != 0 ] && carp
    popd
}

function cook() {
    # make sure we're in the contexted directory
    pushd $RECIPES_PATH
    cvc cook $1 || carp
    popd
}

function merge_and_cook() {
    merge $1
    commit $1
    cook $1
}

function create_build() {
    project=$1
    trove=$2
    type=$3
    options=$4

    TROVESPEC=$(conary rq --install-label $NIGHTLY_LABEL $trove --full-versions --flavors)
    eval $($CMDLINE_PATH/rbuilder build-create $project "$TROVESPEC" $type $options)
}

function fetch_build() {
    target_recipe=$1
    target_file=$2
<commit_msg>fix extra parameters passed into build-create<commit_after>#!/bin/sh
#
# Copyright (C) 2006 rPath, Inc.
# All Rights Reserved
#

X86_FLAVOR='~X, ~!alternatives, !bootstrap, ~builddocs,~buildtests, ~desktop, ~dietlibc, ~emacs, ~gcj,~gnome, ~gtk, ~ipv6, ~kde, ~krb, ~ldap, ~nptl,pam, ~pcre, ~perl, ~!pie, ~python, ~qt,~readline, ~!sasl, ~!selinux, ssl, ~tcl,tcpwrappers, ~tk, ~!xen, ~!xfce is: x86(~cmov,~i486, ~i586, ~i686, ~mmx, ~sse, ~sse2)'
DATE=$(date +%Y_%m_%d)

function carp {
    echo "snapshot build failed"
    exit 1
}

function carp_rmake {
    jobid=$1
    nail -s 'rBuilder Snapshot Build Failed' $ERROR_MAIL << EOT
The rBuilder appliance build failed:

$(rmake q $jobid --logs)
EOT
exit 1
}

function rewrite_version {
    file=$1
    newver=$2

    sed -ri "s/(\s+)version \= '.+'/\1version \= \'$newver\'/" $file
}

function merge() {
    pushd $RECIPES_PATH
    [ -d $RECIPES_PATH/$1/ ] || cvc co $1
    pushd $1
    cvc merge
    rewrite_version $1.recipe $DATE
    popd
    popd
}

function commit() {
    pushd $RECIPES_PATH/$1
    cvc commit --message "automated commit for $DATE"
    # [ $? != 0 ] && carp
    popd
}

function cook() {
    # make sure we're in the contexted directory
    pushd $RECIPES_PATH
    cvc cook $1 || carp
    popd
}

function merge_and_cook() {
    merge $1
    commit $1
    cook $1
}

function create_build() {
    project=$1; shift
    trove=$1; shift
    type=$1; shift

    TROVESPEC=$(conary rq --install-label $NIGHTLY_LABEL $trove --full-versions --flavors)
    eval $($CMDLINE_PATH/rbuilder build-create $project "$TROVESPEC" $type "$@")
}

function fetch_build() {
    target_recipe=$1
    target_file=$2

{'fraction_non_alphanumeric': 0.15928398058252427, 'fraction_numerical': 0.0245752427184466, 'mean_word_length': 3.3211009174311927, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '2349403', 'n_tokens_mistral': 1389, 'n_tokens_neox': 1310, 'n_words': 336}