]> Dogcows Code - chaz/tar/blobdiff - scripts/restore.in
Update copyright years.
[chaz/tar] / scripts / restore.in
index 88ab1fa9675530f415cbbfb72c25de84269f3630..f4e80e8da8a8963584d806e628cf61d5602bab3c 100644 (file)
@@ -1,21 +1,22 @@
 #! /bin/sh
-# This program is part of GNU tar
-# Copyright 2004, Free Software Foundation
-#
-# This program is free software; you can redistribute it and/or modify
+# Restore backups.
+
+# Copyright 2004, 2006, 2013-2014 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 1, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-#
+
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Load library routines
 SYSCONFDIR=${SYSCONFDIR-@sysconfdir@}
@@ -31,9 +32,8 @@ Options are:
                            (default $DUMP_LEVEL).
    -v, --verbose[=LEVEL]   Set verbosity level. Default 100.
 
-Informational options:   
+Informational options:
    -h, --help              Display this help message.
-   -L, --license           Display program license.
    -V, --version           Display program version.
 
 Send bug reports to @PACKAGE_BUGREPORT@.
@@ -61,8 +61,9 @@ do
   --l=*|--le=*|--lev=*|--leve=*|--level=*)
          DUMP_LEVEL=$optarg
         ;;
+  -l?*)  DUMP_LEVEL=`expr $option : '-l\(.*\)'`;;
   -l|--l|--le|--lev|--leve|--level)
-         prev=$option
+        prev=--level
         ;;
   --verb=*|--verbo=*|--verbos=*|--verbose=*)
          VERBOSE=$optarg
@@ -70,32 +71,30 @@ do
   -v|--verb|--verbo|--verbos|--verbose)
          VERBOSE=100
         ;;
-  -v*)   VERBOSE=`expr $option : "-v\(.*\)"`;;
+  -v*)   VERBOSE=`expr $option : '-v\(.*\)'`;;
   -V|--v|--ve|--ver|--vers|--versi|--versio|--version)
-        echo "restore (@PACKAGE@ @VERSION@)"
-        exit 0;;
-  -L|--li|--lic|--lice|--licen|--licens|--license)
-        license
-        exit;;
+        echo "restore (@PACKAGE_NAME@) @VERSION@"
+        license
+        exit;;
   -h|--h|--he|--hel|--help)
         usage
         exit;;
   -*) bailout "Unknown option $opt. Try $PROGNAME --help for more info.";;
   *)  if [ -z "$PATTERN" ]; then
          PATTERN=$opt
-      else  
+      else
          PATTERN="$PATTERN|$opt"
       fi
       ;;
-  esac 
-done    
+  esac
+done
 
 if [ -z "$RESTORE_ALL" ]; then
        if [ -z "$PATTERN" ]; then
                usage
                exit;
        fi
-fi     
+fi
 
 init_restore
 cat > $LOGFILE <<EOF
@@ -105,12 +104,13 @@ It was created by GNU $PROGNAME, from  @PACKAGE@ (@VERSION@).
 Invocation command line was
 
   \$ $CMDLINE
-  
+
 EOF
 
 restore_fs()
 {
     fs="`echo \"${1}\" | sed -e 's/^.*://'`"
+    fs=`root_fs $fs`
     fsname="`echo \"${1}\" | sed -e 's/\//:/g'`"
     remotehost="`expr \"${1}\" : '\([^/][^/]*\):.*'`"
     if [ -z "$remotehost" ]; then
@@ -140,14 +140,14 @@ restore_fs()
       DATE=`get_dump_time $level`
       FILE="`level_log_name ${fsname} ${level}`"
       message 10 "FILE=$FILE"
-      
+
       LABEL="`print_level $level` backup of ${fs} on ${remotehost} at ${DATE}"
       ${RESTORE_BEGIN-:} $level $remotehost $fs $fsname
       backup_host ${remotehost} \
                   "--listed=\"$FILE\"" \
                   "--label=\"$LABEL\"" \
-                 -C ${ROOT_FS-/}$fs
-      ${RESTORE_END-:} $level $remotehost $fs $fsname            
+                 -C $fs
+      ${RESTORE_END-:} $level $remotehost $fs $fsname
     done
 }
 
@@ -168,11 +168,11 @@ restore_files()
          continue;
       fi
       message 10 "Restoring level $level"
-      
+
       DATE=`get_dump_time $level`
       FILE="`level_log_name MISC ${level}`"
       message 10 "FILE=$FILE"
-      
+
       LABEL="`print_level $level` backup of miscellaneous files at ${DATE}"
       ${RESTORE_BEGIN-:} $level $localhost MISC MISC
       backup_host ${localhost} \
@@ -225,12 +225,7 @@ if [ "x${BACKUP_FILES}" != "x" ] ; then
        done
        [ -z "$RESTORE_FILES" ] || restore_files $RESTORE_FILES
     fi
-       
-fi) 2>&1 | tee -a "${LOGFILE}"
 
-# EOF    
+fi) 2>&1 | tee -a "${LOGFILE}"
 
-    
-    
-          
-       
\ No newline at end of file
+# EOF
This page took 0.029722 seconds and 4 git commands to generate.