From 1be50f8c5cae7d701ab2e8c130a42354ecf1a296 Mon Sep 17 00:00:00 2001 From: rich7420 Date: Thu, 24 Apr 2025 06:52:39 +0800 Subject: [PATCH 1/2] modify cp "-n" error --- hadoop-ozone/dist/dev-support/bin/dist-layout-stitching | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching b/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching index be491a3063ee..12631934a6b1 100755 --- a/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching +++ b/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching @@ -135,11 +135,11 @@ for file in $(find "${ROOT}" -path '*/target/classes/*.classpath' | sort); do module=$(basename "${file%.classpath}") sed -i -e "s;$;:\$HDDS_LIB_JARS_DIR/${module}-${HDDS_VERSION}.jar;" "$file" - cp -n -p -v "$file" share/ozone/classpath/ + cp --update=none -p -v "$file" share/ozone/classpath/ done for file in $(find "${ROOT}" -path '*/share/ozone/lib/*jar' | sort); do - cp -n -p -v "$file" share/ozone/lib/ + cp --update=none -p -v "$file" share/ozone/lib/ done #workaround for https://issues.apache.org/jira/browse/MRESOURCES-236 From 939cbbd282c1dd502af5107a85b034341c21e533 Mon Sep 17 00:00:00 2001 From: rich7420 Date: Thu, 24 Apr 2025 07:21:25 +0800 Subject: [PATCH 2/2] modify error in Mac --- .../dist/dev-support/bin/dist-layout-stitching | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching b/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching index 12631934a6b1..125ccfdf1cbc 100755 --- a/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching +++ b/hadoop-ozone/dist/dev-support/bin/dist-layout-stitching @@ -130,16 +130,23 @@ run cp -p -r "${ROOT}/hadoop-ozone/dist/target/Dockerfile" . run mkdir compose/_keytabs +# Determine CPFLAGS based on system type +if [ "$(uname)" = "Darwin" ]; then + CPFLAGS="--no-clobber" +else + CPFLAGS="--update=none" +fi + for file in $(find "${ROOT}" -path '*/target/classes/*.classpath' | sort); do # We need to add the artifact manually as it's not part the generated classpath desciptor module=$(basename "${file%.classpath}") sed -i -e "s;$;:\$HDDS_LIB_JARS_DIR/${module}-${HDDS_VERSION}.jar;" "$file" - cp --update=none -p -v "$file" share/ozone/classpath/ + cp $CPFLAGS -p -v "$file" share/ozone/classpath/ done for file in $(find "${ROOT}" -path '*/share/ozone/lib/*jar' | sort); do - cp --update=none -p -v "$file" share/ozone/lib/ + cp $CPFLAGS -p -v "$file" share/ozone/lib/ done #workaround for https://issues.apache.org/jira/browse/MRESOURCES-236