makepkg: normalize whitespace in $pkgdesc when writing .PKGINFO

Specifically, we shouldn't allow newlines in the pkgdesc field, as
pacman will ignore the continuation and end the description prematurely
as written to the local DB. Normalize ALL whitespace, replacing it with
single whitespace characters.

Fixes strange errors as seen by FS#32852.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Dave Reisner 2012-11-25 16:02:47 -05:00 committed by Allan McRae
parent 5a5e712c74
commit c8417f3386
1 changed files with 1 additions and 1 deletions

View File

@ -1721,7 +1721,7 @@ write_pkginfo() {
printf "pkgname = %s\n" "$pkgname"
(( SPLITPKG )) && echo pkgbase = $pkgbase
echo "pkgver = $(get_full_version)"
printf "pkgdesc = %s\n" "$pkgdesc"
printf "pkgdesc = %s\n" "${pkgdesc//+([[:space:]])/ }"
printf "url = %s\n" "$url"
printf "builddate = %s\n" "$builddate"
printf "packager = %s\n" "$packager"