Bug#647668: FTBFS on kfreebsd-amd64
Package: ntfs-3g
Version: 2011.4.12AR.7-3
Severity: important
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd
Hi,
ntfs-3g fails to build on kfreebsd-amd64 with:
"can be built for Linux, FreeBSD, Mac OS X, NetBSD, and Solaris only"
(https://buildd.debian.org/status/fetch.php?pkg=ntfs-3g&arch=kfreebsd-amd64&ver=1%3A2011.4.12AR.7-3&stamp=1320013140)
Please find attached patch to correct this and other buildability problems.
-- System Information:
Debian Release: 6.0.3
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: kfreebsd-amd64 (x86_64)
Kernel: kFreeBSD 8.1-1-amd64
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
=== modified file 'configure'
--- configure 2011-11-04 21:29:22 +0000
+++ configure 2011-11-04 21:30:48 +0000
@@ -12659,7 +12659,7 @@ else
fi
;;
-darwin*|netbsd*|solaris*)
+darwin*|netbsd*|solaris*|kfreebsd*-gnu)
with_fuse="external"
;;
freebsd*)
=== modified file 'configure.ac'
--- configure.ac 2011-11-04 21:29:22 +0000
+++ configure.ac 2011-11-04 21:30:08 +0000
@@ -220,7 +220,7 @@ linux*)
[with_fuse="internal"]
)
;;
-darwin*|netbsd*|solaris*)
+darwin*|netbsd*|solaris*|kfreebsd*-gnu)
with_fuse="external"
;;
freebsd*)
=== modified file 'debian/control'
--- debian/control 2011-11-04 21:29:22 +0000
+++ debian/control 2011-11-04 21:42:14 +0000
@@ -11,7 +11,7 @@ Homepage: http://www.tuxera.com/communit
Package: ntfs-3g
Section: otherosfs
Architecture: linux-any kfreebsd-any
-Pre-Depends: fuse
+Pre-Depends: fuse [linux-any] | fuse4bsd [kfreebsd-any]
Depends: ${misc:Depends}, ${shlibs:Depends}
Conflicts: libntfs-3g75, ntfsprogs
Replaces: libntfs-3g75, ntfsprogs
=== modified file 'debian/rules'
--- debian/rules 2011-11-04 21:29:22 +0000
+++ debian/rules 2011-11-04 21:40:35 +0000
@@ -2,6 +2,14 @@
SHELL := sh -e
+DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+
+CONFIGURE_FLAGS := --exec-prefix=/ --enable-crypto --enable-extras --enable-xattr-mappings --disable-ldconfig --with-fuse=external
+
+ifeq ($(DEB_HOST_ARCH_OS), linux)
+CONFIGURE_FLAGS += --enable-posix-acls
+endif
+
upstream:
lynx -dump http://b.andre.pagesperso-orange.fr/changelog.html > debian/local/changelog
@@ -9,7 +17,7 @@ upstream:
dh ${@} --with autotools_dev
override_dh_auto_configure:
- dh_auto_configure -- --exec-prefix=/ --enable-crypto --enable-extras --enable-posix-acls --enable-xattr-mappings --disable-ldconfig --with-fuse=external
+ dh_auto_configure -- $(CONFIGURE_FLAGS)
override_dh_auto_install:
dh_auto_install
=== modified file 'libfuse-lite/fuse.c'
--- libfuse-lite/fuse.c 2011-11-04 21:29:22 +0000
+++ libfuse-lite/fuse.c 2011-11-04 21:30:35 +0000
@@ -2649,7 +2649,7 @@ struct fuse *fuse_new(struct fuse_chan *
if (!f->conf.ac_attr_timeout_set)
f->conf.ac_attr_timeout = f->conf.attr_timeout;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
/*
* In FreeBSD, we always use these settings as inode numbers are needed to
* make getcwd(3) work.
=== modified file 'libntfs-3g/dir.c'
--- libntfs-3g/dir.c 2011-11-04 21:29:22 +0000
+++ libntfs-3g/dir.c 2011-11-04 21:35:31 +0000
@@ -2310,7 +2310,7 @@ int ntfs_get_ntfs_dos_name(ntfs_inode *n
}
} else {
if (doslen == 0)
- errno = ENODATA;
+ errno = ENOENT;
outsize = -errno;
}
return (outsize);
@@ -2555,7 +2555,7 @@ int ntfs_set_ntfs_dos_name(ntfs_inode *n
} else {
if (flags & XATTR_REPLACE) {
res = -1;
- errno = ENODATA;
+ errno = ENOENT;
} else {
res = set_dos_name(ni, dir_ni,
shortname, shortlen,
=== modified file 'libntfs-3g/efs.c'
--- libntfs-3g/efs.c 2011-11-04 21:29:22 +0000
+++ libntfs-3g/efs.c 2011-11-04 21:35:31 +0000
@@ -112,7 +112,7 @@ int ntfs_get_efs_info(ntfs_inode *ni, ch
attr_size = 0;
}
} else {
- errno = ENODATA;
+ errno = ENOENT;
ntfs_log_trace("Inode %lld is not encrypted\n",
(long long)ni->mft_no);
}
@@ -257,7 +257,7 @@ int ntfs_set_efs_info(ntfs_inode *ni, co
logged_utility_stream_name,4,
(u8*)NULL,(s64)size);
} else {
- errno = ENODATA;
+ errno = ENOENT;
res = -1;
}
} else {
=== modified file 'libntfs-3g/object_id.c'
--- libntfs-3g/object_id.c 2011-11-04 21:29:22 +0000
+++ libntfs-3g/object_id.c 2011-11-04 21:35:31 +0000
@@ -304,7 +304,7 @@ static int remove_object_id_index(ntfs_a
}
} else {
ret = -1;
- errno = ENODATA;
+ errno = ENOENT;
}
}
return (ret);
@@ -406,7 +406,7 @@ static int add_object_id(ntfs_inode *ni,
} else
errno = EOPNOTSUPP;
} else
- errno = ENODATA;
+ errno = ENOENT;
} else {
if (flags & XATTR_CREATE)
errno = EEXIST;
@@ -503,7 +503,7 @@ int ntfs_get_ntfs_object_id(ntfs_inode *
}
free(objectid_attr);
} else
- errno = ENODATA;
+ errno = ENOENT;
}
return (full_size ? (int)full_size : -errno);
}
@@ -625,7 +625,7 @@ int ntfs_remove_ntfs_object_id(ntfs_inod
if (errno == ENOENT)
errno = olderrno;
} else {
- errno = ENODATA;
+ errno = ENOENT;
res = -1;
}
NInoSetDirty(ni);
=== modified file 'libntfs-3g/reparse.c'
--- libntfs-3g/reparse.c 2011-11-04 21:29:22 +0000
+++ libntfs-3g/reparse.c 2011-11-04 21:35:31 +0000
@@ -897,7 +897,7 @@ static int remove_reparse_index(ntfs_att
ret = -1;
} else {
ret = -1;
- errno = ENODATA;
+ errno = ENOENT;
}
}
return (ret);
@@ -1073,7 +1073,7 @@ int ntfs_get_ntfs_reparse_data(ntfs_inod
free(reparse_attr);
}
} else
- errno = ENODATA;
+ errno = ENOENT;
}
return (attr_size ? (int)attr_size : -errno);
}
@@ -1122,7 +1122,7 @@ int ntfs_set_ntfs_reparse_data(ntfs_inod
res = -1;
}
} else {
- errno = ENODATA;
+ errno = ENOENT;
res = -1;
}
} else {
@@ -1213,7 +1213,7 @@ int ntfs_remove_ntfs_reparse_data(ntfs_i
if (errno == ENOENT)
errno = olderrno;
} else {
- errno = ENODATA;
+ errno = ENOENT;
res = -1;
}
NInoSetDirty(ni);
=== modified file 'libntfs-3g/security.c'
--- libntfs-3g/security.c 2011-11-04 21:29:22 +0000
+++ libntfs-3g/security.c 2011-11-04 21:35:31 +0000
@@ -2938,7 +2938,7 @@ int ntfs_set_posix_acl(struct SECURITY_C
exist = oldpxdesc->acccnt > 3;
if ((exist && (flags & XATTR_CREATE))
|| (!exist && (flags & XATTR_REPLACE))) {
- errno = (exist ? EEXIST : ENODATA);
+ errno = (exist ? EEXIST : ENOENT);
} else {
newpxdesc = ntfs_replace_acl(oldpxdesc,
(const struct POSIX_ACL*)value,count,deflt);
@@ -4865,7 +4865,7 @@ INDEX_ENTRY *ntfs_read_sii(struct SECURI
} else
ret = ntfs_index_next(entry,xsii);
if (!ret)
- errno = ENODATA;
+ errno = ENOENT;
} else
errno = EOPNOTSUPP;
} else
@@ -4902,7 +4902,7 @@ INDEX_ENTRY *ntfs_read_sdh(struct SECURI
} else
ret = ntfs_index_next(entry,xsdh);
if (!ret)
- errno = ENODATA;
+ errno = ENOENT;
} else errno = ENOTSUP;
} else
errno = EINVAL;
@@ -4929,7 +4929,7 @@ int ntfs_get_usid(struct SECURITY_API *s
size = ntfs_sid_size(usid);
memcpy(buf,usid,size);
} else
- errno = ENODATA;
+ errno = ENOENT;
} else
errno = EINVAL;
return (size);
@@ -4955,7 +4955,7 @@ int ntfs_get_gsid(struct SECURITY_API *s
size = ntfs_sid_size(gsid);
memcpy(buf,gsid,size);
} else
- errno = ENODATA;
+ errno = ENOENT;
} else
errno = EINVAL;
return (size);
@@ -4979,7 +4979,7 @@ int ntfs_get_user(struct SECURITY_API *s
uid = ntfs_find_user(scapi->security.mapping[MAPUSERS], usid);
if (!uid) {
uid = -1;
- errno = ENODATA;
+ errno = ENOENT;
}
}
} else
@@ -5005,7 +5005,7 @@ int ntfs_get_group(struct SECURITY_API *
gid = ntfs_find_group(scapi->security.mapping[MAPGROUPS], gsid);
if (!gid) {
gid = -1;
- errno = ENODATA;
+ errno = ENOENT;
}
}
} else
=== modified file 'src/lowntfs-3g.c'
--- src/lowntfs-3g.c 2011-11-04 21:29:22 +0000
+++ src/lowntfs-3g.c 2011-11-04 21:35:32 +0000
@@ -3079,7 +3079,7 @@ static void ntfs_fuse_getxattr(fuse_req_
}
na = ntfs_attr_open(ni, AT_DATA, lename, lename_len);
if (!na) {
- res = -ENODATA;
+ res = -ENOENT;
goto exit;
}
rsize = na->data_size;
@@ -3270,7 +3270,7 @@ static void ntfs_fuse_setxattr(fuse_req_
}
if (!na) {
if (flags == XATTR_REPLACE) {
- res = -ENODATA;
+ res = -ENOENT;
goto exit;
}
if (ntfs_attr_add(ni, AT_DATA, lename, lename_len, NULL, 0)) {
@@ -3485,7 +3485,7 @@ static void ntfs_fuse_removexattr(fuse_r
}
if (ntfs_attr_remove(ni, AT_DATA, lename, lename_len)) {
if (errno == ENOENT)
- errno = ENODATA;
+ errno = ENOENT;
res = -errno;
}
if (!(ni->flags & FILE_ATTR_ARCHIVE)) {
=== modified file 'src/ntfs-3g.c'
--- src/ntfs-3g.c 2011-11-04 21:29:22 +0000
+++ src/ntfs-3g.c 2011-11-04 21:35:32 +0000
@@ -2810,7 +2810,7 @@ static int ntfs_fuse_getxattr(const char
}
na = ntfs_attr_open(ni, AT_DATA, lename, lename_len);
if (!na) {
- res = -ENODATA;
+ res = -ENOENT;
goto exit;
}
rsize = na->data_size;
@@ -2980,7 +2980,7 @@ static int ntfs_fuse_setxattr(const char
}
if (!na) {
if (flags == XATTR_REPLACE) {
- res = -ENODATA;
+ res = -ENOENT;
goto exit;
}
if (ntfs_attr_add(ni, AT_DATA, lename, lename_len, NULL, 0)) {
@@ -3187,7 +3187,7 @@ static int ntfs_fuse_removexattr(const c
}
if (ntfs_attr_remove(ni, AT_DATA, lename, lename_len)) {
if (errno == ENOENT)
- errno = ENODATA;
+ errno = ENOENT;
res = -errno;
}
if (!(ni->flags & FILE_ATTR_ARCHIVE)) {
Reply to: