Skip to content
Browse files

fix bug with rolling back when number of bins to rollback equals the …

…number of bins available. leaves an unresolved issue of dating the rollback when you roll all the way back to the seed
  • Loading branch information...
1 parent bee7a08 commit 47295fca28b2ea453af3b216c65bb1a288b54d35 @falconindy committed Jun 11, 2010
Showing with 12 additions and 4 deletions.
  1. +12 −4 squashfu
View
16 squashfu
@@ -273,9 +273,12 @@ action_rollback () {
mountpoint -q "$UNION_MOUNT" && unmount_union
mountpoint -q "$SQUASH_MOUNT" || mount_squash
- mount_union_with_bins ${bin_list[@]:(-$num_to_mount)}
-
- local rb_timestamp=$(grep "^${bin_list[@]:(-$num_to_mount):1}:" "$BINVENTORY" | cut -d: -f2)
+ 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)}
+ local rb_timestamp=$(grep "^${bin_list[@]:(-$num_to_mount):1}:" "$BINVENTORY" | cut -d: -f2)
+ fi
info "You have rolled back to $(date --rfc-3339=seconds --date="@$rb_timestamp")"
info "Your files can be found at '${UNION_MOUNT}'"
@@ -430,13 +433,16 @@ OPTIONS
the default config. If you specify alternate locations via a supplmenetal config,
you will need to provide the config for all actions
+ -v
+ Show debugging output.
+
HELP
exit 1
}
[[ $# -eq 0 ]] && usage
-while getopts :BG:CD:QR:Uc: opt; do
+while getopts :BG:CD:QR:Uc:v opt; do
case $opt in
B)
[[ -n $action ]] && die "only one operation may be used at a time"
@@ -461,6 +467,8 @@ while getopts :BG:CD:QR:Uc: opt; do
action=unmount ;;
c)
[[ -f $OPTARG ]] && source $OPTARG ;;
+ v)
+ DEBUG=true ;;
\:)
die "Argument missing from -$OPTARG"
usage ;;

0 comments on commit 47295fc

Please sign in to comment.
Something went wrong with that request. Please try again.