mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
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>
This commit is contained in:
parent
c9179b09db
commit
7d93777231
@ -133,13 +133,12 @@ db_write_delta()
|
|||||||
|
|
||||||
pkgentry=$(find_pkgentry $pkgname)
|
pkgentry=$(find_pkgentry $pkgname)
|
||||||
if [[ -z $pkgentry ]]; then
|
if [[ -z $pkgentry ]]; then
|
||||||
|
error "$(gettext "No database entry for package '%s'.")" "$pkgname"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
deltas="$pkgentry/deltas"
|
deltas="$pkgentry/deltas"
|
||||||
# create deltas file if it does not already exist
|
|
||||||
if [[ ! -f $deltas ]]; then
|
if [[ ! -f $deltas ]]; then
|
||||||
msg2 "$(gettext "Creating 'deltas' db entry...")"
|
echo -e "%DELTAS%" >$deltas
|
||||||
echo -e "%DELTAS%" >>$deltas
|
|
||||||
fi
|
fi
|
||||||
# get md5sum and compressed size of package
|
# get md5sum and compressed size of package
|
||||||
md5sum="$(openssl dgst -md5 "$deltafile")"
|
md5sum="$(openssl dgst -md5 "$deltafile")"
|
||||||
@ -150,10 +149,9 @@ db_write_delta()
|
|||||||
newfile=$(xdelta3 printhdr $deltafile | grep "XDELTA filename (output)" | sed 's/.*: *//')
|
newfile=$(xdelta3 printhdr $deltafile | grep "XDELTA filename (output)" | sed 's/.*: *//')
|
||||||
|
|
||||||
if grep -q "$oldfile.*$newfile" $deltas; then
|
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
|
sed -i.backup "/$oldfile.*$newfile/d" $deltas && rm -f $deltas.backup
|
||||||
msg2 "$(gettext "Removing existing entry '%s'...")" "$deltafile"
|
|
||||||
fi
|
fi
|
||||||
|
msg2 "$(gettext "Adding 'deltas' entry : %s -> %s")" "$oldfile" "$newfile"
|
||||||
echo ${deltafile##*/} $md5sum $csize $oldfile $newfile >> $deltas
|
echo ${deltafile##*/} $md5sum $csize $oldfile $newfile >> $deltas
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user