pip.sh: change the semantics of environment-variable switch NO_TEST_ON_INSTALL to make it more useful

Previously, if NO_TEST_ON_INSTALL is set to 1, it'll skip all the following: python unit tests on install, user ops test, tutorial tests and ffmpeg integration test. But most frequently, we want to be able to skip the python unit tests on install, but still run user ops tests, tutorial tests and/or ffmpeg integration test. This change enables that.
Change: 142820160

#!/usr/bin/env bash
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
#
# Build the Python PIP installation package for TensorFlow and install
# the package.
# The PIP installation is done using the --user flag.
#
# Usage:
#   pip.sh CONTAINER_TYPE [--mavx] [--mavx2]
#                         [--test_tutorials] [--integration_tests]
#
# When executing the Python unit tests, the script obeys the shell
# variables: TF_BUILD_BAZEL_CLEAN, TF_BUILD_INSTALL_EXTRA_PIP_PACKAGES,
# NO_TEST_ON_INSTALL
#
# TF_BUILD_BAZEL_CLEAN, if set to any non-empty and non-0 value, directs the
# script to perform bazel clean prior to main build and test steps.
#
# TF_BUILD_INSTALL_EXTRA_PIP_PACKAGES overrides the default extra pip packages
# to be installed in virtualenv before test_installation.sh is called. Multiple
# pakcage names are separated with spaces.
#
# If NO_TEST_ON_INSTALL has any non-empty and non-0 value, the test-on-install
# part will be skipped.
#
# If NO_TEST_USER_OPS has any non-empty and non-0 value, the testing of user-
# defined ops against the installation will be skipped.
#
# Use --mavx or --mavx2 to let bazel use --copt=-mavx or --copt=-mavx2 options
# while building the pip package, respectively.
#
# If the --test_tutorials flag is set, it will cause the script to run the
# tutorial tests (see test_tutorials.sh) after the PIP
# installation and the Python unit tests-on-install step. Likewise,
# --integration_tests will cause the integration tests (integration_tests.sh)
# to run.
#

# Fixed naming patterns for wheel (.whl) files given different python versions
if [[ $(uname) == "Linux" ]]; then
  declare -A WHL_TAGS
  WHL_TAGS=(["2.7"]="cp27-none" ["3.4"]="cp34-cp34m" ["3.5"]="cp35-cp35m")
fi

INSTALL_EXTRA_PIP_PACKAGES=${TF_BUILD_INSTALL_EXTRA_PIP_PACKAGES}

# Script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/builds_common.sh"

# Get the command line arguments
CONTAINER_TYPE=$( echo "$1" | tr '[:upper:]' '[:lower:]' )

if [[ ! -z "${TF_BUILD_BAZEL_CLEAN}" ]] && \
   [[ "${TF_BUILD_BAZEL_CLEAN}" != "0" ]]; then
  echo "TF_BUILD_BAZEL_CLEAN=${TF_BUILD_BAZEL_CLEAN}: Performing 'bazel clean'"
  bazel clean
fi

DO_TEST_USER_OPS=1
if [[ ! -z "${NO_TEST_USER_OPS}" ]] && \
   [[ "${NO_TEST_USER_OPS}" != "0" ]]; then
  echo "NO_TEST_USER_OPS=${NO_TEST_USER_OPS}: Will skip testing of user ops"
  DO_TEST_USER_OPS=0
fi

DO_TEST_TUTORIALS=0
DO_INTEGRATION_TESTS=0
MAVX_FLAG=""
while true; do
  if [[ "${1}" == "--test_tutorials" ]]; then
    DO_TEST_TUTORIALS=1
  elif [[ "${1}" == "--integration_tests" ]]; then
    DO_INTEGRATION_TESTS=1
  elif [[ "${1}" == "--mavx" ]]; then
    MAVX_FLAG="--copt=-mavx"
  elif [[ "${1}" == "--mavx2" ]]; then
    MAVX_FLAG="--copt=-mavx2"
  fi

  shift
  if [[ -z "${1}" ]]; then
    break
  fi
done

if [[ ! -z "${MAVX_FLAG}" ]]; then
  echo "Using MAVX flag: ${MAVX_FLAG}"
fi

PIP_BUILD_TARGET="//tensorflow/tools/pip_package:build_pip_package"
GPU_FLAG=""
if [[ ${CONTAINER_TYPE} == "cpu" ]] || \
   [[ ${CONTAINER_TYPE} == "debian.jessie.cpu" ]]; then
  bazel build -c opt ${MAVX_FLAG} ${PIP_BUILD_TARGET} || \
      die "Build failed."
elif [[ ${CONTAINER_TYPE} == "gpu" ]]; then
  bazel build -c opt --config=cuda ${MAVX_FLAG} ${PIP_BUILD_TARGET} || \
      die "Build failed."
  GPU_FLAG="--gpu"
else
  die "Unrecognized container type: \"${CONTAINER_TYPE}\""
fi

MAC_FLAG=""
if [[ $(uname) == "Darwin" ]]; then
  MAC_FLAG="--mac"
fi

# If still in a virtualenv, deactivate it first
if [[ ! -z "$(which deactivate)" ]]; then
  echo "It appears that we are already in a virtualenv. Deactivating..."
  deactivate || die "FAILED: Unable to deactivate from existing virtualenv"
fi

# Obtain the path to Python binary
source tools/python_bin_path.sh

# Assume: PYTHON_BIN_PATH is exported by the script above
if [[ -z "$PYTHON_BIN_PATH" ]]; then
  die "PYTHON_BIN_PATH was not provided. Did you run configure?"
fi

# Determine the major and minor versions of Python being used (e.g., 2.7)
# This info will be useful for determining the directory of the local pip
# installation of Python
PY_MAJOR_MINOR_VER=$(${PYTHON_BIN_PATH} -V 2>&1 | awk '{print $NF}' | cut -d. -f-2)
if [[ -z "${PY_MAJOR_MINOR_VER}" ]]; then
  die "ERROR: Unable to determine the major.minor version of Python"
fi

echo "Python binary path to be used in PIP install: ${PYTHON_BIN_PATH} "\
"(Major.Minor version: ${PY_MAJOR_MINOR_VER})"

# Build PIP Wheel file
PIP_TEST_ROOT="pip_test"
PIP_WHL_DIR="${PIP_TEST_ROOT}/whl"
PIP_WHL_DIR=$(realpath ${PIP_WHL_DIR})  # Get absolute path
rm -rf ${PIP_WHL_DIR} && mkdir -p ${PIP_WHL_DIR}
bazel-bin/tensorflow/tools/pip_package/build_pip_package ${PIP_WHL_DIR} ${GPU_FLAG} || \
    die "build_pip_package FAILED"

WHL_PATH=$(ls ${PIP_WHL_DIR}/tensorflow*.whl)
if [[ $(echo ${WHL_PATH} | wc -w) -ne 1 ]]; then
  die "ERROR: Failed to find exactly one built TensorFlow .whl file in "\
"directory: ${PIP_WHL_DIR}"
fi

# Rename the whl file properly so it will have the python
# version tags and platform tags that won't cause pip install issues.
if [[ $(uname) == "Linux" ]]; then
  PY_TAGS=${WHL_TAGS[${PY_MAJOR_MINOR_VER}]}
  PLATFORM_TAG=$(to_lower "$(uname)_$(uname -m)")
# MAC has bash v3, which does not have associative array
elif [[ $(uname) == "Darwin" ]]; then
  if [[ ${PY_MAJOR_MINOR_VER} == "2.7" ]]; then
    PY_TAGS="py2-none"
  elif [[ ${PY_MAJOR_MINOR_VER} == "3.5" ]]; then
    PY_TAGS="py3-none"
  fi
  PLATFORM_TAG="any"
fi

WHL_DIR=$(dirname "${WHL_PATH}")
WHL_BASE_NAME=$(basename "${WHL_PATH}")

if [[ ! -z "${PY_TAGS}" ]]; then
  NEW_WHL_BASE_NAME=$(echo ${WHL_BASE_NAME} | cut -d \- -f 1)-\
