From 480e1e7ec88b618d16f120c21a54e5fc9b4c94ed Mon Sep 17 00:00:00 2001 From: James Slagle Date: Thu, 18 Sep 2014 09:40:34 -0400 Subject: [PATCH] Update dib-run-parts dib-run-parts in dib-utils had several fixes missing that had been committed to diskimage-builder. When diskimage-builder switched to using dib-run-parts from dib-utils, we lost these fixes. The switch over happened in Ia0a0df7784a14c49b5c47ac0b03e6c2602c84b3b These are the fixes from diskimage-builder that this commit adds back: I44cf98dfc80cfcaec54b88cc83be80a3dbf2cec3 I24fd76c2b4f66b8036010b5079db39ead729abee Iad2d490c86dceab148ea9ab08f457c49a5d5352e Ieb48faacb4c96b7b358771d70c17f2f22d0354f4 Ia68853505485fefbf0890313456e7edb6097666b Ibfb562c5970b40598fc95da1e8d4beb9d51d7612 Change-Id: Ice4b6a4b3d36a02099a682ae8cda4721211d51d9 --- bin/dib-run-parts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/dib-run-parts b/bin/dib-run-parts index 9d5c1aa..72d8e7d 100755 --- a/bin/dib-run-parts +++ b/bin/dib-run-parts @@ -2,7 +2,6 @@ # Inspired by Debian and RedHat run-parts but portable and specific to di-b. # # Copyright 2012 Hewlett-Packard Development Company, L.P. -# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -20,6 +19,7 @@ allowed_regex=${RUN_PARTS_REGEX:-"^[0-9A-Za-z_-]+$"} show_list= set -ue +set -o pipefail name=$(basename $0) @@ -62,10 +62,10 @@ fi targets=$(find $target_dir -maxdepth 1 -xtype f -executable -printf '%f\n' | grep -E "$allowed_regex" | LANG=C sort -n || echo "") if [ "$show_list" == "1" ] ; then - for target in $targets ; do - echo "${target_dir}/${target}" - done - exit 0 + for target in $targets ; do + echo "${target_dir}/${target}" + done + exit 0 fi PROFILE_DIR=$(mktemp -d --tmpdir profiledir.XXXXXX) @@ -74,7 +74,8 @@ ENVIRONMENT_D_DIR=$target_dir/../environment.d if [ -d $ENVIRONMENT_D_DIR ] ; then env_files=$(find $ENVIRONMENT_D_DIR -maxdepth 1 -xtype f | \ - grep -E "/[0-9A-Za-z_\.-]+$") + grep -E "/[0-9A-Za-z_\.-]+$" | \ + LANG=C sort -n) for env_file in $env_files ; do source $env_file done @@ -103,7 +104,7 @@ for target in $(find . -name 'start_*' -printf '%f\n') ; do start_seconds=$(cat $target) stop_seconds=$(cat $stop_file) duration=$(python -c "print($stop_seconds - $start_seconds)") - LC_ALL=C printf "%-40s %10.3f\n" ${target##start_} $duration + LC_NUMERIC=C LC_ALL=C printf "%-40s %10.3f\n" ${target##start_} $duration done popd > /dev/null rm -rf $PROFILE_DIR