From de000682e664347f8ec51986a761f2baf27edbc8 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Sat, 11 Feb 2006 07:17:44 +0000 Subject: db_write cleanup: only write non-empty fields --- scripts/gensync | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/gensync b/scripts/gensync index e51d3069..8dff8884 100755 --- a/scripts/gensync +++ b/scripts/gensync @@ -2,7 +2,7 @@ # # gensync # -# Copyright (c) 2002-2005 by Judd Vinet +# Copyright (c) 2002-2006 by Judd Vinet # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -94,9 +94,11 @@ db_write_entry() echo "%VERSION%" >>desc echo "$pkgver-$pkgrel" >>desc echo "" >>desc - echo "%DESC%" >>desc - echo "$pkgdesc" >>desc - echo "" >>desc + if [ -n $pkgdesc ]; then + echo "%DESC%" >>desc + echo "$pkgdesc" >>desc + echo "" >>desc + fi if [ ${#groups[*]} -gt 0 ]; then echo "%GROUPS%" >>desc for it in "${groups[@]}"; do @@ -104,9 +106,11 @@ db_write_entry() done echo "" >>desc fi - echo "%CSIZE%" >>desc - echo "$csize" >>desc - echo "" >>desc + if [ -n $csize ]; then + echo "%CSIZE%" >>desc + echo "$csize" >>desc + echo "" >>desc + fi if [ ! -z $pkgmd5sum ]; then echo "%MD5SUM%" >>desc echo "$pkgmd5sum" >>desc -- cgit v1.2.3-70-g09d2