$(echo ${WHL_BASE_NAME} | cut -d \- -f 2)-${PY_TAGS}-${PLATFORM_TAG}.whl

  if [[ ! -f "${WHL_DIR}/${NEW_WHL_BASE_NAME}" ]]; then
    cp "${WHL_DIR}/${WHL_BASE_NAME}" "${WHL_DIR}/${NEW_WHL_BASE_NAME}" && \
      echo "Copied wheel file: ${WHL_BASE_NAME} --> ${NEW_WHL_BASE_NAME}" || \
      die "ERROR: Failed to copy wheel file to ${NEW_WHL_BASE_NAME}"
  fi
fi

if [[ $(uname) == "Linux" ]]; then
  AUDITED_WHL_NAME="${WHL_DIR}/$(echo ${WHL_BASE_NAME} | sed "s/linux/manylinux1/")"

  # Repair the wheels for cpu manylinux1
  if [[ ${CONTAINER_TYPE} == "cpu" ]]; then
    echo "auditwheel repairing ${WHL_PATH}"
    auditwheel repair -w ${WHL_DIR} ${WHL_PATH}

    if [[ -f ${AUDITED_WHL_NAME} ]]; then
      WHL_PATH=${AUDITED_WHL_NAME}
      echo "Repaired manylinx1 wheel file at: ${WHL_PATH}"
    else
      die "ERROR: Cannot find repaired wheel."
    fi
  # Copy and rename for gpu manylinux as we do not want auditwheel to package in libcudart.so
  elif [[ ${CONTAINER_TYPE} == "gpu" ]]; then
    WHL_PATH=${AUDITED_WHL_NAME}
    cp ${WHL_DIR}/${WHL_BASE_NAME} ${WHL_PATH}
    echo "Copied manylinx1 wheel file at ${WHL_PATH}"
  fi
fi

# Perform installation
echo "Installing pip whl file: ${WHL_PATH}"

# Create virtualenv directory for install test
VENV_DIR="${PIP_TEST_ROOT}/venv"

if [[ -d "${VENV_DIR}" ]]; then
  rm -rf "${VENV_DIR}" && \
      echo "Removed existing virtualenv directory: ${VENV_DIR}" || \
      die "Failed to remove existing virtualenv directory: ${VENV_DIR}"
fi

mkdir -p ${VENV_DIR} && \
    echo "Created virtualenv directory: ${VENV_DIR}" || \
    die "FAILED to create virtualenv directory: ${VENV_DIR}"

# Verify that virtualenv exists
if [[ -z $(which virtualenv) ]]; then
  die "FAILED: virtualenv not available on path"
fi

virtualenv --system-site-packages -p "${PYTHON_BIN_PATH}" "${VENV_DIR}" || \
    die "FAILED: Unable to create virtualenv"

source "${VENV_DIR}/bin/activate" || \
    die "FAILED: Unable to activate virtualenv"

# Install the pip file in virtual env (plus missing dependencies)

# Upgrade pip so it supports tags such as cp27mu, manylinux1 etc.
echo "Upgrade pip in virtualenv"
pip install --upgrade pip==8.1.2

# Force tensorflow reinstallation. Otherwise it may not get installed from
# last build if it had the same version number as previous build.
PIP_FLAGS="--upgrade --force-reinstall --no-deps"
pip install -v ${PIP_FLAGS} ${WHL_PATH} || \
    die "pip install (forcing to reinstall tensorflow) FAILED"
echo "Successfully installed pip package ${WHL_PATH}"

# Install extra pip packages required by the test-on-install
for PACKAGE in ${INSTALL_EXTRA_PIP_PACKAGES}; do
  echo "Installing extra pip package required by test-on-install: ${PACKAGE}"

  pip install ${PACKAGE} || \
      die "pip install ${PACKAGE} FAILED"
done

if [[ ! -z "${NO_TEST_ON_INSTALL}" ]] &&
   [[ "${NO_TEST_ON_INSTALL}" != "0" ]]; then
  echo "NO_TEST_ON_INSTALL=${NO_TEST_ON_INSTALL}:"
  echo "  Skipping ALL Python unit tests on install"
else
  # Call test_installation.sh to perform test-on-install
  "${SCRIPT_DIR}/test_installation.sh" --virtualenv ${GPU_FLAG} ${MAC_FLAG} ||
      die "PIP tests-on-install FAILED"
fi

# Test user ops
if [[ "${DO_TEST_USER_OPS}" == "1" ]]; then
  "${SCRIPT_DIR}/test_user_ops.sh" --virtualenv ${GPU_FLAG} || \
      die "PIP user-op tests-on-install FAILED"
fi

# Optional: Run the tutorial tests
if [[ "${DO_TEST_TUTORIALS}" == "1" ]]; then
  "${SCRIPT_DIR}/test_tutorials.sh" --virtualenv || \
      die "PIP tutorial tests-on-install FAILED"
fi

# Optional: Run integration tests
if [[ "${DO_INTEGRATION_TESTS}" == "1" ]]; then
  "${SCRIPT_DIR}/integration_tests.sh" --virtualenv || \
      die "Integration tests on install FAILED"
fi

deactivate || \
    die "FAILED: Unable to deactivate virtualenv"

#!/usr/bin/env bash
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
#
# Build the Python PIP installation package for TensorFlow and install
# the package.
# The PIP installation is done using the --user flag.
#
# Usage:
#   pip.sh CONTAINER_TYPE [--mavx] [--mavx2]
#                         [--test_tutorials] [--integration_tests]
#
# When executing the Python unit tests, the script obeys the shell
# variables: TF_BUILD_BAZEL_CLEAN, TF_BUILD_INSTALL_EXTRA_PIP_PACKAGES,
# NO_TEST_ON_INSTALL
#
# TF_BUILD_BAZEL_CLEAN, if set to any non-empty and non-0 value, directs the
# script to perform bazel clean prior to main build and test steps.
#
# TF_BUILD_INSTALL_EXTRA_PIP_PACKAGES overrides the default extra pip packages
# to be installed in virtualenv before test_installation.sh is called. Multiple
# pakcage names are separated with spaces.
#
# If NO_TEST_ON_INSTALL has any non-empty and non-0 value, the test-on-install
# part will be skipped.
#
# If NO_TEST_USER_OPS has any non-empty and non-0 value, the testing of user-
# defined ops against the installation will be skipped.
#
# Use --mavx or --mavx2 to let bazel use --copt=-mavx or --copt=-mavx2 options
# while building the pip package, respectively.
#
# If the --test_tutorials flag is set, it will cause the script to run the
# tutorial tests (see test_tutorials.sh) after the PIP
# installation and the Python unit tests-on-install step. Likewise,
# --integration_tests will cause the integration tests (integration_tests.sh)
# to run.
#

# Fixed naming patterns for wheel (.whl) files given different python versions
if [[ $(uname) == "Linux" ]]; then
  declare -A WHL_TAGS
  WHL_TAGS=(["2.7"]="cp27-none" ["3.4"]="cp34-cp34m" ["3.5"]="cp35-cp35m")
fi

INSTALL_EXTRA_PIP_PACKAGES=${TF_BUILD_INSTALL_EXTRA_PIP_PACKAGES}

# Script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/builds_common.sh"

# Get the command line arguments
CONTAINER_TYPE=$( echo "$1" | tr '[:upper:]' '[:lower:]' )

if [[ ! -z "${TF_BUILD_BAZEL_CLEAN}" ]] && \
   [[ "${TF_BUILD_BAZEL_CLEAN}" != "0" ]]; then
  echo "TF_BUILD_BAZEL_CLEAN=${TF_BUILD_BAZEL_CLEAN}: Performing 'bazel clean'"
  bazel clean
fi

DO_TEST_USER_OPS=1
if [[ ! -z "${NO_TEST_USER_OPS}" ]] && \
   [[ "${NO_TEST_USER_OPS}" != "0" ]]; then
  echo "NO_TEST_USER_OPS=${NO_TEST_USER_OPS}: Will skip testing of user ops"
  DO_TEST_USER_OPS=0
