瀏覽代碼

Merge pull request #3417 from ThomasWaldmann/backports2

1.0 Backports 2
TW 7 年之前
父節點
當前提交
c73c9384e3
共有 2 個文件被更改,包括 24 次插入7 次删除
  1. 6 6
      borg/archive.py
  2. 18 1
      docs/usage.rst

+ 6 - 6
borg/archive.py

@@ -490,12 +490,6 @@ Number of files: {0.stats.nfiles}'''.format(
         else:
             os.utime(path, None, ns=(atime, mtime), follow_symlinks=False)
         acl_set(path, item, self.numeric_owner)
-        # Only available on OS X and FreeBSD
-        if has_lchflags and b'bsdflags' in item:
-            try:
-                os.lchflags(path, item[b'bsdflags'])
-            except OSError:
-                pass
         # chown removes Linux capabilities, so set the extended attributes at the end, after chown, since they include
         # the Linux capabilities in the "security.capability" attribute.
         xattrs = item.get(b'xattrs', {})
@@ -518,6 +512,12 @@ Number of files: {0.stats.nfiles}'''.format(
                     set_ec(EXIT_WARNING)
                 else:
                     raise
+        # Only available on OS X and FreeBSD
+        if has_lchflags and b'bsdflags' in item:
+            try:
+                os.lchflags(path, item[b'bsdflags'])
+            except OSError:
+                pass
 
     def rename(self, name):
         if name in self.manifest.archives:

+ 18 - 1
docs/usage.rst

@@ -12,6 +12,23 @@ command in detail.
 General
 -------
 
+Positional Arguments and Options: Order matters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Borg only supports taking options (``-v`` and ``--list`` in the example)
+to the left or right of all positional arguments (``repo::archive`` and ``path``
+in the example), but not in between them:
+
+::
+
+    borg extract -v --list repo::archive path  # good and preferred
+    borg extract repo::archive path -v --list  # also works
+    borg extract -v repo::archive path --list  # works, but ugly
+    borg extract repo::archive -v --list path  # BAD
+
+This is due to a problem in the argparse module: http://bugs.python.org/issue15112
+
+
 Repository URLs
 ~~~~~~~~~~~~~~~
 
@@ -414,7 +431,7 @@ Examples
 
     # Backup the root filesystem into an archive named "root-YYYY-MM-DD"
     # use zlib compression (good, but slow) - default is no compression
-    $ borg create -C zlib,6 /path/to/repo::root-{now:%Y-%m-%d} / --one-file-system
+    $ borg create -C zlib,6 --one-file-system /path/to/repo::root-{now:%Y-%m-%d} /
 
     # Make a big effort in fine granular deduplication (big chunk management
     # overhead, needs a lot of RAM and disk space, see formula in internals