New -find test -has_some_lfa_flags_of

This commit is contained in:
Thomas Schmitt 2024-08-06 22:21:41 +02:00
parent a8eabad3da
commit 58fb826c1d
7 changed files with 86 additions and 45 deletions

View File

@ -58,6 +58,7 @@ struct ExprtesT {
27= -size off_t *arg1 int *arg2 (0=test for equal, -1=smaller, 1=larger,
-2=smaller_or_equal , 2=larger_or_equal)
28= -has_lfa_flags uint64_t *arg1 (Linux file attribute flag bits)
29= -has_some_lfa_flags_of uint64_t *arg1
*/
int test_type;

View File

@ -3391,6 +3391,7 @@ return:
}
break; case 28: /* -has_lfa_flags uint64_t lfa_flags */
case 29: /* -has_some_lfa_flags_of uint64_t *arg */
lfa_flags= *((uint64_t *) ftest->arg1);
ret= Xorriso_get_lfa_flags(xorriso, node, path, &node_flags, &max_bit, 0);
if(ret <= 0) {
@ -3399,7 +3400,11 @@ return:
value= 0;
goto ex;
}
if(ftest->test_type == 28) {
value= ((node_flags & lfa_flags) == lfa_flags);
} else {
value= !!(node_flags & lfa_flags);
}
break; default:

View File

