From f1b3b2d2f6e3e1dd7ccf97b200a605e62f08b9cf Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 25 Jun 2008 06:46:17 +0000 Subject: lbu log is renamed to lbu list-backup|lb. fix bugs in lbu list-backup and lbu revert --- lbu | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lbu b/lbu index 2cb2d81..2e37086 100644 --- a/lbu +++ b/lbu @@ -9,7 +9,7 @@ PREFIX= # this one is from apk-tools . $PREFIX/lib/apk/libutil.sh -VERSION=1.1 +VERSION=1.2 [ "$SFIC" ] && SFIC="$SFIC -i d" # globals @@ -47,7 +47,7 @@ Available subcommands: package (pkg) status (stat, st) update (up) - log + list-backup (lb) revert Common options: @@ -73,7 +73,7 @@ exit_clean() { } mount_once() { - if grep $1 /proc/mounts >/dev/null; then + if ! grep $1 /proc/mounts >/dev/null; then mount $1 && UMOUNT_LIST="$1 $UMOUNT_LIST" fi } @@ -453,18 +453,18 @@ show_exclude() { #--------------------------------------------------------------------------- # lbu_status - check what files have been changed since last save -usage_log() +usage_listbackup() { cat <] +usage: $PROGRAM list-backup [] EOF exit 1 } -cmd_log() { +cmd_listbackup() { local media=${1:-"$LBU_MEDIA"} local mnt="/media/$media" [ -z "$media" ] && usage_log @@ -495,13 +495,13 @@ cmd_revert() { local current="$mnt/$(hostname).apkovl.tar.gz" if [ -n "$ENCRYPTION" ]; then - outfile="$outfile.$ENCRYPTION" + current="$current.$ENCRYPTION" fi mount_once "$mnt" || die "failed to mount $mnt" [ -f "$revertto" ] || die "file not found: $revertto" - backup_apkovl "$outfile" + backup_apkovl "$current" vecho "Reverting to $1" - [ -z "$DRYRUN" ] && mv "$revertto" "$outfile" + [ -z "$DRYRUN" ] && mv "$revertto" "$current" } #--------------------------------------------------------------------------- @@ -593,7 +593,7 @@ case "$cmd" in package|pkg) SUBCMD="package";; status|stat|st) SUBCMD="status";; update|up) SUBCMD="update";; - log) SUBCMD="log";; + list-backup|lb) SUBCMD="listbackup";; revert) SUBCMD="revert";; *) usage;; esac -- cgit v1.2.3