[pacman-dev] [PATCH] makepkg: improve stripping pkgdesc of whitespace for .PKGINFO

Allan McRae allan at archlinux.org
Sun Nov 9 05:53:47 UTC 2014


Signed-off-by: Allan McRae <allan at archlinux.org>
---
 scripts/makepkg.sh.in | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 15eaa01..ec28bf3 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -2153,7 +2153,12 @@ write_pkginfo() {
 		printf "basever = %s\n" "$basever"
 	fi
 
-	printf "pkgdesc = %s\n" "${pkgdesc//+([[:space:]])/ }"
+	# TODO: all fields should have this treatment
+	local spd="${pkgdesc//+([[:space:]])/ }"
+	spd=("${spd[@]#[[:space:]]}")
+	spd=("${spd[@]%[[:space:]]}")
+
+	printf "pkgdesc = %s\n" "$spd"
 	printf "url = %s\n" "$url"
 	printf "builddate = %s\n" "$builddate"
 	printf "packager = %s\n" "$packager"
-- 
2.1.3


More information about the pacman-dev mailing list