summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-22 21:35:27 +0200
committerDave Reisner <dreisner@archlinux.org>2011-06-27 19:39:02 +0200
commit6f5a90edb39cdd7e5e3faa7acdbaad288876f9da (patch)
tree4a6e0f8936a87983e79c531714587df993a85366 /scripts
parent112858ae615e4b7b84a2f3617277824d3145a6d8 (diff)
downloadpacman-6f5a90edb39cdd7e5e3faa7acdbaad288876f9da.tar.gz
pacman-6f5a90edb39cdd7e5e3faa7acdbaad288876f9da.tar.xz
repo-add: refactor repacking of repo file
Dump the whole conditional and filter the contents of the directory to create an empty or non-empty archive. Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/repo-add.sh.in10
1 files changed, 2 insertions, 8 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 1e77015f..e7a4be40 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -595,15 +595,9 @@ if (( success )); then
filename=${REPO_DB_FILE##*/}
pushd "$tmpdir" >/dev/null
- if [[ -n $(ls) ]]; then
- bsdtar -c${TAR_OPT}f "$filename" *
- else
- # we have no packages remaining? zip up some emptyness
- warning "$(gettext "No packages remain, creating empty database.")"
- bsdtar -c${TAR_OPT}f "$filename" -T /dev/null
- fi
+ # strip the './' off filenames; this also allows us to tar an empty dir
+ bsdtar -s %^./%% -c${TAR_OPT}f "$REPO_DB_FILE" ./
create_signature "$filename"
-
popd >/dev/null
[[ -f $REPO_DB_FILE ]] && mv -f "$REPO_DB_FILE" "${REPO_DB_FILE}.old"