From 665528d7bac99228849d1162f78c0817bc619eee Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 13 Jan 2011 09:33:01 -0600 Subject: 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 --- scripts/repo-add.sh.in | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts/repo-add.sh.in') 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 -- cgit v1.2.3-70-g09d2