Skip to content

Commit

Permalink
Use .rbuild.exclude during sync
Browse files Browse the repository at this point in the history
Use a temporary file when the built-in list is used.
Open the exclude file for reading, pass the file descriptor to rsync.
  • Loading branch information
botond-nio authored and akritid committed Oct 18, 2018
1 parent 400ed1d commit 8b17896
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions rbuild
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,22 @@ function stage {
echo Staging source from $LOCAL_DIR to $BUILD_HOST:$STAGING_DIR

if [ -e "$PWD/.rbuild.exclude" ]; then
exclude="$PWD/.rbuild.exclude"
echo >&2 "Using rsync exclude file $exclude"
echo >&2 "Using rsync exclude file $PWD/.rbuild.exclude"
exec 100< "$PWD/.rbuild.exclude"
else
if [ -e $HOME/.rbuild.exclude ]; then
exclude="$HOME/.rbuild.exclude"
echo >&2 "Using rsync exclude file $exclude"
echo >&2 "Using rsync exclude file $HOME/.rbuild.exclude"
exec 100< "$HOME/.rbuild.exclude"
else
echo >&2 "Using built-in rsync exclude file list (displayed with $0 -x)"
exclude="<($0 -x)"
tmpfile=$(mktemp)
($0 -x) > "$tmpfile"
exec 100< "$tmpfile"
rm "$tmpfile"
fi
fi

rsync -r -l -c --executability --del --inplace -z -e "$SSH" --rsync-path="mkdir -p \"$STAGING_DIR\" && rsync" --cvs-exclude --exclude .hg --exclude .git --exclude-from <($0 -x) "$LOCAL_DIR/" "$BUILD_HOST:\"$STAGING_DIR\""
rsync -r -l -c --executability --del --inplace -z -e "$SSH" --rsync-path="mkdir -p \"$STAGING_DIR\" && rsync" --cvs-exclude --exclude .hg --exclude .git --exclude-from <(cat <&100) "$LOCAL_DIR/" "$BUILD_HOST:\"$STAGING_DIR\""
}

function autoreconf {
Expand Down

0 comments on commit 8b17896

Please sign in to comment.