]> wimlib.net Git - wimlib/commitdiff
libattr is no longer needed
authorEric Biggers <ebiggers3@gmail.com>
Wed, 27 Jul 2016 00:10:05 +0000 (17:10 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 27 Jul 2016 16:22:13 +0000 (09:22 -0700)
wimlib only uses the extended attributes interface on Linux, where it
appears it is now safe to assume the functions are present in libc (see:
http://lists.nongnu.org/archive/html/acl-devel/2012-04/msg00001.html).

Note: the setfattr program from the "attr" package is still required to
run the NTFS-3G test script.

README
archlinux/PKGBUILD
configure.ac
debian/control
rpm/wimtools.spec
src/mount_image.c
tests/tree-cmp.c

diff --git a/README b/README
index 3dc2aedeefd57ec8d73199af234d027b3d1b5244..cc036571fca55b35aa54a4039d6897bb20da8f48 100644 (file)
--- a/README
+++ b/README
@@ -146,12 +146,6 @@ dependencies were already included and this section is irrelevant.
        automatically be loaded if you try to mount a WIM image.  For more
        information see http://fuse.sourceforge.net/.
 
-* libattr (optional but recommended)
-       Unless configured --without-fuse, wimlib also requires libattr.  Almost
-       all Linux distributions should include this; however, you may need to
-       install the header files, which might be in a package named "attr-dev",
-       "libattr1-dev", or similar.
-
 * libntfs-3g (optional but recommended)
        Unless configured --without-ntfs-3g, wimlib requires the library and
        headers for libntfs-3g to be installed.  The minimum required version is
@@ -190,7 +184,7 @@ This section documents the most important options that may be passed to the
 
 --without-fuse
        The --without-fuse option disables support for mounting WIM images.
-       This removes dependencies on libfuse, librt, and libattr.  The wimmount,
+       This removes dependencies on libfuse and librt.  The wimmount,
        wimmountrw, and wimunmount commands will not work.
 
        The default is --with-fuse when building for Linux, and --without-fuse
index 5a0d1bd4d4db37398653e19a7758e7c4d74b3171..11d860873dc30585f7b95c951c54f3225f743691 100644 (file)
@@ -7,7 +7,8 @@ pkgdesc="A library and program to extract, create, and modify WIM files"
 arch=("i686" "x86_64")
 url="https://wimlib.net"
 license=("custom")
-depends=("openssl" "fuse" "libxml2" "ntfs-3g" "attr")
+depends=("openssl" "fuse" "libxml2" "ntfs-3g")
+checkdepends=("attr")
 optdepends=("cdrkit: for making ISO image of Windows PE"
        "mtools: for making disk image of Windows PE"
        "syslinux: for making disk image of Windows PE"
index dc569f7bb104b1d55f75511a29e06a2aeaca861a..74ff4744d08db2ec3367000bd01d185038bd1f1b 100644 (file)
@@ -64,7 +64,6 @@ AC_CHECK_FUNCS([futimens utimensat flock mempcpy      \
 # Header checks, most of which are only here to satisfy conditional includes
 # made by the libntfs-3g headers.
 AC_CHECK_HEADERS([alloca.h             \
-                 attr/xattr.h          \
                  byteswap.h            \
                  endian.h              \
                  errno.h               \
@@ -78,6 +77,7 @@ AC_CHECK_HEADERS([alloca.h            \
                  sys/file.h            \
                  sys/sysctl.h          \
                  sys/times.h           \
+                 sys/xattr.h           \
                  time.h                \
                  utime.h])
 
@@ -159,12 +159,6 @@ if test "$WITH_FUSE" = "yes"; then
        versions of glibc include this library.  Either install this library, or
        configure --without-fuse to disable support for mounting WIM images.])])
 
-       AC_CHECK_LIB([attr], [getxattr], [],
-                    [AC_MSG_ERROR([Cannot find libattr!
-       wimlib needs this for the extended attribute functions, which are used
-       in the code for mounting WIM images.  Either install this library, or
-       configure --without-fuse to disable support for mounting WIM images.])])
-
        PKGCONFIG_PRIVATE_LIBS="$PKGCONFIG_PRIVATE_LIBS -lrt"
        AC_SUBST([LIBRT_LIBS], [-lrt])
 fi
index f424296a28c94941b944782d7a4ce90950b18efc..e8c627e45e9c744f496153b3afad73ab53a14073 100644 (file)
@@ -3,7 +3,7 @@ Priority: optional
 Maintainer: Eric Biggers <ebiggers3@gmail.com>
 Build-Depends: debhelper (>= 8.9.7), autotools-dev, pkg-config,
                libfuse-dev, libxml2-dev, libssl-dev,
-               ntfs-3g-dev (>= 2011.4.12), attr-dev, attr
+               ntfs-3g-dev (>= 2011.4.12), attr
 Build-Depends-Indep: doxygen
 Standards-Version: 3.9.3
 Section: libs
index c2d7af7fe81fafa5c35287a6a2ac30ac327cae39..fe437c2039d16588acaeb8475f0504797b9f030c 100644 (file)
@@ -39,7 +39,7 @@ Development files for wimlib
 Summary:  Library to extract, create, modify, and mount WIM files
 Group:  System Environment/Libraries
 Requires:  fuse
-BuildRequires: libxml2-devel, fuse, fuse-devel, openssl-devel, libattr-devel
+BuildRequires: libxml2-devel, fuse, fuse-devel, openssl-devel, attr
 BuildRequires: ntfs-3g-devel, ntfsprogs, libtool, pkgconfig
 %description -n libwim15
 wimlib is a C library for extracting, creating, modifying, and mounting WIM
index 6f0c6e1cd1486ed46152c862ba3f3fed851bde39..3641b204c3aec966d938b57d86517f181c5d9589 100644 (file)
@@ -39,9 +39,8 @@
 
 #define FUSE_USE_VERSION 26
 
-#include <sys/types.h> /* sometimes required before <attr/xattr.h> */
-
-#include <attr/xattr.h>
+#include <sys/types.h> /* sometimes required before <sys/xattr.h> */
+#include <sys/xattr.h>
 #include <dirent.h>
 #include <errno.h>
 #include <fuse.h>
 #  define O_NOFOLLOW 0  /* Security only...  */
 #endif
 
+#ifndef ENOATTR
+#  define ENOATTR ENODATA
+#endif
+
 #define WIMFS_MQUEUE_NAME_LEN 32
 
 #define WIMLIB_UNMOUNT_FLAG_SEND_PROGRESS 0x80000000
index b6051ccb90f5df99b7a8154dea636e281e74d6ab..1fed0234cccbd07044364ec07cadea53e25117ba 100644 (file)
 #include <unistd.h>
 #include <stdbool.h>
 #include <sys/stat.h>
-#ifdef HAVE_ATTR_XATTR_H
-#include <attr/xattr.h>
+#include <sys/types.h>
+#ifdef HAVE_SYS_XATTR_H
+#  include <sys/xattr.h>
 #endif
 #include <assert.h>
 
+#ifndef ENOATTR
+#  define ENOATTR ENODATA
+#endif
+
 typedef uint64_t u64;
 
 #if 0
@@ -165,7 +170,7 @@ static void cmp(const char *file1, const char *file2, size_t size)
        close(fd2);
 }
 
-#ifdef HAVE_ATTR_XATTR_H
+#ifdef HAVE_SYS_XATTR_H
 /* Compares an extended attribute of the files. */
 static void cmp_xattr(const char *file1, const char *file2,
                      const char *xattr_name, ssize_t max_size,
@@ -270,13 +275,13 @@ static void cmp_ads(const char *file1, const char *file2)
                free(list2);
        }
 }
-#endif
+#endif /* HAVE_SYS_XATTR_H */
 
 /* Compares special NTFS data of the files, as accessed through extended
  * attributes. */
 static void special_cmp(const char *file1, const char *file2)
 {
-#ifdef HAVE_ATTR_XATTR_H
+#ifdef HAVE_SYS_XATTR_H
        cmp_xattr(file1, file2, "system.ntfs_acl", 0, false);
        cmp_xattr(file1, file2, "system.ntfs_attrib", 0, false);
        cmp_xattr(file1, file2, "system.ntfs_dos_name", 0, true);
@@ -287,7 +292,7 @@ static void special_cmp(const char *file1, const char *file2)
 #else
        fprintf(stderr, "tree-cmp: Warning: cannot compare xattrs of `%s' and `%s'\n",
                        file1, file2);
-       fprintf(stderr, "          You need to install the attr development files for this.\n");
+       fprintf(stderr, "          Extended attributes are not supported on this platform.\n");
 #endif
 }