aboutsummaryrefslogtreecommitdiffstats
path: root/squashfu
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-01-23 16:14:11 -0500
committerDave Reisner <d@falconindy.com>2010-01-23 16:14:11 -0500
commit02518588324adbb08761d92192651b6a3cf1d432 (patch)
treee294cee5a332d5861ccf38a891f2741a88fefe34 /squashfu
parentf70d369ed1623d4cbfc6e1dc6ef7c6f420d86ee3 (diff)
downloadsquashfu-02518588324adbb08761d92192651b6a3cf1d432.tar.gz
Fix ugly sorting error in report
Diffstat (limited to 'squashfu')
-rwxr-xr-xsquashfu5
1 files changed, 3 insertions, 2 deletions
diff --git a/squashfu b/squashfu
index 6f0653f..05274ec 100755
--- a/squashfu
+++ b/squashfu
@@ -289,7 +289,7 @@ action_remove_bin () {
if [[ $(grep -E "^$1:" ${BINVENTORY}) && -d "${BINS_DIR}/$1" ]]; then
if [[ -z $2 ]]; then
echo "Are you SURE you want to remove this bin?"
- local timestamp=$(sed -n "/$1/s/^[0-9]*://" "${BINVENTORY}")
+ local timestamp=$(sed -n "/^$1/s/^[0-9]*://" "${BINVENTORY}")
printf "\t%15s %s\n\t%15s %s\n\t%15s %s\n" \
"Bin:" "$1" \
"Date Created:" "$(date --rfc-3339=seconds --date="1970-01-01 $timestamp sec GMT")" \
@@ -352,11 +352,12 @@ action_report () {
echo
# Enumerate bins, sort date order, print human readable create date and size
+ cd "$BINS_DIR"
OLDIFS=$IFS;IFS=${IFS}:
# Collect all data into an array to 'preload' it. Index 0 is the entire
# folder. The following indicies correspond to the bin number of that index
printf "%30s\r" " .: Loading :." >&2
- DATA=($(du -sh ${BINS_DIR} ${BINS_DIR}/* 2>/dev/null | awk '{print $1}'))
+ DATA=($(du -sh . * 2>/dev/null | sort -n -k2 | awk '{print $1}'))
printf "%30s\r" " " >&2
printf "%10s\t%25s\t%7s\n" "Bin ID" "Date Created" "Size"