diff options
author | Dan McGee <dan@archlinux.org> | 2011-01-13 16:33:01 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-01-14 06:43:58 +0100 |
commit | 665528d7bac99228849d1162f78c0817bc619eee (patch) | |
tree | 82fef7a68cee339ac6340928ffbd9d43d80cbacc | |
parent | 5615b716887960260016646c2d0f812806abe2ec (diff) | |
download | pacman-665528d7bac99228849d1162f78c0817bc619eee.tar.gz pacman-665528d7bac99228849d1162f78c0817bc619eee.tar.xz |
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>
-rw-r--r-- | scripts/repo-add.sh.in | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index 65a63d85..87c7834f 100644 --- a/scripts/repo-add.sh.in +++ b/scripts/repo-add.sh.in @@ -302,13 +302,15 @@ db_write_entry() fi # create a delta file - if [ -n "$oldfilename" -a -f "$oldfile" ]; then - delta=$(pkgdelta -q $oldfile $1) - if [ -f "$delta" ]; then - db_write_delta $delta + if [ -n "$oldfilename" ]; then + if [ -f "$oldfile" ]; then + delta=$(pkgdelta -q $oldfile $1) + if [ -f "$delta" ]; then + db_write_delta $delta + fi + else + warning "$(gettext "Old package file not found: %s")" "$oldfilename" fi - else - warning "$(gettext "Old package file not found : %s")" "$oldfilename" fi return 0 |