Skip to content

Commit

Permalink
Update jdk-8/mvn-entrypoint.sh fix carlossg#134 performance issue on …
Browse files Browse the repository at this point in the history
…alpine
  • Loading branch information
davidpelfree committed Nov 12, 2019
1 parent abd5518 commit 1f65bca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions jdk-8/mvn-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ copy_reference_files() {
if cp --help 2>&1 | grep -q reflink ; then
reflink="--reflink=auto"
fi
if [ -n "$(find "${MAVEN_CONFIG}/repository" -maxdepth 0 -type d -empty 2>/dev/null)" ] ; then
if [ ! -d "${MAVEN_CONFIG}/repository" -o 1 = "$(find "${MAVEN_CONFIG}/repository" -maxdepth 1 -type d 2>/dev/null | wc -l)" ] ; then
# destination is empty...
echo "--- Copying all files to ${MAVEN_CONFIG} at $(date)" >> "${log}"
cp -rv ${reflink} . "${MAVEN_CONFIG}" >> "${log}"

local verbose="" # -v is not supported in alpine / busybox
if cp --help 2>&1 | grep -q "\-v" ; then
verbose="-v"
fi

cp -r ${verbose} ${reflink} . "${MAVEN_CONFIG}" >> "${log}"
else
# destination is non-empty, copy file-by-file
echo "--- Copying individual files to ${MAVEN_CONFIG} at $(date)" >> "${log}"
Expand Down Expand Up @@ -47,4 +53,4 @@ unset MAVEN_CONFIG
cd "${owd}"
unset owd

exec "$@"
exec "$@"

0 comments on commit 1f65bca

Please sign in to comment.