From 9c94cd8a2f13ab5cca271b01ed56186bc07c8ee1 Mon Sep 17 00:00:00 2001
From: Kylie McClain <somasis@exherbo.org>
Date: Wed, 29 Jun 2016 16:37:20 -0400
Subject: [PATCH] configure: Replace `pr` since it is not provided by busybox

This patch replaces the usgae of `pr` in log_file() with printf;
`pr` is a POSIX.1 command, but it's a little obscure, and busybox
doesn't provide it, and it's easily replaceable.
---
 configure | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 007c953..b6e450e 100755
--- a/configure
+++ b/configure
@@ -468,7 +468,11 @@ log(){
 
 log_file(){
     log BEGIN $1
-    pr -n -t $1 >> $logfile
+    i=1
+    while read line;do
+        printf '%5s   %s\n' "${i}" "${line}"
+        i=$(($i+1))
+    done < $1 >> $logfile
     log END $1
 }
 
@@ -3321,7 +3325,9 @@ die_unknown(){
 
 print_in_columns() {
     cols=$(expr $ncols / 24)
-    cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
+    printf=$(seq 1 $cols)
+    printf=$(for c in $printf;do printf '%s' '%-5s'; [ $c -eq $cols ] && printf '\n' || printf ' ';done)
+    printf "$printf" $(cat | tr ' ' '\n' | sort)
 }
 
 show_list() {
-- 
2.9.0

