Commit fe349098 authored by Lance Hartmann's avatar Lance Hartmann Committed by Darek Stojaczyk
Browse files

setup.sh: Fix cleanup in matching files



The original mechanism to identify files to cleanup
relied on glob matching from the output of 'echo'
piped to a grep.  This yields a case where some
objects can appear and picked up as matching because
other items on the same line matched the grep
string.   Changing this to use 'ls -1' which will
restrict the grep string matching to individual lines
thereby only picking up the entities the script
intended to do.

Change-Id: I020c80236fa68bcabeca0299fe7a27f3320de97b
Signed-off-by: default avatarLance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/437380


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
parent 94cd652b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -259,7 +259,7 @@ function cleanup_linux {
	done
	shopt -u extglob nullglob

	files_to_clean+="$(echo /dev/shm/* | egrep '(spdk_tgt|iscsi|vhost|nvmf|rocksdb|bdevtest|bdevperf)_trace|spdk_iscsi_conns' || true) "
	files_to_clean+="$(ls -1 /dev/shm/* | egrep '(spdk_tgt|iscsi|vhost|nvmf|rocksdb|bdevtest|bdevperf)_trace|spdk_iscsi_conns' || true) "
	files_to_clean="$(readlink -e assert_not_empty $files_to_clean || true)"
	if [[ -z "$files_to_clean" ]]; then
		echo "Clean"