You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/06/17 17:57:52 UTC

svn commit: r955650 - /subversion/trunk/tools/backup/hot-backup.py.in

Author: danielsh
Date: Thu Jun 17 15:57:51 2010
New Revision: 955650

URL: http://svn.apache.org/viewvc?rev=955650&view=rev
Log:
Add support to hot-backup.py for >2GB zip files.

* tools/backup/hot-backup.py.in
  (archive_map, usage):  Add 'zip64' archive type.
  (step4):  Maybe pass "allowZip64 = True" to the ZipFile().

Patch by: Donald Gordon <do...@xero.com>

Modified:
    subversion/trunk/tools/backup/hot-backup.py.in

Modified: subversion/trunk/tools/backup/hot-backup.py.in
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/backup/hot-backup.py.in?rev=955650&r1=955649&r2=955650&view=diff
==============================================================================
--- subversion/trunk/tools/backup/hot-backup.py.in (original)
+++ subversion/trunk/tools/backup/hot-backup.py.in Thu Jun 17 15:57:51 2010
@@ -53,7 +53,8 @@ num_backups = int(os.environ.get("SVN_HO
 archive_map = {
   'gz'  : ".tar.gz",
   'bz2' : ".tar.bz2",
-  'zip' : ".zip"
+  'zip' : ".zip",
+  'zip64' : ".zip"
   }
 
 # Chmod recursively on a whole subtree
@@ -100,9 +101,10 @@ the BACKUP_PATH location, named after th
 
 Options:
   --archive-type=FMT Create an archive of the backup. FMT can be one of:
-                       bz2 : Creates a bzip2 compressed tar file.
-                       gz  : Creates a gzip compressed tar file.
-                       zip : Creates a compressed zip file.
+                       bz2  : Creates a bzip2 compressed tar file.
+                       gz   : Creates a gzip compressed tar file.
+                       zip  : Creates a compressed zip file.
+                       zip64: Creates a zip64 file (can be > 2GB).
   --num-backups=N    Number of prior backups to keep around (0 to keep all).
   --help      -h     Print this help message and exit.
 
@@ -284,7 +286,7 @@ if archive_type:
       err_msg = "Tar failed: " + str(e)
       err_code = -3
 
-  elif archive_type == 'zip':
+  elif archive_type == 'zip' or archive_type == 'zip64':
     try:
       import zipfile
       
@@ -299,7 +301,7 @@ if archive_type:
             for dirpath, dirs, files in os.walk(path):
               add_to_zip(zp, path, dirpath, dirs + files)
             
-      zp = zipfile.ZipFile(archive_path, 'w', zipfile.ZIP_DEFLATED)
+      zp = zipfile.ZipFile(archive_path, 'w', zipfile.ZIP_DEFLATED, archive_type == 'zip64')
       for dirpath, dirs, files in os.walk(backup_subdir):
         add_to_zip(zp, backup_dir, dirpath, dirs + files)
       zp.close()