aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-08-27 22:44:00 -0400
committerDave Reisner <d@falconindy.com>2010-08-27 22:44:00 -0400
commit8248834aa0e56499073b8883c1b909d699c5e69e (patch)
treedf7f59430461eeb9a76fa5489e4e4c2d3138b346
parentdb51747c91123e693e5a87e9e8d72c8da481aab2 (diff)
downloadsquashfu-8248834aa0e56499073b8883c1b909d699c5e69e.tar.gz
fix mounting order when rolling back
-rwxr-xr-xsquashfu3
1 files changed, 2 insertions, 1 deletions
diff --git a/squashfu b/squashfu
index f6880d2..20b2951 100755
--- a/squashfu
+++ b/squashfu
@@ -276,7 +276,8 @@ action_rollback () {
if [[ ${#bin_list[@]} -eq $1 ]]; then
local rb_timestamp=0 # XXX: What the hell is the timestamp of the seed... ?
else
- mount_union_with_bins ${bin_list[@]:(-$num_to_mount)}
+ # voodoo magic: reverse bin_list and print off the top (#bin_list - $1) bins
+ mount_union_with_bins $(for (( i = ${#bin_list[@]} - $1 - 1; i >= 0; i-- )); do echo ${bin_list[i]}; done)
local rb_timestamp=$(grep "^${bin_list[@]:(-$num_to_mount):1}:" "$BINVENTORY" | cut -d: -f2)
fi