1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

repo-add.sh.in: avoid being clever with repo repacking

Revert to the old behavior that 6f5a90 attempted to simplify and go with
the original proposed solution of using "ugly" bash to detect empty
directories.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dave Reisner 2011-06-28 21:32:40 -04:00 committed by Dan McGee
parent 84974ed04c
commit 2860ade2f5

View File

@ -630,8 +630,13 @@ if (( success )); then
filename=${REPO_DB_FILE##*/} filename=${REPO_DB_FILE##*/}
pushd "$tmpdir/tree" >/dev/null pushd "$tmpdir/tree" >/dev/null
# strip the './' off filenames; this also allows us to tar an empty dir if ( shopt -s nullglob; files=(*); (( ${#files[*]} )) ); then
bsdtar -s '%^./\?%%' -c${TAR_OPT}f "$tmpdir/$filename" ./ bsdtar -c${TAR_OPT}f "$tmpdir/$filename" *
else
# we have no packages remaining? zip up some emptyness
warning "$(gettext "No packages remain, creating empty database.")"
bsdtar -c${TAR_OPT}f "$tmpdir/$filename" -T /dev/null
fi
popd >/dev/null popd >/dev/null
create_signature "$tmpdir/$filename" create_signature "$tmpdir/$filename"