accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubbsii <...@git.apache.org>
Subject [GitHub] accumulo pull request #160: ACCUMULO-4490: Simplify Accumulo scripts and con...
Date Thu, 03 Nov 2016 21:48:26 GMT
Github user ctubbsii commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/160#discussion_r86450667
  
    --- Diff: assemble/bin/accumulo ---
    @@ -15,173 +15,567 @@
     # See the License for the specific language governing permissions and
     # limitations under the License.
     
    -# Start: Resolve Script Directory
    -SOURCE="${BASH_SOURCE[0]}"
    -while [ -h "${SOURCE}" ]; do # resolve $SOURCE until the file is no longer a symlink
    -   bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
    -   SOURCE="$(readlink "${SOURCE}")"
    -   [[ "${SOURCE}" != /* ]] && SOURCE="${bin}/${SOURCE}" # if $SOURCE was a relative
symlink, we need to resolve it relative to the path where the symlink file was located
    -done
    -bin="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
    -script=$( basename "${SOURCE}" )
    -# Stop: Resolve Script Directory
    +function build_native() {
    +  native_tarball="$basedir/lib/accumulo-native.tar.gz"
    +  final_native_target="$basedir/lib/native"
     
    -. "${bin}"/config.sh
    +  if [[ ! -f $native_tarball ]]; then
    +      echo "Could not find native code artifact: ${native_tarball}";
    +      exit 1
    +  fi
     
    -START_JAR="${ACCUMULO_HOME}/lib/accumulo-start.jar"
    +  # Make the destination for the native library
    +  mkdir -p "${final_native_target}" || exit 1
     
    -#
    -# Resolve a program to its installation directory
    -#
    -locationByProgram()
    -{
    -   RESULT=$( which "$1" )
    -   if [[ "$?" != 0 && -z "${RESULT}" ]]; then
    -      echo "Cannot find '$1' and '$2' is not set in $ACCUMULO_CONF_DIR/accumulo-env.sh"
    +  # Make a directory for us to unpack the native source into
    +  TMP_DIR=$(mktemp -d /tmp/accumulo-native.XXXX) || exit 1
    --- End diff --
    
    Try adding `trap "rm -rf '""$TMP_DIR""'" 0 1 2 3 15` after this, so that the temp directory
is cleaned up even if the script exits abnormally.
    See https://www.tutorialspoint.com/unix/unix-signals-traps.htm for which signals those
correspond to.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message