Skip to content
Snippets Groups Projects

Don't try to rsync empty local sources

Merged Alex Iribarren requested to merge mount into master
1 file
+ 13
0
Compare changes
  • Side-by-side
  • Inline
+ 13
0
@@ -60,6 +60,19 @@ fi
if [[ "${TOOL}" == "quick-fedora-mirror" ]]; then
su - build -c "$BINARY -d 4" 2> /local/stderr
else
# If $SOURCE starts with /, let's check if it's empty or not
if [[ $SOURCE == /* ]]; then
if [[ -n "`find $SOURCE -maxdepth 0 -empty -print -quit`" ]]; then
# It's empty, so /afs is probably not mounted correctly. Abort!
RET=-1
cat << EOF | error | tee $OUTPUT
"exit_code": $RET,
"error": "$SOURCE empty, refusing to run",
"output": "$(sed 's/"/\\"/g' /local/stderr)"
EOF
exit $RET
fi
fi
$BINARY $OPTIONS $SOURCE /repo 2> /local/stderr
fi
RET=$?
Loading