<commit_before>#!/bin/sh

[ "$1" != "--run" ] && echo "Install php8 (or upgrade from php7)" && exit

distro="$($DISTRVENDOR -d)" ; [ "$distro" = "ALTLinux" ] || [ "$distro" = "ALTServer" ] || { echo "Only ALTLinux is supported" ; exit 1 ; }

# TODO: check for apache2-mod_php7

if epmqp --quiet php7- ; then
    # Upgrade if was installed php5
    epmqp php7 --short | sed -e "s|php7-http||" -e "s|php7-raphf||" -e "s|php7-propro||" -e "s|php7-memcache||" -e "s|php7|php8.1|" | epmi --auto

    epme php7-libs
else
    # Install all packages
    epmi php8 php8-mbstring php8-pdo php8-curl php8-fileinfo php8-dom php8-exif php8-pdo_mysql php8-mysqli php8-pcntl php8-openssl php8-mcrypt php8-gd2 php8-xmlreader php8-memcached php8-xsl php8-zip php8-redis php8-opcache
    #echo "Think twice about php8-imagick. See https://bugzilla.altlinux.org/show_bug.cgi?id=39033"
fi
<commit_msg>prescription/php8.sh: fix upgrade<commit_after>#!/bin/sh

[ "$1" != "--run" ] && echo "Install php8 (or upgrade from php7)" && exit

distro="$($DISTRVENDOR -d)" ; [ "$distro" = "ALTLinux" ] || [ "$distro" = "ALTServer" ] || { echo "Only ALTLinux is supported" ; exit 1 ; }

# TODO: check for apache2-mod_php7

if epmqp --quiet php7- ; then
    # Upgrade if was installed php7
    epmqp php7 --short | grep -v "rpm-build-php" | sed  -e "s|php7-http||" -e "s|php7-xmlrpc||" -e "s|php7-krb5||" -e "s|php7-raphf||" -e "s|php7-propro||" -e "s|php7-memcache$||" -e "s|php7-apcu_bc$||" -e "s|php7-enchant||" -e "s|php7-pdo_sqlsrv$||" -e "s|php7-sqlsrv$||" -e "s|php7-geoip||" -e "s|php7|php8.1|" | epmi --auto

    epme php7-libs
else
    # Install all packages
    epmi php8 php8-mbstring php8-pdo php8-curl php8-fileinfo php8-dom php8-exif php8-pdo_mysql php8-mysqli php8-pcntl php8-openssl php8-mcrypt php8-gd2 php8-xmlreader php8-memcached php8-xsl php8-zip php8-redis php8-opcache
    #echo "Think twice about php8-imagick. See https://bugzilla.altlinux.org/show_bug.cgi?id=39033"
fi

{'fraction_non_alphanumeric': 0.1782985226693836, 'fraction_numerical': 0.048395313295975545, 'mean_word_length': 3.6430260047281324, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 3}, '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': '1269557', 'n_tokens_mistral': 924, 'n_tokens_neox': 831, 'n_words': 195}