<commit_before>#!/usr/bin/env bash
# Time-stamp: <2016-11-10 18:26:17 kmodi>

# Generic script to build (without root access) any version of emacs from git.

# Example usages:
#   ./mybuild.sh -- Install from ${emacs_rev}
#   ./mybuild.sh --quick -- Do not do 'make bootstrap' from ${emacs_rev}
#   ./mybuild.sh --noopt -- Build without optimization (to allow gdb debug) from ${emacs_rev}
#   ./mybuild.sh --noopt --rev origin/master -- Build without optimization (to allow gdb debug) using the master branch

#   ./mybuild.sh --rev <COMMIT_HASH> --quick --subdir test -- Quick build for specified commit to "test/"
#   ./mybuild.sh --noupdate --debug -- Only show the git info of last build
#   ./mybuild.sh --rev origin/emacs-24
#   ./mybuild.sh --debug -- Do not do the actual install, but update from git
#                                print useful echo statements and retain the internal
#                                variables.
#   ./mybuild.sh --subdir test -- Install in test/ dir
#   ./mybuild.sh --noupdate -- Install without updating from the git
#   ./mybuild.sh --noinstall -- Build but do not install in ${MY_EMACS_INSTALL_DIR}
#   ./mybuild.sh --noopt --subdir noimagemagick -- Build without optimization to a subdir "noimagemagick/"
#   ./mybuild.sh --noupdate --quick --noinfo --noelc --noinstall -- Quick builds without git clone, no info or elc building and no install; useful during git bisects

# Update the following environment variables post-installation:
#   prepend PATH     with "${HOME}/usr_local/apps/${OSREV}/emacs/`basename ${MY_EMACS_INSTALL_DIR}`/bin"
#   prepend MANPATH  with "${HOME}/usr_local/apps/${OSREV}/emacs/`basename ${MY_EMACS_INSTALL_DIR}`/share/man"
#   prepend INFOPATH with "${HOME}/usr_local/apps/${OSREV}/emacs/`basename ${MY_EMACS_INSTALL_DIR}`/share/info"

# For RHEL 6, do "setenv MY_OSREV 6"
# "${HOME}/usr_local/${MY_OSREV}" is the directory that I use as
# --prefix for building libraries locally when the default library
# does not exist or is older than the requirements.

# I already have the env vars PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH
# and INCLUDE_PATH to include the respective directories in
# ${HOME}/usr_local/${MY_OSREV}.

# Ensure that PKG_CONFIG_PATH has /usr/share/pkgconfig for xproto.pc
# and related files. This is necessary for XFT and related X11
# features.. otherwise the fonts will look horrible.
<commit_msg>Make emacs build script "bash strict"<commit_after>#!/usr/bin/env bash
# Time-stamp: <2016-11-30 18:07:45 kmodi>

# Generic script to build (without root access) any version of emacs from git.

# Example usages:
#   ./mybuild.sh -- Install from ${emacs_rev}
#   ./mybuild.sh --quick -- Do not do 'make bootstrap' from ${emacs_rev}
#   ./mybuild.sh --noopt -- Build without optimization (to allow gdb debug) from ${emacs_rev}
#   ./mybuild.sh --noopt --rev origin/master -- Build without optimization (to allow gdb debug) using the master branch

#   ./mybuild.sh --rev <COMMIT_HASH> --quick --subdir test -- Quick build for specified commit to "test/"
#   ./mybuild.sh --noupdate --debug -- Only show the git info of last build
#   ./mybuild.sh --rev origin/emacs-24
#   ./mybuild.sh --debug -- Do not do the actual install, but update from git
#                                print useful echo statements and retain the internal
#                                variables.
#   ./mybuild.sh --subdir test -- Install in test/ dir
#   ./mybuild.sh --noupdate -- Install without updating from the git
#   ./mybuild.sh --noinstall -- Build but do not install in ${MY_EMACS_INSTALL_DIR}
#   ./mybuild.sh --noopt --subdir noimagemagick -- Build without optimization to a subdir "noimagemagick/"
#   ./mybuild.sh --noupdate --quick --noinfo --noelc --noinstall -- Quick builds without git clone, no info or elc building and no install; useful during git bisects

# Update the following environment variables post-installation:
#   prepend PATH     with "${HOME}/usr_local/apps/${OSREV}/emacs/`basename ${MY_EMACS_INSTALL_DIR}`/bin"
#   prepend MANPATH  with "${HOME}/usr_local/apps/${OSREV}/emacs/`basename ${MY_EMACS_INSTALL_DIR}`/share/man"
#   prepend INFOPATH with "${HOME}/usr_local/apps/${OSREV}/emacs/`basename ${MY_EMACS_INSTALL_DIR}`/share/info"

# For RHEL 6, do "setenv MY_OSREV 6"
# "${HOME}/usr_local/${MY_OSREV}" is the directory that I use as
# --prefix for building libraries locally when the default library
# does not exist or is older than the requirements.

# I already have the env vars PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH
# and INCLUDE_PATH to include the respective directories in
# ${HOME}/usr_local/${MY_OSREV}.

# Ensure that PKG_CONFIG_PATH has /usr/share/pkgconfig for xproto.pc
# and related files. This is necessary for XFT and related X11
# features.. otherwise the fonts will look horrible.

set -euo pipefail # http://redsymbol.net/articles/unofficial-bash-strict-mode
IFS=$'\n\t'

{'fraction_non_alphanumeric': 0.12084776849398818, 'fraction_numerical': 0.008151620134501733, 'mean_word_length': 3.2237521514629948, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3254996', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1531, 'n_words': 536}