X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b6d7efab2c4bffa3fabd55b166e44cca8ac1391f..7ff8f285eb1ff374091e2d8e8e23f36d8b15a775:/build/run-library.sh diff --git a/build/run-library.sh b/build/run-library.sh index ac5dc718be..f8e5129dae 100755 --- a/build/run-library.sh +++ b/build/run-library.sh @@ -48,7 +48,6 @@ version_from_git() { # Output the version being built, or if we're building a # dev/prerelease, output a version number based on the git log for # the given $subdir. - local minorversion="$1"; shift # unused local subdir="$1"; shift if [[ -n "$ARVADOS_BUILDING_VERSION" ]]; then echo "$ARVADOS_BUILDING_VERSION" @@ -66,7 +65,7 @@ nohash_version_from_git() { echo "$ARVADOS_BUILDING_VERSION" return fi - version_from_git $1 | cut -d. -f1-4 + version_from_git | cut -d. -f1-4 } timestamp_from_git() { @@ -74,6 +73,18 @@ timestamp_from_git() { format_last_commit_here "%ct" "$subdir" } +calculate_python_sdk_cwl_package_versions() { + python_sdk_ts=$(cd sdk/python && timestamp_from_git) + cwl_runner_ts=$(cd sdk/cwl && timestamp_from_git) + + python_sdk_version=$(cd sdk/python && nohash_version_from_git) + cwl_runner_version=$(cd sdk/cwl && nohash_version_from_git) + + if [[ $python_sdk_ts -gt $cwl_runner_ts ]]; then + cwl_runner_version=$python_sdk_version + fi +} + handle_python_package () { # This function assumes the current working directory is the python package directory if [ -n "$(find dist -name "*-$(nohash_version_from_git).tar.gz" -print -quit)" ]; then @@ -127,7 +138,7 @@ calculate_go_package_version() { cd "$WORKSPACE" ts="$(timestamp_from_git "$dir")" if [[ "$ts" -gt "$timestamp" ]]; then - version=$(version_from_git "" "$dir") + version=$(version_from_git "$dir") timestamp="$ts" fi done @@ -465,7 +476,7 @@ fpm_build_virtualenv () { fi # arvados-python-client sdist should always be built, to be available - # for other dependant packages. + # for other dependent packages. if [[ -n "$ONLY_BUILD" ]] && [[ "arvados-python-client" != "$PKG" ]] && [[ "$PYTHON_PKG" != "$ONLY_BUILD" ]] && [[ "$PKG" != "$ONLY_BUILD" ]]; then return 0 fi @@ -563,7 +574,7 @@ fpm_build_virtualenv () { cd build/usr/share/$python/dist/$PYTHON_PKG/ # Replace the shebang lines in all python scripts, and handle the activate - # scripts too This is a functional replacement of the 237 line + # scripts too. This is a functional replacement of the 237 line # virtualenv_tools.py script that doesn't work in python3 without serious # patching, minus the parts we don't need (modifying pyc files, etc). for binfile in `ls bin/`; do @@ -613,7 +624,7 @@ fpm_build_virtualenv () { # 12271 - As FPM-generated packages don't include scripts by default, the # packages cleanup on upgrade depends on files being listed on the %files # section in the generated SPEC files. To remove DIRECTORIES, they need to - # be listed in that sectiontoo, so we need to add this parameter to properly + # be listed in that section too, so we need to add this parameter to properly # remove lingering dirs. But this only works for python2: if used on # python33, it includes dirs like /opt/rh/python33 that belong to # other packages. @@ -621,7 +632,7 @@ fpm_build_virtualenv () { COMMAND_ARR+=('--rpm-auto-add-directories') fi - if [[ "$PKG" == "arvados-python-client" ]]; then + if [[ "$PKG" == "arvados-python-client" ]] || [[ "$PKG" == "arvados-fuse" ]]; then if [[ "$python" == "python2.7" ]]; then COMMAND_ARR+=('--conflicts' "$PYTHON3_PKG_PREFIX-$PKG") else @@ -638,7 +649,8 @@ fpm_build_virtualenv () { COMMAND_ARR+=('-n' "$PYTHON_PKG") COMMAND_ARR+=('-C' "build") - if [[ -e "$WORKSPACE/$PKG_DIR/$PKG.service" ]]; then + systemd_unit="$WORKSPACE/$PKG_DIR/$PKG.service" + if [[ -e "${systemd_unit}" ]]; then COMMAND_ARR+=('--after-install' "${WORKSPACE}/build/go-python-package-scripts/postinst") COMMAND_ARR+=('--before-remove' "${WORKSPACE}/build/go-python-package-scripts/prerm") fi @@ -671,6 +683,12 @@ fpm_build_virtualenv () { COMMAND_ARR+=('--depends' "$i") done + # make sure the systemd service file ends up in the right place + # used by arvados-docker-cleaner and arvados-node-manager + if [[ -e "${systemd_unit}" ]]; then + COMMAND_ARR+=("usr/share/$python/dist/$PKG/share/doc/$PKG/$PKG.service=/lib/systemd/system/$PKG.service") + fi + COMMAND_ARR+=("${fpm_args[@]}") # Make sure to install all our package binaries in /usr/bin. @@ -912,7 +930,9 @@ timer_reset() { } timer() { - echo -n "$(($SECONDS - $t0))s" + if [[ -n "$t0" ]]; then + echo -n "$(($SECONDS - $t0))s" + fi } report_outcomes() {