Gentoo Archives: gentoo-portage-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH v3] xattr: centralize the various shims in one place
Date: Sat, 30 May 2015 19:59:50
Message-Id: 20150530195946.GA4496@vapier
In Reply to: Re: [gentoo-portage-dev] [PATCH v3] xattr: centralize the various shims in one place by Zac Medico
1 On 30 May 2015 12:21, Zac Medico wrote:
2 > On 05/30/2015 08:14 AM, Mike Frysinger wrote:
3 > > + @classmethod
4 > > + def list(cls, item, nofollow=False, namespace=None, _names_only=True):
5 > > + cmd = ['getfattr', '-d', '--absolute-names', item]
6 >
7 > All getfattr calls need to use -m- ('-' pattern means match all) in
8 > order to list all attributes.
9
10 i use -m already. here's a bit more of that function:
11
12 def list(cls, item, nofollow=False, namespace=None, _names_only=True):
13 cmd = ['getfattr', '-d', '--absolute-names', item]
14 if nofollow:
15 cmd += ['-h']
16 cmd += ['-m', ('^%s[.]' % namespace) if namespace else '']
17 proc = cls._call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
18
19 so when there's no namespace specified, it ends up doing:
20 getfattr -d --absolute-names /path/file -m ''
21
22 which is effectively the same thing, but i can change the '' to '-' since that's
23 what the documentation suggests.
24 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature