<commit_before>#!/bin/sh

PATCHLIST="caravan_fixes1 city_fixes city_impr_fix2 city_name_bugfix city-naming-change citytools_changes client-fixes current_research_cost diplchanges goto_1 goto_attack1 goto_fix_1 goto_fix_2 govt-fix map-settings map_size_change metachange metatype packets middle_click_info orders_aborted orders_invalid2 savegame-support text_fixes tileset_hack turnchange unithand-change2 webclient-ai-attitude freeciv-svn-webclient-changes network-rewrite-1 fcnet_packets misc_devversion_sync specs_format tile_bases_roads"

apply_patch() {
  patch -u -p1 -d freeciv < patches/$1.patch
}

. ./version.txt

if ! grep "NETWORK_CAPSTRING_MANDATORY=\"$ORIGCAPSTR\"" freeciv/fc_version 2>/dev/null >/dev/null ; then
  echo "Capstring to be replaced does not match one given in version.txt" >&2
  exit 1
fi

sed "s/$ORIGCAPSTR/$WEBCAPSTR/" freeciv/fc_version > freeciv/fc_version.tmp
mv freeciv/fc_version.tmp freeciv/fc_version

for patch in $PATCHLIST
do
  if ! apply_patch $patch ; then
    echo "Patching failed ($patch.patch)" >&2
    exit 1
  fi
done<commit_msg>Set executable bit for fc_version after regenerating it.<commit_after>#!/bin/sh

PATCHLIST="caravan_fixes1 city_fixes city_impr_fix2 city_name_bugfix city-naming-change citytools_changes client-fixes current_research_cost diplchanges goto_1 goto_attack1 goto_fix_1 goto_fix_2 govt-fix map-settings map_size_change metachange metatype packets middle_click_info orders_aborted orders_invalid2 savegame-support text_fixes tileset_hack turnchange unithand-change2 webclient-ai-attitude freeciv-svn-webclient-changes network-rewrite-1 fcnet_packets misc_devversion_sync specs_format tile_bases_roads"

apply_patch() {
  patch -u -p1 -d freeciv < patches/$1.patch
}

. ./version.txt

if ! grep "NETWORK_CAPSTRING_MANDATORY=\"$ORIGCAPSTR\"" freeciv/fc_version 2>/dev/null >/dev/null ; then
  echo "Capstring to be replaced does not match one given in version.txt" >&2
  exit 1
fi

sed "s/$ORIGCAPSTR/$WEBCAPSTR/" freeciv/fc_version > freeciv/fc_version.tmp
mv freeciv/fc_version.tmp freeciv/fc_version
chmod a+x freeciv/fc_version

for patch in $PATCHLIST
do
  if ! apply_patch $patch ; then
    echo "Patching failed ($patch.patch)" >&2
    exit 1
  fi
done
{'fraction_non_alphanumeric': 0.07937219730941704, 'fraction_numerical': 0.014349775784753363, 'mean_word_length': 5.466666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2325642', 'n_tokens_mistral': 810, 'n_tokens_neox': 786, 'n_words': 191}