summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorXavier Chantry <chantry.xavier@gmail.com>2010-10-11 18:28:35 +0200
committerDan McGee <dan@archlinux.org>2010-10-11 20:29:22 -0500
commit7d937772313a796f4c0bff76bf1bd7d78f8ccb5a (patch)
treeeceb9d34e5835ab7b359ecc0f6af5deed914649d /scripts
parentc9179b09db405e89093c07756d8e674ff8119ea2 (diff)
downloadpacman-7d937772313a796f4c0bff76bf1bd7d78f8ccb5a.tar.xz
repo-add: more informative delta messages
- Print an error if database entry was not found and delta entry cannot be added - More informative line when delta entry is added (oldfile -> newfile) Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/repo-add.sh.in8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 51a38c3c..945966e3 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -133,13 +133,12 @@ db_write_delta()
pkgentry=$(find_pkgentry $pkgname)
if [[ -z $pkgentry ]]; then
+ error "$(gettext "No database entry for package '%s'.")" "$pkgname"
return 1
fi
deltas="$pkgentry/deltas"
- # create deltas file if it does not already exist
if [[ ! -f $deltas ]]; then
- msg2 "$(gettext "Creating 'deltas' db entry...")"
- echo -e "%DELTAS%" >>$deltas
+ echo -e "%DELTAS%" >$deltas
fi
# get md5sum and compressed size of package
md5sum="$(openssl dgst -md5 "$deltafile")"
@@ -150,10 +149,9 @@ db_write_delta()
newfile=$(xdelta3 printhdr $deltafile | grep "XDELTA filename (output)" | sed 's/.*: *//')
if grep -q "$oldfile.*$newfile" $deltas; then
- warning "$(gettext "An entry for '%s' already existed")" "$deltafile"
sed -i.backup "/$oldfile.*$newfile/d" $deltas && rm -f $deltas.backup
- msg2 "$(gettext "Removing existing entry '%s'...")" "$deltafile"
fi
+ msg2 "$(gettext "Adding 'deltas' entry : %s -> %s")" "$oldfile" "$newfile"
echo ${deltafile##*/} $md5sum $csize $oldfile $newfile >> $deltas
return 0