Re: Usage of masks for EA

Denis Corbin <[email protected]> Fri, 28 Mar 2008 13:14:50 +0100
Newsgroups gmane.comp.sysutils.backup.dar.libdar
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sascha Ochsenknecht a wrote:
> Hello,

Hello,

> 
> I'm currently working on KDar to make it work with the latest libdar 
> release.
> 
> I'm struggling with the Extended Attributes (EA) and the libdar::mask to 
> specify which EA to archive, restore etc.
> The user should be able to switch on/off system and user EA, so I 
> created the mask like this:
> 
> // --- snip ---
> 
> using namespace libdar;
> 
> et_mask mask;	// AND mask, should match if all added masks match
> 
> mask.add_mask(bool_mask(true));	// all EA
> 
> // ignore user EA
> if ( !userEA() ) {
>     mask.add_mask(not_mask(regular_mask("user.*", false)));
> }

regular_mask class requires a regular expression as string. Here you
seem to give a glob expression, the simple_mask class is the one you
need, I guess.

> 
> if ( !systemEA() ) {
>     mask.add_mask(not_mask(regular_mask("system.*", false)));
> }

same remark here. If you absolutely want to use a regular_mask object
you need to replace the string "system.*" by "^system\."

> 
> // now use the mask to create/restore archive, e.g. archive::archive() 
> archive::op_extract() ...
> // --- snip ---
> 
> But the EA are always stored/restored, even when I try to filter out 
> system and user EA.
> 
> Did I misunderstand something? Why it is not working as expected?

I guess you made confusion between regular and glob expressions,

> 
> Thanks in advance,
> Regards,
> Sascha
> 
> 

Regards,
Denis.

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

iD8DBQFH7OE6pC5CI8gYGlIRArgMAKCja482ehpRne0mGkceXV0N0YbdKgCdE6Vb
E/Jo7m3sFGKxjGB5oNMozVE=
=k9wz
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace