From 1ea1e8ba9b52a5d41ca4970ab481d3d96fc9915e Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 26 Jul 2013 22:26:40 -0400 Subject: [PATCH] cleanup(common): Remove rarely used pv_cat_cmd Its single use is in build_common and even then having a little progress bar for copying images isn't that interesting, they just get lost in the noise of the emerge output. Keep it simple, use cp. --- build_library/build_common.sh | 2 +- common.sh | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/build_library/build_common.sh b/build_library/build_common.sh index 09a31e6df4..12f07afd3f 100644 --- a/build_library/build_common.sh +++ b/build_library/build_common.sh @@ -42,7 +42,7 @@ copy_image() { local dst="${BUILD_DIR}/$2" if should_build_image $1; then echo "Creating $2 from $1..." - $(pv_cat_cmd) "${src}" >"${dst}" || die "Cannot copy $1 to $2" + cp "${src}" "${dst}" || die "Cannot copy $1 to $2" else mv "${src}" "${dst}" || die "Cannot move $1 to $2" fi diff --git a/common.sh b/common.sh index ac7e3d844c..e49316943d 100644 --- a/common.sh +++ b/common.sh @@ -14,23 +14,6 @@ fi # Ensure that any sub scripts we invoke get the max proc count. export NUM_JOBS -# Returns the pv command if it's available, otherwise plain-old cat. Note that -# this function echoes the command, rather than running it, so it can be used -# as an argument to other commands (like sudo). -pv_cat_cmd() { - if type -P pv >&/dev/null; then - # Limit pv's output to 80 columns, for readability. - local term_cols=$(stty size 2>/dev/null | cut -d' ' -f2) - if [[ ${term_cols:-0} -gt 80 ]]; then - echo pv -w 80 - else - echo pv - fi - else - echo cat - fi -} - # Make sure we have the location and name of the calling script, using # the current value if it is already set. : ${SCRIPT_LOCATION:=$(dirname "$(readlink -f "$0")")}