# Enable globbing again
set +f
- # If not paths were found take all files
- [ -z "${paths}" ] && paths="${BUILDROOT}"
+ # If not paths were found -> break
+ [ -z "${paths}" ] && return
- for file in $(find ${paths} 2>/dev/null | sort); do
- # Remove ${BUILDROOT}
- file="${file#${BUILDROOT}}"
-
- # Remove all leading slashes
- while [ "${file:0:1}" = "/" ]; do
- file="${file:1:${#file}}"
- done
+ local excludes
+ if [ -n "${exclude_paths}" ]; then
+ excludes=$(find_files ${exclude_paths})
+ fi
- echo "${file}"
+ for file in $(find_files ${paths}); do
+ if [ -n "${excludes}" ]; then
+ if ! listmatch ${file} ${excludes}; then
+ echo "${file}"
+ fi
+ else
+ echo "${file}"
+ fi
done
}