Source: attr
Version: 1:2.4.47-2
Tags: patch
diff -Nru attr-2.4.47/debian/changelog attr-2.4.47/debian/changelog
--- attr-2.4.47/debian/changelog	2014-09-08 07:27:25.000000000 +0000
+++ attr-2.4.47/debian/changelog	2015-04-25 18:31:11.000000000 +0000
@@ -1,3 +1,12 @@
+attr (1:2.4.47-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport upstream patch to support musl libc
+    http://git.savannah.gnu.org/cgit/attr.git/commit/?id=7921157890d07858d092f4003ca4c6bae9fd2c38
+  * xattr.h is not completely removed because some packages depend on it (acl)
+
+ --  Szabolcs Nagy <n...@port70.net>  Sat, 18 Apr 2015 10:36:23 +0000
+
 attr (1:2.4.47-2) unstable; urgency=medium
 
   * Standards-Version: 3.9.5.
diff -Nru attr-2.4.47/debian/patches/20-remove-attr-xattr.patch attr-2.4.47/debian/patches/20-remove-attr-xattr.patch
--- attr-2.4.47/debian/patches/20-remove-attr-xattr.patch	1970-01-01 00:00:00.000000000 +0000
+++ attr-2.4.47/debian/patches/20-remove-attr-xattr.patch	2015-04-25 18:32:35.000000000 +0000
@@ -0,0 +1,320 @@
+Description: Backport upstream patch for musl support
+ Drop attr/xattr.h and use sys/xattr.h from libc instead.
+Author: Szabolcs Nagy <n...@port70.net>
+Origin: upstream, http://git.savannah.gnu.org/cgit/attr.git/commit/?id=7921157890d07858d092f4003ca4c6bae9fd2c38
+Last-Update: 2015-04-18
+
+Index: attr-2.4.47/getfattr/getfattr.c
+===================================================================
+--- attr-2.4.47.orig/getfattr/getfattr.c
++++ attr-2.4.47/getfattr/getfattr.c
+@@ -29,7 +29,7 @@
+ #include <locale.h>
+ #include <libgen.h>
+ 
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #include "config.h"
+ #include "walk_tree.h"
+ #include "misc.h"
+Index: attr-2.4.47/include/attributes.h
+===================================================================
+--- attr-2.4.47.orig/include/attributes.h
++++ attr-2.4.47/include/attributes.h
+@@ -21,6 +21,10 @@
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
++#include <errno.h>
++#ifndef ENOATTR
++# define ENOATTR ENODATA
++#endif
+ 
+ /*
+  *	An almost-IRIX-compatible extended attributes API
+Index: attr-2.4.47/include/xattr.h
+===================================================================
+--- attr-2.4.47.orig/include/xattr.h
++++ attr-2.4.47/include/xattr.h
+@@ -1,63 +1,5 @@
+-/*
+- * Copyright (c) 2001-2002 Silicon Graphics, Inc.
+- * All Rights Reserved.
+- *
+- * This program is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU Lesser General Public License as published by
+- * the Free Software Foundation; either version 2.1 of the License, or (at
+- * your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+- * License for more details.
+- *
+- * You should have received a copy of the GNU Lesser General Public
+- * License along with this program.  If not, see
+- * <http://www.gnu.org/licenses/>.
+- *
+- */
+-#ifndef __XATTR_H__
+-#define __XATTR_H__
+-
+-#include <features.h>
+-
++#include <sys/xattr.h>
+ #include <errno.h>
+ #ifndef ENOATTR
+-# define ENOATTR ENODATA        /* No such attribute */
++# define ENOATTR ENODATA
+ #endif
+-
+-#define XATTR_CREATE  0x1       /* set value, fail if attr already exists */
+-#define XATTR_REPLACE 0x2       /* set value, fail if attr does not exist */
+-
+-
+-__BEGIN_DECLS
+-
+-extern int setxattr (const char *__path, const char *__name,
+-		      const void *__value, size_t __size, int __flags) __THROW;
+-extern int lsetxattr (const char *__path, const char *__name,
+-		      const void *__value, size_t __size, int __flags) __THROW;
+-extern int fsetxattr (int __filedes, const char *__name,
+-		      const void *__value, size_t __size, int __flags) __THROW;
+-
+-extern ssize_t getxattr (const char *__path, const char *__name,
+-				void *__value, size_t __size) __THROW;
+-extern ssize_t lgetxattr (const char *__path, const char *__name,
+-				void *__value, size_t __size) __THROW;
+-extern ssize_t fgetxattr (int __filedes, const char *__name,
+-				void *__value, size_t __size) __THROW;
+-
+-extern ssize_t listxattr (const char *__path, char *__list,
+-				size_t __size) __THROW;
+-extern ssize_t llistxattr (const char *__path, char *__list,
+-				size_t __size) __THROW;
+-extern ssize_t flistxattr (int __filedes, char *__list,
+-				size_t __size) __THROW;
+-
+-extern int removexattr (const char *__path, const char *__name) __THROW;
+-extern int lremovexattr (const char *__path, const char *__name) __THROW;
+-extern int fremovexattr (int __filedes,   const char *__name) __THROW;
+-
+-__END_DECLS
+-
+-#endif	/* __XATTR_H__ */
+Index: attr-2.4.47/libattr/Makefile
+===================================================================
+--- attr-2.4.47.orig/libattr/Makefile
++++ attr-2.4.47/libattr/Makefile
+@@ -29,12 +29,6 @@ LT_AGE = 1
+ CFILES = libattr.c attr_copy_fd.c attr_copy_file.c attr_copy_check.c attr_copy_action.c
+ HFILES = libattr.h
+ 
+-ifeq ($(PKG_PLATFORM),linux)
+-CFILES += syscalls.c
+-else
+-LSRCFILES = syscalls.c
+-endif
+-
+ LCFLAGS = -include libattr.h
+ 
+ default: $(LTLIBRARY)
+Index: attr-2.4.47/libattr/attr_copy_fd.c
+===================================================================
+--- attr-2.4.47.orig/libattr/attr_copy_fd.c
++++ attr-2.4.47/libattr/attr_copy_fd.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #include <sys/types.h>
++#include <sys/xattr.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+@@ -30,10 +31,6 @@
+ # include <alloca.h>
+ #endif
+ 
+-#if defined(HAVE_ATTR_XATTR_H)
+-# include <attr/xattr.h>
+-#endif
+-
+ #if defined(HAVE_ATTR_LIBATTR_H)
+ # include "attr/libattr.h"
+ #endif
+Index: attr-2.4.47/libattr/attr_copy_file.c
+===================================================================
+--- attr-2.4.47.orig/libattr/attr_copy_file.c
++++ attr-2.4.47/libattr/attr_copy_file.c
+@@ -22,6 +22,7 @@
+ #endif
+ 
+ #include <sys/types.h>
++#include <sys/xattr.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+@@ -30,10 +31,6 @@
+ # include <alloca.h>
+ #endif
+ 
+-#if defined(HAVE_ATTR_XATTR_H)
+-# include <attr/xattr.h>
+-#endif
+-
+ #if defined(HAVE_ATTR_LIBATTR_H)
+ # include "attr/libattr.h"
+ #endif
+Index: attr-2.4.47/libattr/libattr.c
+===================================================================
+--- attr-2.4.47.orig/libattr/libattr.c
++++ attr-2.4.47/libattr/libattr.c
+@@ -22,7 +22,7 @@
+ #include <unistd.h>
+ #include <sys/types.h>
+ 
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #include <attr/attributes.h>
+ 
+ #undef MAXNAMELEN
+Index: attr-2.4.47/libattr/libattr.h
+===================================================================
+--- attr-2.4.47.orig/libattr/libattr.h
++++ attr-2.4.47/libattr/libattr.h
+@@ -1,6 +1,5 @@
+ /* Features we provide ourself. */
+ 
+-#define HAVE_ATTR_XATTR_H 1
+ #define HAVE_ATTR_LIBATTR_H 1
+ #define HAVE_CONFIG_H 1
+ 
+Index: attr-2.4.47/libattr/syscalls.c
+===================================================================
+--- attr-2.4.47.orig/libattr/syscalls.c
++++ /dev/null
+@@ -1,105 +0,0 @@
+-/*
+- * Copyright (c) 2001-2002 Silicon Graphics, Inc.
+- * All Rights Reserved.
+- *
+- * This program is free software: you can redistribute it and/or modify it
+- * under the terms of the GNU Lesser General Public License as published by
+- * the Free Software Foundation, either version 2.1 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License for more details.
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+- */
+-
+-/*
+- * The use of the syscall() function is an additional level of
+- * indirection.  This avoids the dependency on kernel sources.
+- */
+-
+-#include <errno.h>
+-#include <unistd.h>
+-#include <sys/syscall.h>
+-
+-#if defined (__NR_setxattr)
+-# define HAVE_XATTR_SYSCALLS 1
+-#else
+-# warning "Extended attribute syscalls undefined for this architecture"
+-# define HAVE_XATTR_SYSCALLS 0
+-#endif
+-
+-#if HAVE_XATTR_SYSCALLS
+-# define SYSCALL(args...)	syscall(args)
+-#else
+-# define SYSCALL(args...)	( errno = ENOSYS, -1 )
+-#endif
+-
+-int setxattr (const char *path, const char *name,
+-			void *value, size_t size, int flags)
+-{
+-	return SYSCALL(__NR_setxattr, path, name, value, size, flags);
+-}
+-
+-int lsetxattr (const char *path, const char *name,
+-			void *value, size_t size, int flags)
+-{
+-	return SYSCALL(__NR_lsetxattr, path, name, value, size, flags);
+-}
+-
+-int fsetxattr (int filedes, const char *name,
+-			void *value, size_t size, int flags)
+-{
+-	return SYSCALL(__NR_fsetxattr, filedes, name, value, size, flags);
+-}
+-
+-ssize_t getxattr (const char *path, const char *name,
+-				void *value, size_t size)
+-{
+-	return SYSCALL(__NR_getxattr, path, name, value, size);
+-}
+-
+-ssize_t lgetxattr (const char *path, const char *name,
+-				void *value, size_t size)
+-{
+-	return SYSCALL(__NR_lgetxattr, path, name, value, size);
+-}
+-
+-ssize_t fgetxattr (int filedes, const char *name,
+-				void *value, size_t size)
+-{
+-	return SYSCALL(__NR_fgetxattr, filedes, name, value, size);
+-}
+-
+-ssize_t listxattr (const char *path, char *list, size_t size)
+-{
+-	return SYSCALL(__NR_listxattr, path, list, size);
+-}
+-
+-ssize_t llistxattr (const char *path, char *list, size_t size)
+-{
+-	return SYSCALL(__NR_llistxattr, path, list, size);
+-}
+-
+-ssize_t flistxattr (int filedes, char *list, size_t size)
+-{
+-	return SYSCALL(__NR_flistxattr, filedes, list, size);
+-}
+-
+-int removexattr (const char *path, const char *name)
+-{
+-	return SYSCALL(__NR_removexattr, path, name);
+-}
+-
+-int lremovexattr (const char *path, const char *name)
+-{
+-	return SYSCALL(__NR_lremovexattr, path, name);
+-}
+-
+-int fremovexattr (int filedes, const char *name)
+-{
+-	return SYSCALL(__NR_fremovexattr, filedes, name);
+-}
+Index: attr-2.4.47/setfattr/setfattr.c
+===================================================================
+--- attr-2.4.47.orig/setfattr/setfattr.c
++++ attr-2.4.47/setfattr/setfattr.c
+@@ -23,12 +23,13 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <errno.h>
+ #include <getopt.h>
+ #include <locale.h>
+ #include <ctype.h>
+ #include <libgen.h>
+ 
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #include "config.h"
+ #include "misc.h"
+ 
diff -Nru attr-2.4.47/debian/patches/series attr-2.4.47/debian/patches/series
--- attr-2.4.47/debian/patches/series	2013-05-20 11:51:52.000000000 +0000
+++ attr-2.4.47/debian/patches/series	2015-04-25 18:26:52.000000000 +0000
@@ -1,3 +1,4 @@
 01-configure.in.patch
 02-687531-fix-missing-ldflags.patch
 12-643587-attr-autoconf-version-check.patch
+20-remove-attr-xattr.patch

Reply via email to