<commit_before><commit_msg>packaging: add script to perform a copypac in obs/ibs<commit_after>#!/bin/bash

set -e

if [ -z "$3" ]; then
  cat <<EOF
usage:
  ./copypac.sh SOURCEPROJECT PACKAGE TARGETPROJECT [APIURL]
EOF
  exit 1
fi

sed -i "s|<username>|$OSC_USERNAME|g" /root/.oscrc
sed -i "s|<password>|$OSC_PASSWORD|g" /root/.oscrc

sourceproject=$1
package=$2
targetproject=$3
if [ -z "$4" ]; then
  apiurl=https://api.opensuse.org
else
  apiurl=$4
fi

log() { echo ">>> $1" ; }

log "copying $package from $sourceproject to $targetproject ..."
osc -A $apiurl copypac $sourceproject $package $targetproject
{'fraction_non_alphanumeric': 0.1592775041050903, 'fraction_numerical': 0.013136288998357963, 'mean_word_length': 4.398230088495575, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 1, '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': '2346385', 'n_tokens_mistral': 242, 'n_tokens_neox': 230, 'n_words': 63}