update_ebuilds: Fix support for rsync of eclass

For eclasses we need to skip the mkdir and trailing slash.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2024-03-08 15:40:15 +00:00
parent 1bb108e326
commit 601adeb434

View File

@ -57,8 +57,13 @@ for pkg in "$@"; do
if [[ "$FLAGS_portage" == rsync ]]; then
FLAGS_portage="${FLAGS_rsync}"
fi
mkdir -p "$pkg"
rsync $RSYNC_OPTS -v --exclude CVS "$FLAGS_portage/$pkg/" "$pkg"
if [[ "$pkg" =~ "eclass/"* ]]; then
slash=
else
slash="/"
mkdir -p "$pkg"
fi
rsync $RSYNC_OPTS -v --exclude CVS "$FLAGS_portage/$pkg${slash}" "$pkg"
fi
# Make sure we don't change the repo name to 'gentoo'