Re: specifying ea_mask

Denis Corbin <[email protected]> Sat, 22 Jul 2006 23:27:21 +0200
Newsgroups gmane.comp.sysutils.backup.dar.libdar
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============1208502519==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enig3A571C0A1E65DE9DC4D7CD82"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig3A571C0A1E65DE9DC4D7CD82
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Will Stephenson wrote:
> Hi list

Hello,  (and sorry for the moderation overhead)

> 
> I'm trying to update kdar(*) to work with libdar 4.0.0 and have run into a 
> block 
> in the plain libdar::archive ctor.  
> 
> I see that root_ea and user_ea args have been replaced by ea_mask, which must 
> perform the same function, but I have no idea how to specify the 
> equivalent "ignore user EA"/"ignore system EA" options using ea_mask.

well, that's not that complicated, but that's true there is a lack of 
documentation on that point:

The ea_mask argument receives as argument a mask that defines which EA 
(based on the "domain.name" expression) will be considered or not. This 
is exactly as what can be found for file selection with file "subtree" 
and "selection" arguments that correspond to the -P/-g/-[/-] options for 
the first one and to the -X/-I options for the second one.

Thus, if you want to only consider user EA, you should give for example 
a simple_mask("user.*") or a regular_mask("^user\..*") as ea_mask 
argument to libdar.

if you want to ignore all EA, simply pass a bool_mask(false) as argument.

if you want to consider all EA, simply pass a bool_mask(true) as argument.

If you want to only consider system EA, the argument to pass can be for 
example a simple_mask("system.*").

for the negation like "ignore user EA", you need to build a negation 
this is done passing as argument the following object: 
not_mask(simple_mask("user.*"))


>  I've 
> poked around in the command_line.* sources but it seems the string for the 
> ignore/allow EAs comes from the command line, and I can't find an example or 
> documentation for this, 

EA have a structured name, where the first part is the domain ("system", 
  "user", "security", and so on), and the second part is the EA's name 
in that domain. Theses two parts are separated by a dot. Full EA format 
required by the system (and against which libdar makes comparisons) is 
thus of the form:

    user.my_own_EA
    system.some_other_EA
    security.yet_another_one


>the only masks I can find refer to extended file 
> permissions, which as I understand it are a subset of EAs.

well I guess no. Masks make a generic class hierarchy that work on 
strings. In one side a mask is build and pass to libdar. Libdar then, in 
the other side, presents to this mask each string it has to take an 
action on, the masks answer "true" or "false" for each presented string, 
and libdar take subsequent action (exclude/include file, exclude/include 
file or directory, exclude/include EA).

> 
> Put simply: 
> 
> A What's the mask for "all user EA"?

simple_mask("user.*")

> 
> B What's the mask for "all system EA"?

bool_mask(true)

> 
> C What's A & B?

and_mask tmp;
tmp.add(A);
tmp.add(B);


> 
> D What's !A & !B ?

and_mask tmp;
tmp.add(not_mask(A));
tmp.add(not_mask(B));

> 
> Can anyone enlighten me?

please refer to the libdar/mask.hpp file for full available mask from 
libdar. Note that you may also create your own mask by inheritance from 
an already defined mask class.

> 
> Thanks
> 
> Will
> 
> * Just a minimal update so it preserves the same behaviour with the new 
> libdar, no new features. 

Yes, I understand. I guess Johnathan will have some time soon or later 
to update kdar more deeply with new features. ;-)

Kind Regards,
Denis.

--------------enig3A571C0A1E65DE9DC4D7CD82
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEwphBpC5CI8gYGlIRAiM4AJ9RiRTFxrZ1h5y+dgnx4nkK7y16RgCfTPJA
0s6CDSNgcwFUrEuSGt5Ma5c=
=UYft
-----END PGP SIGNATURE-----

--------------enig3A571C0A1E65DE9DC4D7CD82--



--===============1208502519==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--===============1208502519==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Dar-libdar_api mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dar-libdar_api

--===============1208502519==--