fi

DO_TEST_TUTORIALS=0
DO_INTEGRATION_TESTS=0
MAVX_FLAG=""
while true; do
  if [[ "${1}" == "--test_tutorials" ]]; then
    DO_TEST_TUTORIALS=1
  elif [[ "${1}" == "--integration_tests" ]]; then
    DO_INTEGRATION_TESTS=1
  elif [[ "${1}" == "--mavx" ]]; then
    MAVX_FLAG="--copt=-mavx"
  elif [[ "${1}" == "--mavx2" ]]; then
    MAVX_FLAG="--copt=-mavx2"
  fi

  shift
  if [[ -z "${1}" ]]; then
    break
  fi
done

if [[ ! -z "${MAVX_FLAG}" ]]; then
  echo "Using MAVX flag: ${MAVX_FLAG}"
fi

PIP_BUILD_TARGET="//tensorflow/tools/pip_package:build_pip_package"
GPU_FLAG=""
if [[ ${CONTAINER_TYPE} == "cpu" ]] || \
   [[ ${CONTAINER_TYPE} == "debian.jessie.cpu" ]]; then
  bazel build -c opt ${MAVX_FLAG} ${PIP_BUILD_TARGET} || \
      die "Build failed."
elif [[ ${CONTAINER_TYPE} == "gpu" ]]; then
  bazel build -c opt --config=cuda ${MAVX_FLAG} ${PIP_BUILD_TARGET} || \
      die "Build failed."
  GPU_FLAG="--gpu"
else
  die "Unrecognized container type: \"${CONTAINER_TYPE}\""
fi

MAC_FLAG=""
if [[ $(uname) == "Darwin" ]]; then
  MAC_FLAG="--mac"
fi

# If still in a virtualenv, deactivate it first
if [[ ! -z "$(which deactivate)" ]]; then
  echo "It appears that we are already in a virtualenv. Deactivating..."
  deactivate || die "FAILED: Unable to deactivate from existing virtualenv"
fi

# Obtain the path to Python binary
source tools/python_bin_path.sh

# Assume: PYTHON_BIN_PATH is exported by the script above
if [[ -z "$PYTHON_BIN_PATH" ]]; then
  die "PYTHON_BIN_PATH was not provided. Did you run configure?"
fi

# Determine the major and minor versions of Python being used (e.g., 2.7)
# This info will be useful for determining the directory of the local pip
# installation of Python
PY_MAJOR_MINOR_VER=$(${PYTHON_BIN_PATH} -V 2>&1 | awk '{print $NF}' | cut -d. -f-2)
if [[ -z "${PY_MAJOR_MINOR_VER}" ]]; then
  die "ERROR: Unable to determine the major.minor version of Python"
fi

echo "Python binary path to be used in PIP install: ${PYTHON_BIN_PATH} "\
"(Major.Minor version: ${PY_MAJOR_MINOR_VER})"

# Build PIP Wheel file
PIP_TEST_ROOT="pip_test"
PIP_WHL_DIR="${PIP_TEST_ROOT}/whl"
PIP_WHL_DIR=$(realpath ${PIP_WHL_DIR})  # Get absolute path
rm -rf ${PIP_WHL_DIR} && mkdir -p ${PIP_WHL_DIR}
bazel-bin/tensorflow/tools/pip_package/build_pip_package ${PIP_WHL_DIR} ${GPU_FLAG} || \
    die "build_pip_package FAILED"

WHL_PATH=$(ls ${PIP_WHL_DIR}/tensorflow*.whl)
if [[ $(echo ${WHL_PATH} | wc -w) -ne 1 ]]; then
  die "ERROR: Failed to find exactly one built TensorFlow .whl file in "\
"directory: ${PIP_WHL_DIR}"
fi

# Rename the whl file properly so it will have the python
# version tags and platform tags that won't cause pip install issues.
if [[ $(uname) == "Linux" ]]; then
  PY_TAGS=${WHL_TAGS[${PY_MAJOR_MINOR_VER}]}
  PLATFORM_TAG=$(to_lower "$(uname)_$(uname -m)")
# MAC has bash v3, which does not have associative array
elif [[ $(uname) == "Darwin" ]]; then
  if [[ ${PY_MAJOR_MINOR_VER} == "2.7" ]]; then
    PY_TAGS="py2-none"
  elif [[ ${PY_MAJOR_MINOR_VER} == "3.5" ]]; then
    PY_TAGS="py3-none"
  fi
  PLATFORM_TAG="any"
fi

WHL_DIR=$(dirname "${WHL_PATH}")
WHL_BASE_NAME=$(basename "${WHL_PATH}")

if [[ ! -z "${PY_TAGS}" ]]; then
  NEW_WHL_BASE_NAME=$(echo ${WHL_BASE_NAME} | cut -d \- -f 1)-\
$(echo ${WHL_BASE_NAME} | cut -d \- -f 2)-${PY_TAGS}-${PLATFORM_TAG}.whl

  if [[ ! -f "${WHL_DIR}/${NEW_WHL_BASE_NAME}" ]]; then
    cp "${WHL_DIR}/${WHL_BASE_NAME}" "${WHL_DIR}/${NEW_WHL_BASE_NAME}" && \
      echo "Copied wheel file: ${WHL_BASE_NAME} --> ${NEW_WHL_BASE_NAME}" || \
      die "ERROR: Failed to copy wheel file to ${NEW_WHL_BASE_NAME}"
  fi
fi

if [[ $(uname) == "Linux" ]]; then
  AUDITED_WHL_NAME="${WHL_DIR}/$(echo ${WHL_BASE_NAME} | sed "s/linux/manylinux1/")"

  # Repair the wheels for cpu manylinux1
  if [[ ${CONTAINER_TYPE} == "cpu" ]]; then
    echo "auditwheel repairing ${WHL_PATH}"
    auditwheel repair -w ${WHL_DIR} ${WHL_PATH}

    if [[ -f ${AUDITED_WHL_NAME} ]]; then
      WHL_PATH=${AUDITED_WHL_NAME}
      echo "Repaired manylinx1 wheel file at: ${WHL_PATH}"
    else
      die "ERROR: Cannot find repaired wheel."
    fi
  # Copy and rename for gpu manylinux as we do not want auditwheel to package in libcudart.so
  elif [[ ${CONTAINER_TYPE} == "gpu" ]]; then
    WHL_PATH=${AUDITED_WHL_NAME}
    cp ${WHL_DIR}/${WHL_BASE_NAME} ${WHL_PATH}
    echo "Copied manylinx1 wheel file at ${WHL_PATH}"
  fi
fi

# Perform installation
echo "Installing pip whl file: ${WHL_PATH}"

# Create virtualenv directory for install test
VENV_DIR="${PIP_TEST_ROOT}/venv"

if [[ -d "${VENV_DIR}" ]]; then
  rm -rf "${VENV_DIR}" && \
      echo "Removed existing virtualenv directory: ${VENV_DIR}" || \
      die "Failed to remove existing virtualenv directory: ${VENV_DIR}"
fi

mkdir -p ${VENV_DIR} && \
    echo "Created virtualenv directory: ${VENV_DIR}" || \
    die "FAILED to create virtualenv directory: ${VENV_DIR}"

# Verify that virtualenv exists
if [[ -z $(which virtualenv) ]]; then
  die "FAILED: virtualenv not available on path"
fi

virtualenv --system-site-packages -p "${PYTHON_BIN_PATH}" "${VENV_DIR}" || \
    die "FAILED: Unable to create virtualenv"

source "${VENV_DIR}/bin/activate" || \
    die "FAILED: Unable to activate virtualenv"

# Install the pip file in virtual env (plus missing dependencies)

# Upgrade pip so it supports tags such as cp27mu, manylinux1 etc.
echo "Upgrade pip in virtualenv"
pip install --upgrade pip==8.1.2

# Force tensorflow reinstallation. Otherwise it may not get installed from
# last build if it had the same version number as previous build.
PIP_FLAGS="--upgrade --force-reinstall --no-deps"
pip install -v ${PIP_FLAGS} ${WHL_PATH} || \
    die "pip install (forcing to reinstall tensorflow) FAILED"
echo "Successfully installed pip package ${WHL_PATH}"

# Install extra pip packages required by the test-on-install
for PACKAGE in ${INSTALL_EXTRA_PIP_PACKAGES}; do
  echo "Installing extra pip package required by test-on-install: ${PACKAGE}"

  pip install ${PACKAGE} || \
      die "pip install ${PACKAGE} FAILED"
done

# If NO_TEST_ON_INSTALL is set to any non-empty value, skip all Python
# tests-on-install and exit right away
if [[ ! -z "${NO_TEST_ON_INSTALL}" ]] &&
   [[ "${NO_TEST_ON_INSTALL}" != "0" ]]; then
  echo "NO_TEST_ON_INSTALL=${NO_TEST_ON_INSTALL}:"
  echo "  Skipping ALL Python unit tests on install"
  exit 0
fi

# Call test_installation.sh to perform test-on-install

"${SCRIPT_DIR}/test_installation.sh" --virtualenv ${GPU_FLAG} ${MAC_FLAG} ||
    die "PIP tests-on-install FAILED"

# Test user ops
if [[ "${DO_TEST_USER_OPS}" == "1" ]]; then
  "${SCRIPT_DIR}/test_user_ops.sh" --virtualenv ${GPU_FLAG} || \
      die "PIP user-op tests-on-install FAILED"
fi

# Optional: Run the tutorial tests
if [[ "${DO_TEST_TUTORIALS}" == "1" ]]; then
  "${SCRIPT_DIR}/test_tutorials.sh" --virtualenv || \
      die "PIP tutorial tests-on-install FAILED"
fi

# Optional: Run integration tests
if [[ "${DO_INTEGRATION_TESTS}" == "1" ]]; then
  "${SCRIPT_DIR}/integration_tests.sh" --virtualenv || \
      die "Integration tests on install FAILED"
fi

deactivate || \
    die "FAILED: Unable to deactivate virtualenv"


Build OpenBLAS+numpy+scipy+sklearn

Build OpenBLAS+numpy+scipy+sklearn

#!/usr/bin/env bash

# Build OpenBLAS and clean up build dependencies
set -xe

mkdir /tmp/build
cd /tmp/build

apt-get -y update
apt-get -y install git-core build-essential gfortran python3-dev curl

# Build latest stable release from OpenBLAS from source
git clone -q --branch=master git://github.com/xianyi/OpenBLAS.git
(cd OpenBLAS \
      && make DYNAMIC_ARCH=1 NO_AFFINITY=1 NUM_THREADS=32 \
          && make install)

# Rebuild ld cache, this assumes that:
# /etc/ld.so.conf.d/openblas.conf was installed by Dockerfile
# and that the libraries are in /opt/OpenBLAS/lib
ldconfig

# System dependencies
apt-get build-dep -y python3 python3-numpy python3-scipy python3-matplotlib cython3 python3-h5py
apt-get install -y build-essential python3-dev
curl https://bootstrap.pypa.io/get-pip.py | python3
pip3 install cython

# Build NumPy and SciPy from source against OpenBLAS installed
git clone -q --branch=v1.9.0 git://github.com/numpy/numpy.git
cp /numpy-site.cfg numpy/site.cfg
(cd numpy && python3 setup.py install)

git clone -q --branch=v0.14.0 git://github.com/scipy/scipy.git
cp /scipy-site.cfg scipy/site.cfg
(cd scipy && python3 setup.py install)

pip3 install pandas scikit-learn
pip3 install matplotlib
pip3 install seaborn
pip3 install h5py
pip3 install yt
pip3 install sympy
pip3 install patsy

# Reduce the image size
apt-get autoremove -y
apt-get clean -y

cd /
rm -rf /tmp/build
rm -rf /build_openblas.sh

error: pathspec 'scipystack/build_scipy_stack.sh' did not match any file(s) known to git


update purge

update purge

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/postgresqlfr/pgfr_toolbox.git/'


alias diff=colordiff

alias diff=colordiff

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/hiromu3110/dotfiles.git/'


Add a snippet.

Add a snippet.

#!/bin/bash

# WARNING: the following file runs with Bash only

# If you are presenting a very long menu and want to make best use of the available screen, you can calculate the best box size by.
#   eval `resize`
#   whiptail ... $LINES $COLUMNS $(( $LINES - 8 )) ...

######

TITLE="Check list example"
SUB_TITLE="Choose user's permissions"
LABELS_ARRAY=(one two three four)
STATUS_ARRAY=(ON OFF ON OFF)

######

