diff --git a/qt6-after/qt6-migrated-legatus/new_docker_build.sh b/qt6-after/qt6-migrated-legatus/new_docker_build.sh index 2fd215213..7061671ab 100755 --- a/qt6-after/qt6-migrated-legatus/new_docker_build.sh +++ b/qt6-after/qt6-migrated-legatus/new_docker_build.sh @@ -68,7 +68,8 @@ Examples: ./new_docker_build.sh --docker-image legatus-qt6:1.0 ./new_docker_build.sh --delete-prebuilt-image --docker-image legatus-qt6:1.0 ./new_docker_build.sh --docker-image legatus-qt6:1.0 \ - --run-jenkins-builder --package-output-dir /path/to/rpms/guez/26.04 + --run-jenkins-builder \ + --package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/" EOF } @@ -428,7 +429,6 @@ RELEASE_BUILD="${RELEASE_BUILD:-ON}" RUN_CTEST="${RUN_CTEST:-ON}" # Packaging variables RUN_JENKINS_BUILDER="${RUN_JENKINS_BUILDER:-OFF}" -PACKAGE_OUTPUT_DIR="${PACKAGE_OUTPUT_DIR:-/workspace/packages-out}" LTS_VERSION="${LTS_VERSION:-1.0}" PROJECT="${PROJECT:-guez}" GUEZ_MODE="${GUEZ_MODE:-ON}" @@ -534,16 +534,26 @@ if [[ "${RUN_JENKINS_BUILDER}" == "ON" ]]; then exit 1 fi - # Copy produced DEB packages to the packages-out mount so they are + # Copy produced DEB packages to the packages-out mount (host: + # ${PACKAGE_OUTPUT_DIR}, container: /workspace/packages-out) so they are # available on the host after the container exits. - mkdir -p "${PACKAGE_OUTPUT_DIR}" + # make_rpm already writes to /workspace/rpms/... (the host workspace + # mount), so when the host's PACKAGE_OUTPUT_DIR is that same directory + # the packages are already in place - skip copying onto themselves. + DEST_DIR=/workspace/packages-out + mkdir -p "${DEST_DIR}" shopt -s nullglob for deb in "/workspace/rpms/${PROJECT}/${OS_VERSION}/"*.deb; do - cp -f "${deb}" "${PACKAGE_OUTPUT_DIR}/" + base="$(basename "${deb}")" + if [[ -e "${DEST_DIR}/${base}" ]] && + [[ "$(stat -c '%d:%i' "${deb}")" == "$(stat -c '%d:%i' "${DEST_DIR}/${base}")" ]]; then + continue + fi + cp -f "${deb}" "${DEST_DIR}/" done shopt -u nullglob - log_info "DEB packages copied to ${PACKAGE_OUTPUT_DIR}:" - ls -lh "${PACKAGE_OUTPUT_DIR}/" + log_info "DEB packages available in ${DEST_DIR} (host: ${PACKAGE_OUTPUT_DIR:-unknown}):" + ls -lh "${DEST_DIR}/" else log_info "Skipping DEB package production" fi