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:
parent
84974ed04c
commit
2860ade2f5
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user