فهرست منبع

emit a deprecation warning for --compression N

deprecating it in the source is not enough, we also need to tell the users to fix their scripts.
Thomas Waldmann 10 سال پیش
والد
کامیت
e6231896cd
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      borg/helpers.py

+ 4 - 0
borg/helpers.py

@@ -405,6 +405,10 @@ def CompressionSpec(s):
             raise ValueError
             raise ValueError
         # DEPRECATED: it is just --compression N
         # DEPRECATED: it is just --compression N
         if 0 <= compression <= 9:
         if 0 <= compression <= 9:
+            print('Warning: --compression %d is deprecated, please use --compression zlib,%d.' % (compression, compression))
+            if compression == 0:
+                print('Hint: instead of --compression zlib,0 you could also use --compression none for better performance.')
+                print('Hint: archives generated using --compression none are not compatible with borg < 0.25.0.')
             return dict(name='zlib', level=compression)
             return dict(name='zlib', level=compression)
         raise ValueError
         raise ValueError
     except ValueError:
     except ValueError: