[PATCH 1/1] Remove vestigial check_linux_file_attr_api and struct

0 views
Skip to first unread message

Rob Browning

unread,
Jun 17, 2026, 2:13:34 PM (8 days ago) Jun 17
to bup-...@googlegroups.com
Overlooked when restoring big-endian linux attr support in

20a5752021769c3fab183f2646662bdf1b6083fc
Reallow linux attrs on big endian hosts where long > int

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---

Pushed to main.

lib/bup/metadata.py | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/lib/bup/metadata.py b/lib/bup/metadata.py
index 85a07725..a2ee8082 100644
--- a/lib/bup/metadata.py
+++ b/lib/bup/metadata.py
@@ -1,6 +1,6 @@
"""Metadata read/write support for bup."""

-# Copyright (C) 2010 Rob Browning
+# Copyright (C) 2010-2026 Rob Browning
#
# This code is covered under the terms of the GNU Library General
# Public License as described in the bup LICENSE file.
@@ -10,7 +10,7 @@ from errno import EACCES, EINVAL, ENOTTY, ENOSYS, EOPNOTSUPP
from io import BytesIO
from os import environb as environ
from time import gmtime, strftime
-import copy, errno, os, sys, stat, socket, struct
+import copy, errno, os, sys, stat, socket

from bup import vint, xstat
from bup.drecurse import recursive_dirlist
@@ -60,12 +60,6 @@ except ImportError:
get_linux_file_attr = set_linux_file_attr = None


-def check_linux_file_attr_api():
- global get_linux_file_attr, set_linux_file_attr
- if not (get_linux_file_attr or set_linux_file_attr):
- return
-
-
# WARNING: the metadata encoding is *not* stable yet. Caveat emptor!

# Q: Consider hardlink support?
@@ -630,7 +624,6 @@ class Metadata:
## Linux attributes (lsattr(1), chattr(1))

def _add_linux_attr(self, path, st):
- check_linux_file_attr_api()
if not get_linux_file_attr: return
if stat.S_ISREG(st.st_mode) or stat.S_ISDIR(st.st_mode):
try:
@@ -674,7 +667,6 @@ class Metadata:
# pylint: disable-next=unused-argument
restore_numeric_ids=False):
if self.linux_attr:
- check_linux_file_attr_api()
if not set_linux_file_attr:
note_error("error: can't restore linuxattrs (no support): %s\n"
% path_msg(path))
--
2.47.3

Reply all
Reply to author
Forward
0 new messages