if [ ${#LABELS_ARRAY[@]} -ne ${#STATUS_ARRAY[@]} ]
then
    echo "Internal error, LABELS_ARRAY and STATUS_ARRAY don't have the same length."
    exit 1
fi

WHIPTAIL_CMD="whiptail --title \"${TITLE}\" --checklist "
WHIPTAIL_CMD+="\"${SUB_TITLE}\" 20 78 4 "

FIRST_INDEX=0
LAST_INDEX=$(( ${#LABELS_ARRAY[@]} - 1 ))

for INDEX in $(seq ${FIRST_INDEX} ${LAST_INDEX})
do
    PRINT_INDEX=$(( $INDEX + 1 ))
    WHIPTAIL_CMD+="\"$PRINT_INDEX\" \"${LABELS_ARRAY[$INDEX]}\" ${STATUS_ARRAY[$INDEX]} "
done

WHIPTAIL_CMD+="3>&1 1>&2 2>&3 "

### DEBUG ###
#echo "${WHIPTAIL_CMD}"
#eval ${WHIPTAIL_CMD}

CHOICE=$(eval ${WHIPTAIL_CMD})

#CHOICE=$(whiptail --title "Check list example" --checklist \
#                          "Choose user's permissions" 20 78 4 \
#                          "NET_OUTBOUND" "Allow connections to other hosts" ON \
#                          "NET_INBOUND" "Allow connections from other hosts" OFF \
#                          "LOCAL_MOUNT" "Allow mounting of local devices" OFF \
#                          "REMOTE_MOUNT" "Allow mounting of remote devices" OFF 3>&1 1>&2 2>&3)

echo "CHOICE: $CHOICE"

error: pathspec 'shell/whiptail/check_list_using_bash_arrays.sh' did not match any file(s) known to git


add shell script for pulling weight files from aws ami

sudo scp -i keypair-name.pem ubuntu@99.99.999.99:~/your-weights-file-name.hdf5 ~/Desktop

error: pathspec 'scripts/get_weights_from_aws.sh' did not match any file(s) known to git


[scripts] Fix redis install script

[scripts] Fix redis install script

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/AbaevTM/json-parser-sc-machine.git/'


scripts: Add a simple remaining battery time script

#! /usr/bin/env bash

TIME=$(acpi -b | awk '{print $5}')

if [[ -n $TIME ]]; then
    echo "$TIME"
fi

error: pathspec 'scripts/scripts/battery_time.sh' did not match any file(s) known to git


HEAD-1822: add devtools/deploy-coal-manta.sh

#!/bin/bash

set -e
set -x

# Install the Manta "management" zone
/usbkey/scripts/setup_manta_zone.sh
MANTA=$(vmadm lookup alias=manta0)

# Set up the extra manta and manta-nat networks
ln -s /zones/$MANTA/root/opt/smartdc/manta-deployment/networking /var/tmp/networking
cd /var/tmp/networking
./gen-coal.sh > configs/coal.json
./manta-net.sh ./configs/coal.json
cd -

# Now deploy...
zlogin $MANTA "/opt/smartdc/manta-deployment/bin/manta-init -e nobody@joyent.com -s coal -r coal"
zlogin $MANTA "/opt/smartdc/manta-deployment/bin/manta-deploy-coal"
sdc-ldap add -f /zones/$MANTA/root/opt/smartdc/manta-deployment/ufds/devs.ldif

error: pathspec 'devtools/deploy-coal-manta.sh' did not match any file(s) known to git


Add script to test Ensemble.

Add script to test Ensemble.

#!/usr/bin/env bash

export MODULE=riak_ensemble
export SUBLIST=0

echo "Running example suite to identify minimal successful example..."
rm -rf priv/lager; pkill -9 beam.smp; IMPLEMENTATION_MODULE=${MODULE} NUM_TESTS=3 SCHEDULER=single_success bin/counterexample-find.sh

# echo "Attempting single replay."
# IMPLEMENTATION_MODULE=${MODULE} bin/counterexample-replay.sh

# echo "Beginning reduction to find support for successful example..."
# PRELOAD_SCHEDULES=${PRELOAD_SCHEDULES} RECURSIVE=${RECURSIVE} SUBLIST=${SUBLIST} EXIT_ON_COUNTEREXAMPLE=${EXIT_ON_COUNTEREXAMPLE} IMPLEMENTATION_MODULE=${MODULE} bin/counterexample-identify-support.sh

error: pathspec 'bin/check-riak-ensemble.sh' did not match any file(s) known to git


added autogen.sh

added autogen.sh

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@763 67ed7778-7388-44ab-90cf-0a291f65f57c

#!/bin/sh
# Run this to generate all the initial makefiles, etc.

srcdir=`dirname $0`
PKG_NAME="the package."

DIE=0

(autoconf --version) < /dev/null > /dev/null 2>&1 || {
  echo
  echo "**Error**: You must have \`autoconf' installed to."
  echo "Download the appropriate package for your distribution,"
  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  DIE=1
}

(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
  (libtool --version) < /dev/null > /dev/null 2>&1 || {
    echo
    echo "**Error**: You must have \`libtool' installed."
    echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
    echo "(or a newer version if it is available)"
    DIE=1
  }
}

grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
  grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
  (gettext --version) < /dev/null > /dev/null 2>&1 || {
    echo
    echo "**Error**: You must have \`gettext' installed."
    echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
    echo "(or a newer version if it is available)"
    DIE=1
  }
}

grep "^AM_GNOME_GETTEXT" $srcdir/configure.in >/dev/null && {
  grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
  (gettext --version) < /dev/null > /dev/null 2>&1 || {
    echo
    echo "**Error**: You must have \`gettext' installed."
    echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
    echo "(or a newer version if it is available)"
    DIE=1
  }
}

(automake --version) < /dev/null > /dev/null 2>&1 || {
  echo
  echo "**Error**: You must have \`automake' installed."
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  echo "(or a newer version if it is available)"
  DIE=1
  NO_AUTOMAKE=yes
}

# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
  echo
  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
  echo "installed doesn't appear recent enough."
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  echo "(or a newer version if it is available)"
  DIE=1
}

if test "$DIE" -eq 1; then
  exit 1
fi

if test -z "$*"; then
  echo "**Warning**: I am going to run \`configure' with no arguments."
  echo "If you wish to pass any to it, please specify them on the"
  echo \`$0\'" command line."
  echo
fi

case $CC in
xlc )
  am_opt=--include-deps;;
esac

for coin in `find $srcdir -name configure.in -print`
do
  dr=`dirname $coin`
  if test -f $dr/NO-AUTO-GEN; then
    echo skipping $dr -- flagged as no auto-gen
  else
    echo processing $dr
    macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
    ( cd $dr
      aclocalinclude="$ACLOCAL_FLAGS"
      for k in $macrodirs; do
  	if test -d $k; then
          aclocalinclude="$aclocalinclude -I $k"
  	##else
	##  echo "**Warning**: No such directory \`$k'.  Ignored."
        fi
      done
      if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
	if grep "sed.*POTFILES" configure.in >/dev/null; then
	  : do nothing -- we still have an old unmodified configure.in
	else
	  echo "Creating $dr/aclocal.m4 ..."
	  test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
	  echo "Running gettextize...  Ignore non-fatal messages."
	  echo "no" | gettextize --force --copy
	  echo "Making $dr/aclocal.m4 writable ..."
	  test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
        fi
      fi
      if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
	echo "Creating $dr/aclocal.m4 ..."
	test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
	echo "Running gettextize...  Ignore non-fatal messages."
	echo "no" | gettextize --force --copy
	echo "Making $dr/aclocal.m4 writable ..."
	test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
      fi
      if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
	echo "Running libtoolize..."
	libtoolize --force --copy
      fi
      echo "Running aclocal $aclocalinclude ..."
      aclocal $aclocalinclude
      if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
	echo "Running autoheader..."
	autoheader
      fi
      echo "Running automake --gnu $am_opt ..."
      automake --add-missing --gnu $am_opt
      echo "Running autoconf ..."
      autoconf
    )
  fi
done

#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c

if test x$NOCONFIGURE = x; then
  echo Running $srcdir/configure $conf_flags "$@" ...
  $srcdir/configure $conf_flags "$@" \
  && echo Now type \`make\' to compile $PKG_NAME
else
  echo Skipping configure process.
fi

error: pathspec 'frontends/gtk/autogen.sh' did not match any file(s) known to git


Add grip to brew cask: instant Github REAMDE preview

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mhoonjeon/dotfiles.git/'


chore(package release): update package release script

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/ozone-development/ozp-iwc-owf7-widget-adapter.git/'


Adding support for mumps.

Adding support for mumps.

git-svn-id: 06aac1f7aa6783202dd435920b98a457d633d0b0@1938 a9e16012-fd73-49ee-95cb-036de7809213

error: pathspec 'packages/mumps.sh' did not match any file(s) known to git


build script

build script

#!/bin/bash

ELECTRON_VERSION=`npm view electron-prebuilt version`
DEST="/tmp/before-dawn-packages"
TARGET="$1"

echo "== Building Packages with Electron v ${ELECTRON_VERSION}"

echo "== Run Grunt =="
grunt

echo "== REBUILD MODULES =="
./node_modules/.bin/electron-rebuild -w node-system-idle-time

# "prep": "grunt && ./node_modules/.bin/electron-rebuild",

echo "== clean =="
rm -rf "${DEST}/osx"
mkdir -p "${DEST}/osx"

rm -rf "${DEST}/win"
mkdir -p "${DEST}/win"

#
# sudo npm install electron-packager -g
#

if [ "$TARGET" == "osx" ]; then
    echo "== Build OSX App =="
    electron-packager . 'Before Dawn' \
                      --prune \
                      --out=${DEST}/osx \
                      --platform=darwin \
                      --arch=x64 \
                      --version=${ELECTRON_VERSION} \
                      --icon='assets/icon.icns'  \
                      --overwrite

    echo "== Build OSX Installer =="

    #
    # npm install -g electron-builder
    #
    electron-builder "${DEST}/osx/Before Dawn-darwin-x64/Before Dawn.app" \
                     --platform=osx \
                     --out="/${DEST}/osx" \
                     --config=build.json
fi

if [ "$TARGET" == "win" ]; then
    echo "== Build Windows App =="

    electron-packager . 'Before Dawn' \
                      --prune \
                      --out=${DEST}/win \
                      --platform=win32 \
                      --arch=ia32 \
                      --version=${ELECTRON_VERSION} \
                      --icon=assets/icon.ico

    echo "== Build Windows Installer =="
    electron-builder "${DEST}/win/Before Dawn-win32-ia32" \
                     --platform=win \
                     --out="${DEST}/win" \
                     --config=build.json

    echo "== Cleaning Up =="
    rm -rf "${DEST}/osx/Before Dawn-darwin-x64"
    rm -rf "${DEST}/win/Before Dawn-win32-ia32"
fi

error: pathspec 'build-packages.sh' did not match any file(s) known to git


Create openstack-cinder.sh

Create openstack-cinder.sh

#!/bin/bash

function main() {
	case $1 in
		start)
			[[ "$2" != "" ]] && { start_service $2; return; }
			;;
		stop)
			[[ "$2" != "" ]] && { stop_service $2; return; }
			;;
		list)
			echo cinder-api
			echo cinder-volume
			echo cinder-scheduler
			;;
	esac
}

function start_service() {

	local name=$1
	local i=0
	case $name in
		cinder-api)
			echo -n starting $name " ..."
			nohup sudo -u cinder /usr/bin/cinder-api --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/api.log &>/dev/null &
			while !curl http://localhost:8776 &>/dev/null; do
				((i++)); [[ $i -gt 20 ]] && break
				sleep 0.3
			done
		;;
		cinder-volume)
			echo -n starting $name " ..."
			nohup sudo -u cinder /usr/bin/cinder-volume --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/volume.log &>/dev/null &
		;;
		cinder-scheduler)
			echo -n starting $name " ..."
			nohup sudo -u cinder /usr/bin/cinder-scheduler --config-file /usr/share/cinder/cinder-dist.conf --config-file /etc/cinder/cinder.conf --logfile /var/log/cinder/scheduler.log &>/dev/null &
		;;
		*)
			echo service is not exists; return
	esac
	if [[ $i -gt 20 ]]; then
		echo "    Timeout"; return
	fi
	echo "    Succ"
}

function stop_service() {

	local name=$1
	case $name in
		cinder-api|cinder-volume|cinder-scheduler)
			echo -n stopping $name "   "
			while killall $name &>/dev/null; do echo -n .; sleep 0.1; done
			echo "    Succ"
		;;
		*)
			echo service is not exists;
	esac
}

main "$@"

error: pathspec 'docker/openstack-cinder.sh' did not match any file(s) known to git


personal utility for make dist'ing && updating a local ebuild for merging for testing on my box. rather gentoo specific I'm afraid

#!/bin/sh
sudo ls && make dist && \
cp diffball-0.7.tar.bz2 /usr/portage/distfiles && \
rm -f /usr/local/portage/dev-util/diffball/files/digest-diffball-0.7 && \
ebuild /usr/local/portage/dev-util/diffball/diffball-0.7.ebuild digest && \
sudo emerge diffball

error: pathspec 'gentoo-test.sh' did not match any file(s) known to git


Added gpg-agent plugin

Added gpg-agent plugin

Based on ssh-agent plugin.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/joeylomanto/oh-my-zsh.git/'


selenium config

selenium config

#!/bin/bash
set -e

if (( $EUID == 0 )); then
    echo "Please do not run as root."
    exit 1
fi

cd "$(dirname "$0")"

./devserver.sh

if ! sudo grep -q -e "jenkins" "/etc/sudoers"; then
    sudo cp /etc/sudoers /tmp/sudoers
    sudo chmod go+rw /tmp/sudoers

    echo "jenkins ALL = (selenium) NOPASSWD: /home/selenium/config-selenium/tp_web.sh" >> /tmp/sudoers
    sudo chmod go-rw /tmp/sudoers
    sudo cp /tmp/sudoers /etc/sudoers
fi

error: pathspec 'profile/selenium.sh' did not match any file(s) known to git


Added checks to detect failed commands

Added checks to detect failed commands

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/DeepElement/weak-dictionary.git/'


Fixing a bug resulting from misuse of `ln`.

`ln` treats a symlink that points to a directory as the target directory and
creates a new symlink in that directory instead of replacing the existing
symlink itself. I had to use the '-h' flag to stop this from happening.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/gkb/gh-dot-files.git/'


Configure containers for XenServer 6.5 SP 1

# Get and install docker [container] support for XenServer 7
$ wget http://downloadns.citrix.com.edgesuite.net/10343/XenServer-6.5.0-SP1-xscontainer.iso
$ xe-install-supplemental-pack XenServer-6.5.0-SP1-xscontainer.iso

error: pathspec 'sh/Xen6.5SP1ContainerInstall.sh' did not match any file(s) known to git


document function parameters

document function parameters

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/pordoqui/dcs-fastvel-wf.git/'


added libvirt script to activate logs

added libvirt script to activate logs

if [ $1 == "set" ]; then
    virt-admin daemon-log-filters "1:util 1:libvirt 1:storage 1:network 1:nodedev 1:qemu"
    virt-admin daemon-log-filters
    virt-admin daemon-log-outputs "1:file:/libvirt.log"
    virt-admin daemon-log-outputs
fi
if [ $1 == "unset" ]; then
    virt-admin daemon-log-filters ""
    virt-admin daemon-log-filters
    virt-admin daemon-log-outputs "3:stderr"
    virt-admin daemon-log-outputs
fi

error: pathspec 'docker/hypervisor/checks/libvirt-log.sh' did not match any file(s) known to git


chore(rime-new-plugin.sh): create plugin using template code

#!/bin/bash

if [[ -z "${1}" ]]; then
  echo "Usage: $(basename "$0") <plugin-name>"
  exit 1
fi

plugin_name="${1/_/-}"
plugin_name="${plugin_name#rime-}"
plugin_dir="plugins/${plugin_name}"
plugin_module="${plugin_name/-/_}"

echo "plugin_name: rime-${plugin_name}"
echo "plugin_dir: ${plugin_dir}"
echo "plugin_module: ${plugin_module}"

mkdir -p "${plugin_dir}"

cat >> "${plugin_dir}/CMakeLists.txt" << //EOF
project(rime-${plugin_name})
cmake_minimum_required(VERSION 2.8)

aux_source_directory(src ${plugin_module}_src)

add_library(rime-${plugin_name}-objs OBJECT \${${plugin_module}_src})
if(BUILD_SHARED_LIBS)
  set_target_properties(rime-${plugin_name}-objs
    PROPERTIES
    POSITION_INDEPENDENT_CODE ON)
endif()

set(plugin_name rime-${plugin_name} PARENT_SCOPE)
set(plugin_objs \$<TARGET_OBJECTS:rime-${plugin_name}-objs> PARENT_SCOPE)
set(plugin_deps \${rime_library} PARENT_SCOPE)
set(plugin_modules "${plugin_module}" PARENT_SCOPE)
//EOF

mkdir -p "${plugin_dir}/src"

cat >> "${plugin_dir}/src/${plugin_module}_module.cc" << //EOF
#include <rime/component.h>
#include <rime/registry.h>
#include <rime_api.h>

#include "todo_processor.h"

using namespace rime;

static void rime_${plugin_module}_initialize() {
  Registry &r = Registry::instance();
  r.Register("todo_processor", new Component<TodoProcessor>);
}

static void rime_${plugin_module}_finalize() {
}

RIME_REGISTER_MODULE(${plugin_module})
//EOF

cat >> "${plugin_dir}/src/todo_processor.h" << //EOF
#include <rime/common.h>
#include <rime/context.h>
#include <rime/engine.h>
#include <rime/processor.h>

using namespace rime;

class TodoProcessor : public Processor {
 public:
  explicit TodoProcessor(const Ticket& ticket)
    : Processor(ticket) {
    Context* context = engine_->context();
    update_connection_ = context->update_notifier()
      .connect([this](Context* ctx) { OnUpdate(ctx); });
  }

  virtual ~TodoProcessor() {
    update_connection_.disconnect();
  }

  ProcessResult ProcessKeyEvent(const KeyEvent& key_event) override {
    return kNoop;
  }

 private:
  void OnUpdate(Context* ctx) {}

  connection update_connection_;
};
//EOF

error: pathspec 'rime-new-plugin.sh' did not match any file(s) known to git


added Lightpaper install script

added Lightpaper install script

#!/bin/bash

TARGET_DIR="${HOME}/.lightpaper/Themes/"
INSTALL_FILE="Snowball.txt"
SUCCESS_MSG="The Snowball Markdown editor theme was successfully installed.  You can select this theme in LightPaper Preferences > Styles > Theme (MD tab)."

if [ -d "$TARGET_DIR" ]; then
  cp "$INSTALL_FILE" "$TARGET_DIR"
  echo "$SUCCESS_MSG"
else
  echo "Creating the install directory path..."
  mkdir -p "$TARGET_DIR"
  echo "Done. Installing '$INSTALL_FILE'..."
  cp "$INSTALL_FILE" "$TARGET_DIR"
  echo "$SUCCESS_MSG"
fi
exit 0

error: pathspec 'lightpaper/install.sh' did not match any file(s) known to git


Fix boostrap.sh build (network configure)

cabal.git 7f9c23d fails when configuring network:
checking whether the C compiler works... no

To fix that, update network version to 2.4.2.2.

See #1634.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/anton-dessiatov/cabal.git/'


Add build.sh - build examples program by command line

#!/bin/bash

set -e

checkenv() {
  set +e
  value=`printenv $1`
  set -e

  if [ -z "$value" ]
  then
     echo "$1 environment variable is not set"
     exit -1;
  fi

}

checkenv "USER";
checkenv "QT_HOME";
checkenv "ANDROID_SDK_ROOT";
checkenv "ANDROID_NDK_ROOT"

PLATFORM=android_armv7

QT_ANDROID_BIN=$QT_HOME/$PLATFORM/bin
QMAKE=$QT_ANDROID_BIN/qmake
ANDROID_BUILD_DIR=$PWD/build/android

mkdir -p build;
cd build;
$QMAKE ../../../examples/quickandroidexample
make
make install INSTALL_ROOT=$ANDROID_BUILD_DIR
$QT_ANDROID_BIN/androiddeployqt --input android-libquickandroidexample.so-deployment-settings.json --release --output $ANDROID_BUILD_DIR

error: pathspec 'tests/quickandroidactivitytests/build.sh' did not match any file(s) known to git


Add the testing script

Add the testing script

#!/bin/sh

../bin/recognize ../train_data/test_images/image_0002.jpg
../bin/recognize ../train_data/test_images/image_0009.jpg
../bin/recognize ../train_data/test_images/image_0019.jpg
../bin/recognize ../train_data/test_images/image_0022.jpg
../bin/recognize ../train_data/test_images/image_0032.jpg
../bin/recognize ../train_data/test_images/image_0041.jpg
../bin/recognize ../train_data/test_images/image_0042.jpg
../bin/recognize ../train_data/test_images/image_0045.jpg
../bin/recognize ../train_data/test_images/image_0051.jpg
../bin/recognize ../train_data/test_images/image_0056.jpg
../bin/recognize ../train_data/test_images/image_0062.jpg
../bin/recognize ../train_data/test_images/image_0063.jpg
../bin/recognize ../train_data/test_images/image_0069.jpg
../bin/recognize ../train_data/test_images/image_0070.jpg
../bin/recognize ../train_data/test_images/image_0074.jpg
../bin/recognize ../train_data/test_images/image_0079.jpg
../bin/recognize ../train_data/test_images/image_0083.jpg
../bin/recognize ../train_data/test_images/image_0088.jpg
../bin/recognize ../train_data/test_images/image_0101.jpg
../bin/recognize ../train_data/test_images/image_0102.jpg
../bin/recognize ../train_data/test_images/image_0109.jpg
../bin/recognize ../train_data/test_images/image_0117.jpg
../bin/recognize ../train_data/test_images/image_0119.jpg
../bin/recognize ../train_data/test_images/image_0125.jpg
../bin/recognize ../train_data/test_images/image_0126.jpg

error: pathspec 'src/test.sh' did not match any file(s) known to git


new build.sh script for build and push the images

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/backd-io/backd.git/'


Added start shell script

Added start shell script

#!/bin/sh

java -cp target/register-app-1.0-SNAPSHOT-jar-with-dependencies.jar se.citerus.App

error: pathspec 'register-app/startApp.sh' did not match any file(s) known to git


Use smoke-test instead of acceptance-tests for mysql release

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/hsiliev/cf-zoo.git/'


shark: moved scripts to scripts/

shark: moved scripts to scripts/

#! /bin/bash

function sweep()
{
    lib=$1
    runcmd=$2
    heatcmd=$3
    for n in 1 2 4
    do
        for t in 1 # 2 4 8 16 32
        do
            set -x
            $runcmd -n $n $heatcmd -t $t >$lib.$n.$t.log 2>&1
            set +x
        done
    done
}

N=8192
I=20
sweep gpi "$HOME/exa2ct/gpi2-release/bin/gaspi_run -m $HOME/nodes" "./heat.gpi -n $N -i $I"
sweep mpi "mpirun -f $HOME/nodes" "./heat.mpi -n $N -i $I"

error: pathspec 'scripts/spawn.sh' did not match any file(s) known to git


Removed CVS fields and automated version-setting.

error: pathspec 'setver.sh' did not match any file(s) known to git


Create mkdir.sh

Create mkdir.sh

ssh ****@호스트주소 mkdir hdd2/cloudcam/`hostname`

error: pathspec 'apps/camera/simple_capture/mkdir.sh' did not match any file(s) known to git


Add .symlink-dotfiles.sh script

Add .symlink-dotfiles.sh script

#!/bin/bash

# Make sure we're in our home directory
cd /home/$USER/

# Make * match ALL files, including hidden files
shopt -s dotglob

# Get all files/directories inside of the dotfiles directory
dotFiles=`pwd`/dotfiles/*

# Create a symlink in the current directory for all files/dirs inside of the dotfiles directory
for dotfile in $dotFiles
do
    ln -s $dotfile ./`basename $dotfile`
done

error: pathspec '.symlink-dotfiles.sh' did not match any file(s) known to git


Fixing exit code and output of test runner

The test-runner will run all test suites and display their names anyway, then use an appropriate exit
code in case of failures.
Using the list of components to be tested (was using the skipped components list to be sure that the
exit code of the test runner were correct).

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/MadCat34/zend-cache.git/'


Fix Travis test-runner

Fix Travis test-runner

- $result was getting calculated incorrectly
- use --stderr switch for phpunit

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/turrsis/zend-router.git/'


Add a few more install options

Add a few more install options

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/angrygoats/slackware-vps-config.git/'


Reload Bluepill in stages, completely resolves all the timeout problems.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/rletters/ansible-playbook.git/'


Adding script to rebuild all packages

Adding script to rebuild all packages

gcutil --service_version=v1 --project=dart-carte-du-jour ssh --ssh_user=financeCoding --ssh_port=443 daemon-isolate curl http://localhost:8889/rebuildAll

error: pathspec 'scripts/daemon_launch/rebuild_all_packages.sh' did not match any file(s) known to git


add sample cronjob script for automatic renew

#!/bin/zsh

basedir="${HOME}/letse/"

# renew X days prior to expiry of crt
renew_before=20

script_dir="$(dirname $(readlink -f "${0}"))"

for cert in $(cat "${basedir}"/active); do
	expiresAt="$(date -d "$(openssl x509 -in "${basedir}/${cert}/live/certificate.crt" -noout -enddate | sed s/notAfter=//g)" +%s)"
	now="$(date +%s)"

	diff=$(( expiresAt - now  ))
	diffdays=$(( diff / 86400 ))

	if [[ $diffdays -le $renew_before ]]; then
		"${script_dir}"/letsencrypt.zsh renew "$cert"
	fi
done

error: pathspec 'cron_letsencrypt_renew.sh' did not match any file(s) known to git


VP9VideoRecompressor_V2 updated

VP9VideoRecompressor_V2 updated

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/DarkCaster/Linux-Helper-Tools.git/'


Added add_backup_user.sh

Added add_backup_user.sh

First version of the script. Needs more testing.

error: pathspec 'debian/add_backup_user.sh' did not match any file(s) known to git


Add ckeck-service-endpoints script

Add ckeck-service-endpoints script

#!/bin/bash
echo ""
echo "                .-+symmmKKKKmmmys+-."
echo "             :sfKKKKKKKKKKKKKKKKKKKKfs:"
echo "          :yKKKKKKKKKKKKKKKKKKKKKKKKKKKKy:"
echo "        +mKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKm."
echo "      :mKKKKKKKKKKKKKKKKKKKKKKKKKf-*^^-oKKKm:"
echo "     oKKKKKKKKKKKKKKKKKKKKKKKKKK' .odm. ':dKKKo"
echo "    oKKKKKKKKKKKKKKKKKKKKKKKKKy' :KKKKb  ;hKKKKo"
echo "   oKKKKKKKKKKKKKKKYYYKKKKKKK:  .KKKKKKhdmKKKKKKo"
echo "  yKKKKKKKKKKKKs'      'qKKK-   sKKKsymKKKKKKKKKKy"
echo " -KKKKKKKKKKKh'  /KKKKK.  ^*   'KKKK;  yKKKKKKKKKK-"
echo " yKKKKKKKKKKK.   :mKKKKKKb-    /KKm'  +KKKKKKKKKKKy"
echo " mKKKKKKKKKKK:    'oKKKKKK       _.sodKKKKKKKKKKKKK"
echo " KKKKKKKKKmKKK+     'dKKKo    .KKKKKKKKKKKKKKKKKKKK"
echo " mKKKKKKd'  sKKdb    :KKK'    oKKKKKKKKKKKKKKKKKKKm"
echo " yKKKKKKm   .QQgo    sKKy    'KKKKKKKKKKKKKKKKKKKKy"
echo " -KKKKKKKm,        :hKKK:    oKKKKKKKKKKKKKKKKKKKK-"
echo "  yKKKKKKKKKbnnnndKKKKKd    -KKKKKKKKKKKKKKKKKKKKy"
echo "   dKKKKKKKKKKKKKKKKKKK/   .mKKKKKKKKKKKKKKKKKKKd"
echo "    dKKKKKKKKKKmKKKKKKh   -mKKKKKKKKKKKKKKKKKKKd"
echo "     sKKKKKKKs'  :KKKd'  oKKKKKKKKKKKKKKKKKKKKs"
echo "      :mKKKKKs.  +QP'  +mKKKKKKKKKKKKKKKKKKKm:"
echo "        *mKKKmo:.._..odKKKKKKKKKKKKKKKKKKKKm*"
echo "          :yKKKKKKKKKKKKKKKKKKKKKKKKKKKKy:"
echo "            ':smKKKKKKKKKKKKKKKKKKKKms:'"
echo "               '*-+symmmKKKKmmmys+-*'"
echo ""
echo "               Kubernetes-for-Symfony"
echo ""
echo ""
sleep 1
echo "CHECKING..."
echo ""

if [[ $(minikube status | grep 'minikube: Stopped') == 'minikube: Stopped' ]]; then
  echo "ERROR: Minikube is already running"
fi

if [[ $(minikube status | grep 'minikube: Running') == 'minikube: Running' ]]; then
  URL="$(minikube service symfony --url)"
  echo ""
  echo "SYMFONY ENDPOINT -> ${URL}"
  echo ""
fi

error: pathspec 'check-service-endpoints.sh' did not match any file(s) known to git


Add keychain script

Add keychain script

#!/usr/bin/env bash

if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
    export CERTIFICATE_P12=Certificate.p12;
    echo "$CERTIFICATE_OSX_P12" | base64 — decode > $CERTIFICATE_P12;
    export KEYCHAIN=build.keychain;
    security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN;
    security default-keychain -s $KEYCHAIN;
    security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN;
    security import $CERTIFICATE_P12 -k $KEYCHAIN -P "$CERTIFICATE_PASSWORD" -T /usr/bin/codesign;
fi

error: pathspec 'script/keychain.sh' did not match any file(s) known to git


added tor

added tor

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/vitorgalvao/dotfiles.git/'


added hex-fiend

added hex-fiend


added secrets

added secrets


Recorder wrapper

Recorder wrapper

#!/bin/sh
echo -n -e "\033]0;Containers. Containers. Containers. Made Simple!\007"

s=hello-weave-screencast

tmux -2 new-session -d -s $s -x 160 -y 90

tmux set -t $s status off

tmux set -t $s pane-border-fg black
tmux set -t $s pane-active-border-fg black
tmux set -t $s pane-active-border-bg default

tmux split-window -v

tmux select-pane -t 0
tmux send-keys 'clear; ./record.sh weave-01; exit' C-m

tmux select-pane -t 1
tmux send-keys 'clear; ./record.sh weave-02; exit' C-m

tmux select-pane -t 0

tmux -2 attach-session -t $s

error: pathspec 'screencasts/hello-weave/tmux-record.sh' did not match any file(s) known to git


Update process.sh

Update process.sh

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/gandalf-the-white/dockreventlov.git/'


Update process.sh

Update process.sh


Merging with iWader to remove napapp

Merging with iWader to remove napapp

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mikerodham/dotfiles.git/'


fix ze function

fix ze function

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/joejuzl/dotfiles.git/'


add unwrap stage2 script

add unwrap stage2 script

#!/bin/sh

version=16.30-1.mga5
arch=x86_64
gitdir=/home/joe/git
stage1ver=2.9-3.mga5

pushd $gitdir
if [ ! -d mageia ] ; then
git clone https://github.com/joequant/mageia.git
fi

cd mageia
git checkout master
git pull
git branch $version
git checkout $version

mkdir -p installer/$arch/install/stage2
cd installer/$arch/install/stage2
rm *.rpm*
wget ftp://ftp.sunet.se/pub/os/Linux/distributions/mageia/distrib/cauldron/x86_64/media/core/release/drakx-installer-stage2-$version.$arch.rpm
rpm2cpio drakx-installer-stage2-$version.$arch.rpm | cpio -idmv
mv ./usr/lib64/drakx-installer-stage2/install/stage2/mdkinst.sqfs .
mv ./usr/lib64/drakx-installer-stage2/install/stage2/VERSION .
rm -rf drakx-installer-stage2-$version.$arch.rpm ./usr
git add mdkinst.sqfs
git add VERSION
popd

error: pathspec 'oz/unwrap-stage2.sh' did not match any file(s) known to git


cleanup

cleanup

#!/bin/sh

pandoc README.md -o README.rst
sed -i '' '/\.\. raw:: html/,/<!-- \/MarkdownTOC -->/d' README.rst;

error: pathspec 'README.md.2.rst.sh' did not match any file(s) known to git


Added script to compile and install nmh

Added script to compile and install nmh

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/viklund/dotfiles.git/'


Added shell script to download the example data

curl --create-dirs -o data/movie_data.mat https://www.dropbox.com/s/7areadyb6ddvl5h/movie_data.mat?dl=0
curl --create-dirs -o data/label.mat https://www.dropbox.com/s/ogd26q6fro4l2d2/label.mat?dl=0
curl --create-dirs -o data/image_data.mat https://www.dropbox.com/s/wks4fwgzetmeqb4/image_data.mat?dl=0

error: pathspec 'examples/download-data.sh' did not match any file(s) known to git


Added install-all.sh

Added install-all.sh

#!/bin/sh

PACKAGES="yesod-core yesod-json yesod-static yesod-persistent yesod-newsfeed yesod-form yesod-auth yesod-sitemap yesod yesod-examples"
CABAL=cabal

for package in $PACKAGES
do
    echo Installing $package
    cd $package
    $CABAL configure --enable-tests && $CABAL build && $CABAL test && ./Setup.lhs install || exit
    cd ..
done

error: pathspec 'install-all.sh' did not match any file(s) known to git


Change to U.S. ubuntu archives

Change to U.S. ubuntu archives

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/jig/myubuntu.git/'


python pip installer

python pip installer

#!/bin/bash

# tested on ubuntu 16.04 (gnome)
# tested on ubuntu 14.04.3 (gnome)

SCRIPT_NAME=$(basename $BASH_SOURCE)
SCRIPT_LOGFILE="./logs/"$(basename -s .sh $BASH_SOURCE)".log"
SCRIPT_ENVFILE="./logs/"$(basename -s .sh $BASH_SOURCE)".env"
mkdir -p ./logs && chmod 755 ./logs

echo "running "$SCRIPT_NAME

# checking pip
if hash pip 2>/dev/null; then
	echo "  checking pip => ok"
else
	echo "  checking pip => pip not installed, installing it"
	exit;
fi

# checking pip3
if hash pip3 2>/dev/null; then
	echo "  checking pip3 => ok"
else
	echo "  checking pip3 => pip3 not installed, installing it"
	exit;
fi

error: pathspec 'install_pip.sh' did not match any file(s) known to git