<commit_before>#!/bin/bash

SELECTOR=h:net.randombit.botan
KEY_ID=<KEY>
MTN_DB=${HOME}/var/mtn/botan.mtn
WEB_DIR=${HOME}/projects/www

DIST_DIR=~/Botan-dist

# You shouldn't have to change anything after this
mkdir -p $DIST_DIR
cd $DIST_DIR

mtn -d $MTN_DB checkout -r $SELECTOR Botan

VERSION=$(Botan/configure.pl --version | sed 's/Botan //')

mv Botan Botan-$VERSION

cd Botan-$VERSION
rm -rf _MTN
rm -f .mtn-ignore

# Build docs
cd doc

for doc in api tutorial building
do
  latex $doc.tex
  latex $doc.tex
  dvips $doc.dvi -o
  pdflatex $doc.tex
  pdflatex $doc.tex
  cp $doc.pdf $DIST_DIR
  mv $doc.ps $DIST_DIR
  # Clean up after TeX
  rm -f $doc.aux $doc.log $doc.dvi $doc.toc
done

cp log.txt ../..

cd .. # topdir
cd .. # now in DIST_DIR

tar -cf Botan-$VERSION.tar Botan-$VERSION

bzip2 -9 -k Botan-$VERSION.tar
gzip -9 Botan-$VERSION.tar

rm -rf Botan-$VERSION

mv Botan-$VERSION.tar.gz Botan-$VERSION.tgz
mv Botan-$VERSION.tar.bz2 Botan-$VERSION.tbz

echo "*****************************************************"
read -a PASSWORD -p "Enter PGP password (or ^C to skip signatures): "

echo $PASSWORD | gpg --batch --armor -b --passphrase-fd 0 -u $KEY_ID Botan-$VERSION.tgz
echo $PASSWORD | gpg --batch --armor -b --passphrase-fd 0 -u $KEY_ID Botan-$VERSION.tbz

mv Botan-$VERSION.tgz* $WEB_DIR/files/botan/archive/v1.7
mv Botan-$VERSION.tbz* $WEB_DIR/files/botan/
mv -f log.txt $WEB_DIR/botan/log.txt<commit_msg>New paths in dist script<commit_after>#!/bin/bash

# This is probably only useful if run on my machine, which is not
# exactly ideal

SELECTOR=h:net.randombit.botan
KEY_ID=<KEY>
MTN_DB=~/var/mtn/botan.mtn
WEB_DIR=~/var/www
DIST_DIR=~/Botan-dist

# You shouldn't have to change anything after this
mkdir -p $DIST_DIR
cd $DIST_DIR

mtn -d $MTN_DB checkout -r $SELECTOR Botan

VERSION=$(Botan/configure.pl --version | sed 's/Botan //')

mv Botan Botan-$VERSION

cd Botan-$VERSION
rm -rf _MTN
rm -f .mtn-ignore

# Build docs
cd doc

for doc in api tutorial building
do
  latex $doc.tex
  latex $doc.tex
  dvips $doc.dvi -o
  pdflatex $doc.tex
  pdflatex $doc.tex
  cp $doc.pdf $DIST_DIR
  mv $doc.ps $DIST_DIR
  # Clean up after TeX
  rm -f $doc.aux $doc.log $doc.dvi $doc.toc
done

cp log.txt ../..

cd .. # topdir
cd .. # now in DIST_DIR

tar -cf Botan-$VERSION.tar Botan-$VERSION

bzip2 -9 -k Botan-$VERSION.tar
gzip -9 Botan-$VERSION.tar

rm -rf Botan-$VERSION

mv Botan-$VERSION.tar.gz Botan-$VERSION.tgz
mv Botan-$VERSION.tar.bz2 Botan-$VERSION.tbz

echo "*****************************************************"
read -a PASSWORD -p "Enter PGP password (or ^C to skip signatures): "

echo $PASSWORD | gpg --batch --armor -b --passphrase-fd 0 -u $KEY_ID Botan-$VERSION.tgz
echo $PASSWORD | gpg --batch --armor -b --passphrase-fd 0 -u $KEY_ID Botan-$VERSION.tbz

mv Botan-$VERSION.tgz* $WEB_DIR/files/botan/archive/v1.7
mv Botan-$VERSION.tbz* $WEB_DIR/files/botan/archive/v1.7
mv -f log.txt $WEB_DIR/botan/log.txt
{'fraction_non_alphanumeric': 0.17211997273346966, 'fraction_numerical': 0.006134969325153374, 'mean_word_length': 3.4604863221884496, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6844267', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1162, 'n_words': 324}