index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2011-06-28 21:32:40 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-30 10:32:15 -0500 |
commit | 2860ade2f5f827c41d84bc7826444792433c8009 (patch) | |
tree | e076fbb37deedcf32eed9bfbc9a95b77549a34f1 | |
parent | 84974ed04c16218608312ccf6369cf728eada477 (diff) |
-rw-r--r-- | scripts/repo-add.sh.in | 9 |
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index a8450498..0500b48c 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -630,8 +630,13 @@ if (( success )); then filename=${REPO_DB_FILE##*/} pushd "$tmpdir/tree" >/dev/null - # strip the './' off filenames; this also allows us to tar an empty dir - bsdtar -s '%^./\?%%' -c${TAR_OPT}f "$tmpdir/$filename" ./ + if ( shopt -s nullglob; files=(*); (( ${#files[*]} )) ); then + 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 create_signature "$tmpdir/$filename" |