From 9ab44178f4054ffe26af784c32ca9bddb9793e7e Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Thu, 6 Jul 2017 13:34:31 +1000 Subject: makepkg: set default value for PACKAGER In write_pkginfo, we checked if $PACKAGER was undefined, and gave a default value if not. Just do this upfront to simplify this function. Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 90f52abe..3c29c2d8 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -622,12 +622,6 @@ write_kv_pair() { } write_pkginfo() { - if [[ -n $PACKAGER ]]; then - local packager="$PACKAGER" - else - local packager="Unknown Packager" - fi - local size="$(@DUPATH@ @DUFLAGS@)" size="$(( ${size%%[^0-9]*} * 1024 ))" @@ -651,7 +645,7 @@ write_pkginfo() { write_kv_pair "pkgdesc" "$spd" write_kv_pair "url" "$url" write_kv_pair "builddate" "$SOURCE_DATE_EPOCH" - write_kv_pair "packager" "$packager" + write_kv_pair "packager" "$PACKAGER" write_kv_pair "size" "$size" write_kv_pair "arch" "$pkgarch" @@ -1430,6 +1424,7 @@ PKGEXT=${_PKGEXT:-$PKGEXT} SRCEXT=${_SRCEXT:-$SRCEXT} GPGKEY=${_GPGKEY:-$GPGKEY} PACKAGER=${_PACKAGER:-$PACKAGER} +PACKAGER=${PACKAGER:-"Unknown Packager"} #default if undefined CARCH=${_CARCH:-$CARCH} if (( ! INFAKEROOT )); then -- cgit v1.2.3-70-g09d2