diff options
author | Allan McRae <allan@archlinux.org> | 2017-07-06 13:34:31 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2017-07-06 13:34:31 +1000 |
commit | 9ab44178f4054ffe26af784c32ca9bddb9793e7e (patch) | |
tree | 590fa33fe9690c163749b1f63ff9aba261df2d8c /scripts | |
parent | 1c8b3f2562bb31e52ad0c5fd9eb139d9dda1873e (diff) | |
download | pacman-9ab44178f4054ffe26af784c32ca9bddb9793e7e.tar.xz |
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 <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.sh.in | 9 |
1 files changed, 2 insertions, 7 deletions
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 |