repo-add: fix misguided conditional correction

I tried to move things around here when testing and did a bit too much; the
warning message always showed regardless of delta inclusion in the call. Fix
it so we only warn if we have a filename, but the file couldn't be located.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-01-13 09:33:01 -06:00
parent 5615b71688
commit 665528d7ba

View file

@ -302,7 +302,8 @@ db_write_entry()
fi fi
# create a delta file # create a delta file
if [ -n "$oldfilename" -a -f "$oldfile" ]; then if [ -n "$oldfilename" ]; then
if [ -f "$oldfile" ]; then
delta=$(pkgdelta -q $oldfile $1) delta=$(pkgdelta -q $oldfile $1)
if [ -f "$delta" ]; then if [ -f "$delta" ]; then
db_write_delta $delta db_write_delta $delta
@ -310,6 +311,7 @@ db_write_entry()
else else
warning "$(gettext "Old package file not found: %s")" "$oldfilename" warning "$(gettext "Old package file not found: %s")" "$oldfilename"
fi fi
fi
return 0 return 0
} # end db_write_entry } # end db_write_entry