quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH 37/39] backup-files: Drop support for backup removal


From: Jean Delvare
Subject: [Quilt-dev] [PATCH 37/39] backup-files: Drop support for backup removal
Date: Sat, 19 Mar 2011 10:53:07 +0100
User-agent: quilt/0.48-17.1

Drop support for backup removal (option -x). Quilt doesn't use it.

Signed-off-by: Jean Delvare <address@hidden>
Reviewed-by: Raphael Hertzog <address@hidden>
---
 quilt/scripts/backup-files.in |   16 +---------------
 test/backup-files.test        |    4 ++--
 2 files changed, 3 insertions(+), 17 deletions(-)

--- a/quilt/scripts/backup-files.in
+++ b/quilt/scripts/backup-files.in
@@ -21,7 +21,7 @@ set -e
 # MA 02110-1301, USA.
 
 usage () {
-       echo "Usage: $0 -B prefix {-b|-r|-c|-x|-L} [-s] [-k] [-t] [-L] {-f 
{file|-}|-|file ...}
+       echo "Usage: $0 -B prefix {-b|-r|-c|-L} [-s] [-k] [-t] [-L] {-f 
{file|-}|-|file ...}
 
        Create or restore backup copies of a list of files.
 
@@ -32,7 +32,6 @@ usage () {
        -b      Create backup (preserve links)
        -r      Restore the backup
        -c      Create simple copy
-       -x      Remove backup files and empty parent directories
        -L      Ensure that source files have a link count of 1
 
        Common options:
@@ -186,17 +185,6 @@ restore_all()
        fi
 }
 
-remove()
-{
-       local file=$1
-       local backup=$OPT_PREFIX$file
-
-       if [ -e "$backup" ]; then
-               rm "$backup"
-       fi
-       rmdir -p "${backup%/*}" 2> /dev/null || true
-}
-
 noop_nolinks()
 {
        local file=$1
@@ -283,8 +271,6 @@ while [ $# -gt 0 ]; do
                ;;
        -c)     OPT_WHAT=copy
                ;;
-       -x)     OPT_WHAT=remove
-               ;;
        -B)     OPT_PREFIX=$2
                shift
                ;;
--- a/test/backup-files.test
+++ b/test/backup-files.test
@@ -13,8 +13,8 @@ Unit test of the backup-files script.
        > 2
        $ [ backup/foo -nt foo ] && echo "mtimes differ"
 
-       # Test remove
-       $ %{QUILT_DIR}/scripts/backup-files -B backup/ -x foo
+       $ %{QUILT_DIR}/scripts/backup-files -B backup/ -r foo
+       > Restoring foo
        $ ls -l foo | awk '{ print $2 }'
        > 1
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]