<commit_before>#!/bin/sh
export AWS_ACCESS_KEY_ID=${aws_access_key}
export AWS_SECRET_ACCESS_KEY=${aws_secret_key}
export AWS_DEFAULT_REGION=${aws_region}

# Copies poudriere configuration to S3
aws s3 sync /usr/local/etc s3://${s3_bucket_name}/pdr \
    --acl 'public-read'                               \
    --only-show-errors                                \
    --delete                                          \
    --exclude "*"                                     \
    --include "poudriere*"

# Copies built packages to S3
for dir in /usr/local/poudriere/data/packages/*/
do
    aws s3 sync "$dir.latest/" "s3://${s3_bucket_name}/pkg/$(basename $dir)" \
        --acl 'public-read'                                                  \
        --only-show-errors                                                   \
        --delete
done

# vim:set ft=sh:
<commit_msg>Adds test whether there are packages for uploading<commit_after>#!/bin/sh
export AWS_ACCESS_KEY_ID=${aws_access_key}
export AWS_SECRET_ACCESS_KEY=${aws_secret_key}
export AWS_DEFAULT_REGION=${aws_region}

# Copies poudriere configuration to S3
aws s3 sync /usr/local/etc s3://${s3_bucket_name}/pdr \
    --acl 'public-read'                               \
    --only-show-errors                                \
    --delete                                          \
    --exclude "*"                                     \
    --include "poudriere*"

# Copies built packages to S3
for dir in /usr/local/poudriere/data/packages/*/
do
    if [ -d "$dir" ]
    then
        aws s3 sync "$dir.latest/" "s3://${s3_bucket_name}/pkg/$(basename $dir)" \
            --acl 'public-read'                                                  \
            --only-show-errors                                                   \
            --delete
    fi
done

# vim:set ft=sh:

{'fraction_non_alphanumeric': 0.11425462459194777, 'fraction_numerical': 0.008705114254624592, 'mean_word_length': 1.1892857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6634744', 'n_tokens_mistral': 516, 'n_tokens_neox': 514, 'n_words': 106}