<commit_before>#!/bin/sh -e

TAGS=principal,annot,bin_annot,short_paths,thread,strict_sequence
J_FLAG=2

BASE_PKG="uri.services camlp4.macro"
LWT_PKG=lwt.unix
LWT_SSL_PKG=lwt.ssl
SYNTAX_PKG="lwt.syntax camlp4.macro"
ASYNC_PKG=async
ASYNC_SSL_PKG=async_ssl

HAVE_ASYNC=`ocamlfind query async 2>/dev/null || true`
HAVE_ASYNC_SSL=`ocamlfind query async_ssl 2>/dev/null || true`
HAVE_LWT=`ocamlfind query lwt 2>/dev/null || true`
HAVE_LWT_SSL=`ocamlfind query lwt.ssl 2>/dev/null || true`

function add_target {
  TARGETS="$TARGETS lib/$1.cmxs lib/$1.cma lib/$1.cmxa"
}

function add_pkg {
  PKG="$PKG $1"
}

add_pkg "$SYNTAX_PKG"
add_pkg "$BASE_PKG"
add_target "uri-conduit"
rm -f _tags

if [ "$HAVE_ASYNC" != "" ]; then
  echo "Building with Async support."
  echo "# This file is autogenerated by build.sh" > lib/uri-conduit-async.mllib
  echo Async_uri_conduit >> lib/uri-conduit-async.mllib
  add_target "uri-conduit-async"
  ASYNC_REQUIRES=async

  if [ "$HAVE_ASYNC_SSL" != "" ]; then
    echo "Building with Async/SSL support."
    echo 'true: define(HAVE_ASYNC_SSL)' >> _tags
    ASYNC_REQUIRES="$ASYNC_REQUIRES async_ssl"
    echo Async_net_ssl >> lib/uri-conduit-async.mllib
  fi
fi

if [ "$HAVE_LWT" != "" ]; then
  echo "Building with Lwt support."
  echo "# This file is autogenerated by build.sh" > lib/uri-conduit-lwt.mllib
  cat lib/uri-conduit-lwt-base.mllib >> lib/uri-conduit-lwt.mllib
  add_target "uri-conduit-lwt"
  LWT_REQUIRES=lwt.unix

  if [ "$HAVE_LWT_SSL" != "" ]; then
    echo "Building with Lwt/SSL support."
    echo 'true: define(HAVE_LWT_SSL)' >> _tags
    LWT_REQUIRES="$LWT_REQUIRES lwt.ssl"
    echo Lwt_unix_net_ssl >> lib/uri-conduit-lwt.mllib
  fi
fi

set -x
echo $PKG
ocamlbuild -use-ocamlfind -j ${J_FLAG} -tag ${TAGS} -syntax camlp4o \
  -pkgs `echo $PKG | tr ' ' ','` \
  -pkgs `echo $ASYNC_REQUIRES | tr ' ' ','` \
  -pkgs `echo $LWT_REQUIRES | tr ' ' ','` ${TARGETS}

sed \
  -e "s/@BASE_REQUIRES@/${BASE_PKG}/g" \
  -e "s/@VERSION@/`cat VERSION`/g" \
  -e "s/@ASYNC_REQUIRES@/${ASYNC_REQUIRES}/g" \
  -e "s/@LWT_REQUIRES@/${LWT_REQUIRES}/g" \
  META.in > META

if [ "$1" = "true" ]; then
  B=_build/lib/
  ocamlfind remove uri-conduit || true
  ocamlfind install uri-conduit META $B/*.cmi $B/*.cmt $B/*.cmti $B/*.cmx $B/*.cmxa $B/*.cma $B/*.cmxs
fi
<commit_msg>Installation file fixes (missing .a)<commit_after>#!/bin/sh -e

TAGS=principal,annot,bin_annot,short_paths,thread,strict_sequence
J_FLAG=2

BASE_PKG="uri uri.services camlp4.macro"
LWT_PKG=lwt.unix
LWT_SSL_PKG=lwt.ssl
SYNTAX_PKG="lwt.syntax camlp4.macro"
ASYNC_PKG=async
ASYNC_SSL_PKG=async_ssl

HAVE_ASYNC=`ocamlfind query async 2>/dev/null || true`
HAVE_ASYNC_SSL=`ocamlfind query async_ssl 2>/dev/null || true`
HAVE_LWT=`ocamlfind query lwt 2>/dev/null || true`
HAVE_LWT_SSL=`ocamlfind query lwt.ssl 2>/dev/null || true`

function add_target {
  TARGETS="$TARGETS lib/$1.cmxs lib/$1.cma lib/$1.cmxa"
}

function add_pkg {
  PKG="$PKG $1"
}

add_pkg "$SYNTAX_PKG"
add_pkg "$BASE_PKG"
add_target "uri-conduit"
rm -f _tags

if [ "$HAVE_ASYNC" != "" ]; then
  echo "Building with Async support."
  echo "# This file is autogenerated by build.sh" > lib/uri-conduit-async.mllib
  echo Async_uri_conduit >> lib/uri-conduit-async.mllib
  add_target "uri-conduit-async"
  ASYNC_REQUIRES=async

  if [ "$HAVE_ASYNC_SSL" != "" ]; then
    echo "Building with Async/SSL support."
    echo 'true: define(HAVE_ASYNC_SSL)' >> _tags
    ASYNC_REQUIRES="$ASYNC_REQUIRES async_ssl"
    echo Async_net_ssl >> lib/uri-conduit-async.mllib
  fi
fi

if [ "$HAVE_LWT" != "" ]; then
  echo "Building with Lwt support."
  echo "# This file is autogenerated by build.sh" > lib/uri-conduit-lwt.mllib
  cat lib/uri-conduit-lwt-base.mllib >> lib/uri-conduit-lwt.mllib
  add_target "uri-conduit-lwt"
  LWT_REQUIRES=lwt.unix

  if [ "$HAVE_LWT_SSL" != "" ]; then
    echo "Building with Lwt/SSL support."
    echo 'true: define(HAVE_LWT_SSL)' >> _tags
    LWT_REQUIRES="$LWT_REQUIRES lwt.ssl"
    echo Lwt_unix_net_ssl >> lib/uri-conduit-lwt.mllib
  fi
fi

set -x
echo $PKG
ocamlbuild -use-ocamlfind -j ${J_FLAG} -tag ${TAGS} -syntax camlp4o \
  -pkgs `echo $PKG | tr ' ' ','` \
  -pkgs `echo $ASYNC_REQUIRES | tr ' ' ','` \
  -pkgs `echo $LWT_REQUIRES | tr ' ' ','` ${TARGETS}

sed \
  -e "s/@BASE_REQUIRES@/${BASE_PKG}/g" \
  -e "s/@VERSION@/`cat VERSION`/g" \
  -e "s/@ASYNC_REQUIRES@/${ASYNC_REQUIRES}/g" \
  -e "s/@LWT_REQUIRES@/${LWT_REQUIRES}/g" \
  META.in > META

if [ "$1" = "true" ]; then
  B=_build/lib/
  ocamlfind remove uri-conduit || true
  ocamlfind install uri-conduit META $B/*.cmi $B/*.cmt $B/*.cmti $B/*.cmx $B/*.cmxa $B/*.cma $B/*.cmxs $B/*.a
fi

{'fraction_non_alphanumeric': 0.16257536606373815, 'fraction_numerical': 0.005598621877691645, 'mean_word_length': 3.889473684210526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, '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': '2901329', 'n_tokens_mistral': 2122, 'n_tokens_neox': 2097, 'n_words': 388}