[pacman-dev] [PATCH 1/4] makepkg: cleanup a few format string injections

Dave Reisner dreisner at archlinux.org
Tue Sep 3 23:19:05 EDT 2013


Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
 scripts/makepkg.sh.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d0951df..5a74b3e 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1204,16 +1204,16 @@ check_checksums() {
 			for file in "${source[@]}"; do
 				local found=1
 				file="$(get_filename "$file")"
-				printf "%s" "    $file ... " >&2
+				printf '    %s ... ' "$file" >&2
 
 				if [[ ${integrity_sums[$idx]} = 'SKIP' ]]; then
-					echo "$(gettext "Skipped")" >&2
+					printf '%s\n' "$(gettext "Skipped")" >&2
 					idx=$((idx + 1))
 					continue
 				fi
 
 				if ! file="$(get_filepath "$file")"; then
-					printf -- "$(gettext "NOT FOUND")\n" >&2
+					printf '%s\n' "$(gettext "NOT FOUND")" >&2
 					errors=1
 					found=0
 				fi
@@ -1223,9 +1223,9 @@ check_checksums() {
 					local realsum="$(openssl dgst -${integ} "$file")"
 					realsum="${realsum##* }"
 					if [[ $expectedsum = "$realsum" ]]; then
-						printf -- "$(gettext "Passed")\n" >&2
+						printf '%s\n' "$(gettext "Passed")" >&2
 					else
-						printf -- "$(gettext "FAILED")\n" >&2
+						printf '%s\n' "$(gettext "FAILED")" >&2
 						errors=1
 					fi
 				fi
-- 
1.8.4



More information about the pacman-dev mailing list