[pacman-dev] [PATCH] [makepkg] Formatting consistency in write_pkginfo

William Giokas 1007380 at gmail.com
Tue Jan 15 23:45:42 EST 2013


The difference between the echo and the printf's in write_pkginfo seemed
to be somewhat sporadic. Also, the INFAKEROOT check was doing the same
exact thing as the SPLITPKG check, but formatted much differently and
consuming two extra lines. I think this makes it more readable than it
was previously, if nothing else.

Signed-off-by: William Giokas <1007380 at gmail.com>
---
 scripts/makepkg.sh.in | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 5e4bfb4..b0f2f42 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1710,14 +1710,12 @@ write_pkginfo() {
 	size="$(( ${size%%[^0-9]*} * 1024 ))"
 
 	msg2 "$(gettext "Generating %s file...")" ".PKGINFO"
-	echo "# Generated by makepkg $makepkg_version"
-	if (( INFAKEROOT )); then
-		echo "# using $(fakeroot -v)"
-	fi
-	echo "# $(LC_ALL=C date -u)"
+	printf "# Generated by makepkg %s\n" "$makepkg_version"
+	(( INFAKEROOT )) && printf "# using %s\n" "$(fakeroot -v)"
+	printf "# %s\n" "$(LC_ALL=C date -u)"
 	printf "pkgname = %s\n" "$pkgname"
-	(( SPLITPKG )) && echo pkgbase = $pkgbase
-	echo "pkgver = $(get_full_version)"
+	(( SPLITPKG )) && printf "pkgbase = %s\n" "$pkgbase"
+	printf "pkgver = %s\n" "$(get_full_version)"
 	printf "pkgdesc = %s\n" "${pkgdesc//+([[:space:]])/ }"
 	printf "url = %s\n" "$url"
 	printf "builddate = %s\n" "$builddate"
-- 
1.8.1.336.g94702dd



More information about the pacman-dev mailing list