Ticket #5680: 0001-configure-Replace-pr-since-it-is-not-provided-by-bus.patch

File 0001-configure-Replace-pr-since-it-is-not-provided-by-bus.patch, 1.2 KB (added by Kylie McClain, 10 years ago)

[PATCH] configure: Replace pr since it is not provided by busybox

  • configure

    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 b log(){  
    468468
    469469log_file(){
    470470    log BEGIN $1
    471     pr -n -t $1 >> $logfile
     471    i=1
     472    while read line;do
     473        printf '%5s   %s\n' "${i}" "${line}"
     474        i=$(($i+1))
     475    done < $1 >> $logfile
    472476    log END $1
    473477}
    474478
    die_unknown(){  
    33213325
    33223326print_in_columns() {
    33233327    cols=$(expr $ncols / 24)
    3324     cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t
     3328    printf=$(seq 1 $cols)
     3329    printf=$(for c in $printf;do printf '%s' '%-5s'; [ $c -eq $cols ] && printf '\n' || printf ' ';done)
     3330    printf "$printf" $(cat | tr ' ' '\n' | sort)
    33253331}
    33263332
    33273333show_list() {