Skip to content
Snippets Groups Projects
Commit dfc80eb5 authored by Attila Krasznahorkay's avatar Attila Krasznahorkay
Browse files

Merge branch 'py_cleanup' into 'master'

Add and execute script to clean stale files from build area

See merge request !468
parents 9523c626 be3ef593
No related branches found
Tags 2.0.27
2 merge requests!498Update lwtnn to 2.9 in 1.0,!468Add and execute script to clean stale files from build area
......@@ -301,6 +301,13 @@ function( atlas_project name version )
unset( _thisFile )
unset( _thisDir )
# Cleanup stale files in build area:
find_program( _cleanupCmd cleanBuildArea.sh
PATH_SUFFIXES scripts PATHS ${CMAKE_MODULE_PATH} )
message( STATUS "Cleaning stale files from build area" )
execute_process( COMMAND ${_cleanupCmd} ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
OUTPUT_QUIET ERROR_QUIET )
# Set up the "atlas_tests" target. One that all of the unit test builds
# will depend on. This target will either be built by default or not based
# on the value of the ATLAS_ALWAYS_BUILD_TESTS configuration option.
......
#!/bin/bash
#
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
#
# Script to delete stale files from the build area that could be left over from
# a previous build. Typically this happens when source files (or entire packages)
# are removed between incremental builds.
#
# Make sure that we received the right number of arguments:
if [ "$#" -ne 1 ]; then
echo "Syntax: cleanupBuildArea.sh BINARY_DIR"
exit 1
fi
binary_dir=$1
# Find list of all .py[c] files
pyc_files=`find $binary_dir/python -name '*.pyc' | sort`
py_files=`find -L $binary_dir/python -name '*.py' -type f | sort`
# Delete .pyc files without corresponding source file
comm -23 --nocheck-order \
<(echo "$pyc_files") \
<(echo "$py_files" | sed 's/\.py$/\.pyc/') \
| xargs rm -f
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment