]> arthur.barton.de Git - bup.git/commitdiff
save: detect missing metastore via ENOENT not EACCES
authorRob Browning <rlb@defaultvalue.org>
Fri, 8 Oct 2021 17:39:16 +0000 (12:39 -0500)
committerRob Browning <rlb@defaultvalue.org>
Mon, 22 Nov 2021 16:35:28 +0000 (10:35 -0600)
While we might also eventually want to handle EACCES, ENOENT should be
what we want for the current handler, i.e. "does it exist at all".

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/cmd/save.py

index 4deef5d31f55f1b0916f67a5c8f4c4d4b29d4432..88f74d77b9216bac94acdca2bc3a4360c97b6969 100755 (executable)
@@ -1,7 +1,7 @@
 
 from __future__ import absolute_import, print_function
 from binascii import hexlify
-from errno import EACCES
+from errno import ENOENT
 from io import BytesIO
 import math, os, stat, sys, time
 
@@ -513,7 +513,7 @@ def main(argv):
             try:
                 msr = index.MetaStoreReader(indexfile + b'.meta')
             except IOError as ex:
-                if ex.errno != EACCES:
+                if ex.errno != ENOENT:
                     raise
                 log('error: cannot access %r; have you run bup index?'
                     % path_msg(indexfile))