<commit_before>#!/bin/bash
#
# Update Perl module dependencies to their latest versions.
#
# This script removes cpanfile.snapshot, Carton's cache and modules themselves so Carton is then
# forced to check for new versions of modules.
#

if [ ! -f cpanfile ]; then
    echo "Run this script from the root of the Media Cloud repository."
    exit 1
fi

# Update Carton
source ./script/set_perl_brew_environment.sh
cpanm Carton

# Remove modules and Carton's cache, then reinstall the modules
rm -rf .carton/
rm -rf local/
rm cpanfile.snapshot

# Gearman::XS, the dependency of Gearman::JobScheduler, depends on
# Module::Install, but the author of the module (probably) forgot to add it so
# the list of dependencies (https://rt.cpan.org/Ticket/Display.html?id=89690),
# so installing it separately
mkdir -p local/
./script/run_with_carton.sh ~/perl5/perlbrew/bin/cpanm -L local/ Module::Install

source ./script/set_java_home.sh
JAVA_HOME=$JAVA_HOME ./script/run_carton.sh install  # running with "--deployment" would not regenerate cpanfile.snapshot

<commit_msg>Use "carton update" for updating modules instead of reinstalling everything [ci skip]<commit_after>#!/bin/bash
#
# Update Perl module dependencies to their latest versions.
#

if [ ! -f cpanfile ]; then
    echo "Run this script from the root of the Media Cloud repository."
    exit 1
fi

# Update Carton
source ./script/set_perl_brew_environment.sh
cpanm Carton

# Gearman::XS, the dependency of Gearman::JobScheduler, depends on
# Module::Install, but the author of the module (probably) forgot to add it so
# the list of dependencies (https://rt.cpan.org/Ticket/Display.html?id=89690),
# so installing it separately
mkdir -p local/
./script/run_with_carton.sh ~/perl5/perlbrew/bin/cpanm -L local/ Module::Install

source ./script/set_java_home.sh
JAVA_HOME=$JAVA_HOME ./script/run_carton.sh update

{'fraction_non_alphanumeric': 0.09646302250803858, 'fraction_numerical': 0.007502679528403001, 'mean_word_length': 4.395953757225434, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6943208', 'n_tokens_mistral': 616, 'n_tokens_neox': 578, 'n_words': 208}