diff mbox series

[1/5] package/lua-flu: fix to use system xattr header

Message ID 1905e7c3bd8c0711980e23dbd19d0b9040640b44.1525717511.git.yann.morin.1998@free.fr
State Changes Requested
Headers show
Series [1/5] package/lua-flu: fix to use system xattr header | expand

Commit Message

Yann E. MORIN May 7, 2018, 6:25 p.m. UTC
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Marcin Niestroj <m.niestroj@grinn-global.com>
Cc: Francois Perrad <francois.perrad@gadz.org>
---
 package/lua-flu/0001-use-system-xattr-h.patch | 161 ++++++++++++++++++++++++++
 1 file changed, 161 insertions(+)
 create mode 100644 package/lua-flu/0001-use-system-xattr-h.patch

Comments

Thomas Petazzoni May 7, 2018, 7:22 p.m. UTC | #1
Hello Yann,

On Mon,  7 May 2018 20:25:16 +0200, Yann E. MORIN wrote:
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Marcin Niestroj <m.niestroj@grinn-global.com>
> Cc: Francois Perrad <francois.perrad@gadz.org>
> ---
>  package/lua-flu/0001-use-system-xattr-h.patch | 161 ++++++++++++++++++++++++++
>  1 file changed, 161 insertions(+)
>  create mode 100644 package/lua-flu/0001-use-system-xattr-h.patch
> 
> diff --git a/package/lua-flu/0001-use-system-xattr-h.patch b/package/lua-flu/0001-use-system-xattr-h.patch
> new file mode 100644
> index 0000000000..fda03b60c6
> --- /dev/null
> +++ b/package/lua-flu/0001-use-system-xattr-h.patch
> @@ -0,0 +1,161 @@
> +Use system <sys/xattr.h>
> +
> +The one from attr is no longer installed with latest version.
> +
> +Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

This could have been a Mercurial-formatted patch. I think you know how
to use Mercurial :-)

> +diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/doc.lua lua-flu-20150331-1/doub-flu-a7daae986339/doc/doc.lua
> +--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/doc.lua	2015-03-31 18:54:19.000000000 +0200
> ++++ lua-flu-20150331-1/doub-flu-a7daae986339/doc/doc.lua	2018-05-06 09:22:28.499324049 +0200
> +@@ -327,7 +327,7 @@
> + 				name = "fs.getxattr";
> + 				parameters = {"path", "name"};
> + 				results = {"value"};
> +-				doc = [[Get an extended attribute. If the attribute doesn't exist `ENOATTR` should be thrown.]];
> ++				doc = [[Get an extended attribute. If the attribute doesn't exist `ENODATA` should be thrown.]];

I do understand all the attr/xattr.h -> sys/xattr.h changes, but I
don't understand the ENOATTR -> ENODATA changes. Has the ENOATTR error
code disappeared ? What makes ENODATA a suitable replacement ?

Thanks!

Thomas
Yann E. MORIN May 7, 2018, 8:29 p.m. UTC | #2
Thomas,All,

On 2018-05-07 21:22 +0200, Thomas Petazzoni spake thusly:
> On Mon,  7 May 2018 20:25:16 +0200, Yann E. MORIN wrote:
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Marcin Niestroj <m.niestroj@grinn-global.com>
> > Cc: Francois Perrad <francois.perrad@gadz.org>
> > ---
> >  package/lua-flu/0001-use-system-xattr-h.patch | 161 ++++++++++++++++++++++++++
> >  1 file changed, 161 insertions(+)
> >  create mode 100644 package/lua-flu/0001-use-system-xattr-h.patch
> > 
> > diff --git a/package/lua-flu/0001-use-system-xattr-h.patch b/package/lua-flu/0001-use-system-xattr-h.patch
> > new file mode 100644
> > index 0000000000..fda03b60c6
> > --- /dev/null
> > +++ b/package/lua-flu/0001-use-system-xattr-h.patch
> > @@ -0,0 +1,161 @@
> > +Use system <sys/xattr.h>
> > +
> > +The one from attr is no longer installed with latest version.
> > +
> > +Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> This could have been a Mercurial-formatted patch. I think you know how
> to use Mercurial :-)

Well, to be hionest,m I was indeed preparing the patch for submission
upstream (now done: https://bitbucket.org/doub/flu/pull-requests/1) and
I really struggled using hg... :-/

> > +diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/doc.lua lua-flu-20150331-1/doub-flu-a7daae986339/doc/doc.lua
> > +--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/doc.lua	2015-03-31 18:54:19.000000000 +0200
> > ++++ lua-flu-20150331-1/doub-flu-a7daae986339/doc/doc.lua	2018-05-06 09:22:28.499324049 +0200
> > +@@ -327,7 +327,7 @@
> > + 				name = "fs.getxattr";
> > + 				parameters = {"path", "name"};
> > + 				results = {"value"};
> > +-				doc = [[Get an extended attribute. If the attribute doesn't exist `ENOATTR` should be thrown.]];
> > ++				doc = [[Get an extended attribute. If the attribute doesn't exist `ENODATA` should be thrown.]];
> 
> I do understand all the attr/xattr.h -> sys/xattr.h changes, but I
> don't understand the ENOATTR -> ENODATA changes. Has the ENOATTR error
> code disappeared ? What makes ENODATA a suitable replacement ?

Oh, right; I forgot to explain that one.

attr, in <attr/xattr.h>, was doing:

    #ifndef ENOATTR
    # define ENOATTR ENODATA
    #endif

Ergo, ENOATTR is just ENODATA.

Regards,
Yann E. MORIN.

> Thanks!
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com
Yann E. MORIN May 7, 2018, 8:43 p.m. UTC | #3
Thomas, All,

On 2018-05-07 21:22 +0200, Thomas Petazzoni spake thusly:
> On Mon,  7 May 2018 20:25:16 +0200, Yann E. MORIN wrote:
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Marcin Niestroj <m.niestroj@grinn-global.com>
> > Cc: Francois Perrad <francois.perrad@gadz.org>
> > ---
> >  package/lua-flu/0001-use-system-xattr-h.patch | 161 ++++++++++++++++++++++++++
> >  1 file changed, 161 insertions(+)
> >  create mode 100644 package/lua-flu/0001-use-system-xattr-h.patch
> > 
> > diff --git a/package/lua-flu/0001-use-system-xattr-h.patch b/package/lua-flu/0001-use-system-xattr-h.patch
> > new file mode 100644
> > index 0000000000..fda03b60c6
> > --- /dev/null
> > +++ b/package/lua-flu/0001-use-system-xattr-h.patch
> > @@ -0,0 +1,161 @@
> > +Use system <sys/xattr.h>
> > +
> > +The one from attr is no longer installed with latest version.
> > +
> > +Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> This could have been a Mercurial-formatted patch. I think you know how
> to use Mercurial :-)

And no, this can't be a mercurial patch, because the luarocks infra
downloads archives from the lua package repositrory, which are
organised quite differently from the source tree.

So, the patch we carry is different from (really, a superset of) the
patch that I sent upstream:
    https://bitbucket.org/doub/flu/pull-requests/1

So, no, we won't carry a mercurial-formatted patch, I'm afraid... :-(

Regards,
Yann E. MORIN.

> > +diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/doc.lua lua-flu-20150331-1/doub-flu-a7daae986339/doc/doc.lua
> > +--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/doc.lua	2015-03-31 18:54:19.000000000 +0200
> > ++++ lua-flu-20150331-1/doub-flu-a7daae986339/doc/doc.lua	2018-05-06 09:22:28.499324049 +0200
> > +@@ -327,7 +327,7 @@
> > + 				name = "fs.getxattr";
> > + 				parameters = {"path", "name"};
> > + 				results = {"value"};
> > +-				doc = [[Get an extended attribute. If the attribute doesn't exist `ENOATTR` should be thrown.]];
> > ++				doc = [[Get an extended attribute. If the attribute doesn't exist `ENODATA` should be thrown.]];
> 
> I do understand all the attr/xattr.h -> sys/xattr.h changes, but I
> don't understand the ENOATTR -> ENODATA changes. Has the ENOATTR error
> code disappeared ? What makes ENODATA a suitable replacement ?
> 
> Thanks!
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com
Thomas Petazzoni May 7, 2018, 8:51 p.m. UTC | #4
Hello,

On Mon, 7 May 2018 22:29:34 +0200, Yann E. MORIN wrote:

> > > diff --git a/package/lua-flu/0001-use-system-xattr-h.patch b/package/lua-flu/0001-use-system-xattr-h.patch
> > > new file mode 100644
> > > index 0000000000..fda03b60c6
> > > --- /dev/null
> > > +++ b/package/lua-flu/0001-use-system-xattr-h.patch
> > > @@ -0,0 +1,161 @@
> > > +Use system <sys/xattr.h>
> > > +
> > > +The one from attr is no longer installed with latest version.
> > > +
> > > +Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>  
> > 
> > This could have been a Mercurial-formatted patch. I think you know how
> > to use Mercurial :-)  
> 
> Well, to be hionest,m I was indeed preparing the patch for submission
> upstream (now done: https://bitbucket.org/doub/flu/pull-requests/1) and
> I really struggled using hg... :-/

Can I say: "ha ha" ? :-)

> > I do understand all the attr/xattr.h -> sys/xattr.h changes, but I
> > don't understand the ENOATTR -> ENODATA changes. Has the ENOATTR error
> > code disappeared ? What makes ENODATA a suitable replacement ?  
> 
> Oh, right; I forgot to explain that one.
> 
> attr, in <attr/xattr.h>, was doing:
> 
>     #ifndef ENOATTR
>     # define ENOATTR ENODATA
>     #endif
> 
> Ergo, ENOATTR is just ENODATA.

OK, makes sense. Explaining it in the patch description would help,
then.

Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/lua-flu/0001-use-system-xattr-h.patch b/package/lua-flu/0001-use-system-xattr-h.patch
new file mode 100644
index 0000000000..fda03b60c6
--- /dev/null
+++ b/package/lua-flu/0001-use-system-xattr-h.patch
@@ -0,0 +1,161 @@ 
+Use system <sys/xattr.h>
+
+The one from attr is no longer installed with latest version.
+
+Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
+
+diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/doc.lua lua-flu-20150331-1/doub-flu-a7daae986339/doc/doc.lua
+--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/doc.lua	2015-03-31 18:54:19.000000000 +0200
++++ lua-flu-20150331-1/doub-flu-a7daae986339/doc/doc.lua	2018-05-06 09:22:28.499324049 +0200
+@@ -327,7 +327,7 @@
+ 				name = "fs.getxattr";
+ 				parameters = {"path", "name"};
+ 				results = {"value"};
+-				doc = [[Get an extended attribute. If the attribute doesn't exist `ENOATTR` should be thrown.]];
++				doc = [[Get an extended attribute. If the attribute doesn't exist `ENODATA` should be thrown.]];
+ 			},
+ 			{
+ 				name = "fs.listxattr";
+@@ -338,7 +338,7 @@
+ 			{
+ 				name = "fs.removexattr";
+ 				parameters = {"path", "name"};
+-				doc = [[Remove an extended attribute. If the attribute doesn't exist `ENOATTR` should be thrown.]];
++				doc = [[Remove an extended attribute. If the attribute doesn't exist `ENODATA` should be thrown.]];
+ 			},
+ 			{
+ 				name = "fs.opendir";
+diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/luafs.lua lua-flu-20150331-1/doub-flu-a7daae986339/doc/luafs.lua
+--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/luafs.lua	2015-03-31 18:54:19.000000000 +0200
++++ lua-flu-20150331-1/doub-flu-a7daae986339/doc/luafs.lua	2018-05-06 09:22:28.495324054 +0200
+@@ -222,8 +222,8 @@
+ -- :NOTE: since the filesystem is a pure tree (not a DAG), use the path to find attribs
+ 
+ function luafs.getxattr(path, name)
+-	local attrs = assert(xattrs[path], errno.ENOATTR)
+-	return assert(attrs[name], errno.ENOATTR)
++	local attrs = assert(xattrs[path], errno.ENODATA)
++	return assert(attrs[name], errno.ENODATA)
+ end
+ 
+ function luafs.setxattr(path, name, value, flags)
+@@ -236,7 +236,7 @@
+ end
+ 
+ function luafs.removexattr(path, name)
+-	local attrs = assert(xattrs[path], errno.ENOATTR)
++	local attrs = assert(xattrs[path], errno.ENODATA)
+ 	attrs[name] = nil
+ 	if next(attrs)==nil then
+ 		xattrs[path] = nil
+diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/manual.html lua-flu-20150331-1/doub-flu-a7daae986339/doc/manual.html
+--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/doc/manual.html	2015-03-31 18:54:19.000000000 +0200
++++ lua-flu-20150331-1/doub-flu-a7daae986339/doc/manual.html	2018-05-06 09:22:28.499324049 +0200
+@@ -347,7 +347,7 @@
+ 		<div class="function">
+ 		<h3><a name="fs.getxattr"><code>value = fs.getxattr (path, name)</code></a></h3>
+ 
+-<p>Get an extended attribute. If the attribute doesn't exist <code>ENOATTR</code> should be thrown.</p>
++<p>Get an extended attribute. If the attribute doesn't exist <code>ENODATA</code> should be thrown.</p>
+ 		</div>
+ 
+ 		<div class="function">
+@@ -359,7 +359,7 @@
+ 		<div class="function">
+ 		<h3><a name="fs.removexattr"><code>fs.removexattr (path, name)</code></a></h3>
+ 
+-<p>Remove an extended attribute. If the attribute doesn't exist <code>ENOATTR</code> should be thrown.</p>
++<p>Remove an extended attribute. If the attribute doesn't exist <code>ENODATA</code> should be thrown.</p>
+ 		</div>
+ 
+ 		<div class="function">
+diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/errno.c lua-flu-20150331-1/doub-flu-a7daae986339/errno.c
+--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/errno.c	2015-03-31 18:54:19.000000000 +0200
++++ lua-flu-20150331-1/doub-flu-a7daae986339/errno.c	2018-05-06 09:23:06.323282527 +0200
+@@ -3,7 +3,7 @@
+ #include <lua.h>
+ #include <lauxlib.h>
+ #include <stdlib.h>
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #include "compat.h"
+ 
+ /****************************************************************************/
+@@ -103,7 +103,7 @@
+ 	REGISTER_ERROR(EDOM)
+ 	REGISTER_ERROR(ERANGE)
+ 	REGISTER_ERROR(ENOSYS)
+-	REGISTER_ERROR(ENOATTR)
++	REGISTER_ERROR(ENODATA)
+ 	#undef REGISTER_ERROR
+ }
+ 
+diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/flu-20150331-1.rockspec lua-flu-20150331-1/doub-flu-a7daae986339/flu-20150331-1.rockspec
+--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/flu-20150331-1.rockspec	2018-05-06 09:22:04.123351349 +0200
++++ lua-flu-20150331-1/doub-flu-a7daae986339/flu-20150331-1.rockspec	2018-05-06 09:23:06.323282527 +0200
+@@ -14,7 +14,7 @@
+ 		library = 'fuse',
+ 	},
+ 	ATTR = {
+-		header = 'attr/xattr.h',
++		header = 'sys/xattr.h',
+ 	},
+ }
+ dependencies = {
+diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/flu.c lua-flu-20150331-1/doub-flu-a7daae986339/flu.c
+--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/flu.c	2015-03-31 18:54:19.000000000 +0200
++++ lua-flu-20150331-1/doub-flu-a7daae986339/flu.c	2018-05-06 09:23:06.323282527 +0200
+@@ -15,7 +15,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <fuse.h>
+-#include <attr/xattr.h>
++#include <sys/xattr.h>
+ #include <lua.h>
+ #include <lauxlib.h>
+ 
+diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/flu.rockspec.in lua-flu-20150331-1/doub-flu-a7daae986339/flu.rockspec.in
+--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/flu.rockspec.in	2015-03-31 18:54:19.000000000 +0200
++++ lua-flu-20150331-1/doub-flu-a7daae986339/flu.rockspec.in	2018-05-06 09:23:06.323282527 +0200
+@@ -14,7 +14,7 @@
+ 		library = 'fuse',
+ 	},
+ 	ATTR = {
+-		header = 'attr/xattr.h',
++		header = 'sys/xattr.h',
+ 	},
+ }
+ dependencies = {
+diff -durN lua-flu-20150331-1.orig/doub-flu-a7daae986339/README.md lua-flu-20150331-1/doub-flu-a7daae986339/README.md
+--- lua-flu-20150331-1.orig/doub-flu-a7daae986339/README.md	2015-03-31 18:54:19.000000000 +0200
++++ lua-flu-20150331-1/doub-flu-a7daae986339/README.md	2018-05-06 09:22:28.495324054 +0200
+@@ -345,7 +345,7 @@
+ 
+ ### `value = fs.getxattr (path, name)`
+ 
+-Get an extended attribute. If the attribute doesn't exist `ENOATTR` should be thrown.
++Get an extended attribute. If the attribute doesn't exist `ENODATA` should be thrown.
+ 
+ ---
+ 
+@@ -357,7 +357,7 @@
+ 
+ ### `fs.removexattr (path, name)`
+ 
+-Remove an extended attribute. If the attribute doesn't exist `ENOATTR` should be thrown.
++Remove an extended attribute. If the attribute doesn't exist `ENODATA` should be thrown.
+ 
+ ---
+ 
+diff -durN lua-flu-20150331-1.orig/flu-20150331-1.rockspec lua-flu-20150331-1/flu-20150331-1.rockspec
+--- lua-flu-20150331-1.orig/flu-20150331-1.rockspec	2015-04-02 23:44:11.000000000 +0200
++++ lua-flu-20150331-1/flu-20150331-1.rockspec	2018-05-06 09:23:06.323282527 +0200
+@@ -14,7 +14,7 @@
+ 		library = 'fuse',
+ 	},
+ 	ATTR = {
+-		header = 'attr/xattr.h',
++		header = 'sys/xattr.h',
+ 	},
+ }
+ dependencies = {