@ -947,14 +947,17 @@ off_t_overflow:;
Findjob_set_aaip_filter(job, 1, 0);
} else if(strcmp(argv[i], "-has_no_aaip")==0) {
Findjob_set_aaip_filter(job, -1, 0);
} else if(strcmp(argv[i], "-has_lfa_flags")==0) {
} else if(strcmp(argv[i], "-has_lfa_flags") == 0 ||
strcmp(argv[i], "-has_some_lfa_flags_of") == 0) {
if(i + 1 >= end_idx)
goto not_enough_arguments;
i++;
ret= Xorriso_decode_lfa_flags(xorriso, argv[i], &lfa_flags, 0);
if(ret <= 0)
goto sorry_ex;
Findjob_set_uint64_filter(job, 28, lfa_flags, 0);
Findjob_set_uint64_filter(job,
28 + (strcmp(argv[i - 1], "-has_some_lfa_flags_of") == 0),
lfa_flags, 0);
} else if(strcmp(argv[i], "-has_filter")==0) {
Findjob_set_filter_filter(job, 1, 0);
} else if(strcmp(argv[i], "-has_no_filter")==0) {
@ -2231,9 +2234,12 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" performs an action on files below the given directory in",
" the ISO image. Tests:",
" -name pattern, -wholename pattern, -disk_name pattern,",
" -disk_path pattern, -use_pattern on|off,",
" -or_use_pattern on|off, -name_limit_blocker length,",
" -type b|c|d|p|f|l|s|e, -pending_data, -hidden,",
" -lba_range start count, -damaged, -has_acl, -has_xattr,",
" -has_aaip, -has_filter, -has_md5, -has_any_xattr,",
" -has_lfa_flags letters, -has_some_lfa_flags_of letters,",
" -has_hfs_crtp, -has_hfs_bless, -bad_outname,",
" -name_limit_blocker, -maxdepth, -mindepth, -size,",
" -prune, -decision yes|no, -true, -false",

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Version 1.5.7, Aug 05, 2024"
.TH XORRISO 1 "Version 1.5.7, Aug 06, 2024"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -2249,6 +2249,16 @@ E.g. look for files with both flags 'i' (immutable) and 'd' (no dump) set:
.br
\-has_lfa_flags di
.br
\fB\-has_some_lfa_flags_of\fR flag_letters :
.br
Similar to \-has_lfa_flags but matching files which have Linux file attributes
attached and have at least one of the flags set which correspond to the
characters in the string flag_letters. The flag_letters string "\-" never
matches any file.
E.g. look for files which have 'i' or 'a' or both of them set:
.br
\-has_some_lfa_flags_of ia
.br
\fB\-has_any_xattr\fR :
Matches files which have any xattr other than ACL.
.br

View File

@ -1926,6 +1926,15 @@ File: xorriso.info, Node: CmdFind, Next: Filter, Prev: Manip, Up: Commands
E.g. look for files with both flags 'i' (immutable) and 'd'
(no dump) set:
-has_lfa_flags di
-has_some_lfa_flags_of flag_letters :
Similar to -has_lfa_flags but matching files which have Linux
file attributes attached and have at least one of the flags
set which correspond to the characters in the string
flag_letters. The flag_letters string "-" never matches any
file. E.g. look for files which have 'i' or 'a' or both of
them set:
-has_some_lfa_flags_of ia
-has_any_xattr :
Matches files which have any xattr other than ACL.
-has_md5 :
@ -6524,44 +6533,44 @@ Node: Insert63843
Node: SetInsert76038
Node: Manip86212
Node: CmdFind97876
Node: Filter118679
Node: Writing123301
Node: SetWrite135795
Node: Bootable167070
Node: Jigdo198352
Node: Charset203355
Node: Exception206684
Node: DialogCtl212813
Node: Inquiry215415
Node: Navigate227980
Node: Verify237135
Node: Restore248284
Node: Emulation260491
Node: Scripting270947
Node: Frontend278841
Node: Examples288467
Node: ExDevices289645
Node: ExCreate290306
Node: ExDialog291606
Node: ExGrowing292877
Node: ExModifying293686
Node: ExBootable294196
Node: ExCharset294751
Node: ExPseudo295647
Node: ExCdrecord296574
Node: ExMkisofs296894
Node: ExGrowisofs298791
Node: ExException299944
Node: ExTime300402
Node: ExIncBackup300860
Node: ExRestore304886
Node: ExRecovery305832
Node: Files306404
Node: Environ307738
Node: Seealso308486
Node: Bugreport309250
Node: Legal309841
Node: CommandIdx310853
Node: ConceptIdx329182
Node: Filter119126
Node: Writing123748
Node: SetWrite136242
Node: Bootable167517
Node: Jigdo198799
Node: Charset203802
Node: Exception207131
Node: DialogCtl213260
Node: Inquiry215862
Node: Navigate228427
Node: Verify237582
Node: Restore248731
Node: Emulation260938
Node: Scripting271394
Node: Frontend279288
Node: Examples288914
Node: ExDevices290092
Node: ExCreate290753
Node: ExDialog292053
Node: ExGrowing293324
Node: ExModifying294133
Node: ExBootable294643
Node: ExCharset295198
Node: ExPseudo296094
Node: ExCdrecord297021
Node: ExMkisofs297341
Node: ExGrowisofs299238
Node: ExException300391
Node: ExTime300849
Node: ExIncBackup301307
Node: ExRestore305333
Node: ExRecovery306279
Node: Files306851
Node: Environ308185
Node: Seealso308933
Node: Bugreport309697
Node: Legal310288
Node: CommandIdx311300
Node: ConceptIdx329629

End Tag Table

View File

@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISO 1 "Version 1.5.7, Aug 05, 2024"
@c man .TH XORRISO 1 "Version 1.5.7, Aug 06, 2024"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -2659,6 +2659,16 @@ E.g. look for files with both flags 'i' (immutable) and 'd' (no dump) set:
@*
-has_lfa_flags di
@*
@item -has_some_lfa_flags_of flag_letters :
@*
Similar to -has_lfa_flags but matching files which have Linux file attributes
attached and have at least one of the flags set which correspond to the
characters in the string flag_letters. The flag_letters string "-" never
matches any file.
E.g. look for files which have 'i' or 'a' or both of them set:
@*
-has_some_lfa_flags_of ia
@*
@item -has_any_xattr :
Matches files which have any xattr other than ACL.
@*

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.08.06.193329"
#define Xorriso_timestamP "2024.08.06.202116"