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, 27= -size off_t *arg1 int *arg2 (0=test for equal, -1=smaller, 1=larger,
-2=smaller_or_equal , 2=larger_or_equal) -2=smaller_or_equal , 2=larger_or_equal)
28= -has_lfa_flags uint64_t *arg1 (Linux file attribute flag bits) 28= -has_lfa_flags uint64_t *arg1 (Linux file attribute flag bits)
29= -has_some_lfa_flags_of uint64_t *arg1
*/ */
int test_type; int test_type;

View File

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

View File

@ -947,14 +947,17 @@ off_t_overflow:;
Findjob_set_aaip_filter(job, 1, 0); Findjob_set_aaip_filter(job, 1, 0);
} else if(strcmp(argv[i], "-has_no_aaip")==0) { } else if(strcmp(argv[i], "-has_no_aaip")==0) {
Findjob_set_aaip_filter(job, -1, 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) if(i + 1 >= end_idx)
goto not_enough_arguments; goto not_enough_arguments;
i++; i++;
ret= Xorriso_decode_lfa_flags(xorriso, argv[i], &lfa_flags, 0); ret= Xorriso_decode_lfa_flags(xorriso, argv[i], &lfa_flags, 0);
if(ret <= 0) if(ret <= 0)
goto sorry_ex; 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) { } else if(strcmp(argv[i], "-has_filter")==0) {
Findjob_set_filter_filter(job, 1, 0); Findjob_set_filter_filter(job, 1, 0);
} else if(strcmp(argv[i], "-has_no_filter")==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", " performs an action on files below the given directory in",
" the ISO image. Tests:", " the ISO image. Tests:",
" -name pattern, -wholename pattern, -disk_name pattern,", " -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,", " -type b|c|d|p|f|l|s|e, -pending_data, -hidden,",
" -lba_range start count, -damaged, -has_acl, -has_xattr,", " -lba_range start count, -damaged, -has_acl, -has_xattr,",
" -has_aaip, -has_filter, -has_md5, -has_any_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,", " -has_hfs_crtp, -has_hfs_bless, -bad_outname,",
" -name_limit_blocker, -maxdepth, -mindepth, -size,", " -name_limit_blocker, -maxdepth, -mindepth, -size,",
" -prune, -decision yes|no, -true, -false", " -prune, -decision yes|no, -true, -false",

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps .\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1) .\" 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. .\" Please adjust this date whenever revising the manpage.
.\" .\"
.\" Some roff macros, for reference: .\" 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 .br
\-has_lfa_flags di \-has_lfa_flags di
.br .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 : \fB\-has_any_xattr\fR :
Matches files which have any xattr other than ACL. Matches files which have any xattr other than ACL.
.br .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' E.g. look for files with both flags 'i' (immutable) and 'd'
(no dump) set: (no dump) set:
-has_lfa_flags di -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 : -has_any_xattr :
Matches files which have any xattr other than ACL. Matches files which have any xattr other than ACL.
-has_md5 : -has_md5 :
@ -6524,44 +6533,44 @@ Node: Insert63843
Node: SetInsert76038 Node: SetInsert76038
Node: Manip86212 Node: Manip86212
Node: CmdFind97876 Node: CmdFind97876
Node: Filter118679 Node: Filter119126
Node: Writing123301 Node: Writing123748
Node: SetWrite135795 Node: SetWrite136242
Node: Bootable167070 Node: Bootable167517
Node: Jigdo198352 Node: Jigdo198799
Node: Charset203355 Node: Charset203802
Node: Exception206684 Node: Exception207131
Node: DialogCtl212813 Node: DialogCtl213260
Node: Inquiry215415 Node: Inquiry215862
Node: Navigate227980 Node: Navigate228427
Node: Verify237135 Node: Verify237582
Node: Restore248284 Node: Restore248731
Node: Emulation260491 Node: Emulation260938
Node: Scripting270947 Node: Scripting271394
Node: Frontend278841 Node: Frontend279288
Node: Examples288467 Node: Examples288914
Node: ExDevices289645 Node: ExDevices290092
Node: ExCreate290306 Node: ExCreate290753
Node: ExDialog291606 Node: ExDialog292053
Node: ExGrowing292877 Node: ExGrowing293324
Node: ExModifying293686 Node: ExModifying294133
Node: ExBootable294196 Node: ExBootable294643
Node: ExCharset294751 Node: ExCharset295198
Node: ExPseudo295647 Node: ExPseudo296094
Node: ExCdrecord296574 Node: ExCdrecord297021
Node: ExMkisofs296894 Node: ExMkisofs297341
Node: ExGrowisofs298791 Node: ExGrowisofs299238
Node: ExException299944 Node: ExException300391
Node: ExTime300402 Node: ExTime300849
Node: ExIncBackup300860 Node: ExIncBackup301307
Node: ExRestore304886 Node: ExRestore305333
Node: ExRecovery305832 Node: ExRecovery306279
Node: Files306404 Node: Files306851
Node: Environ307738 Node: Environ308185
Node: Seealso308486 Node: Seealso308933
Node: Bugreport309250 Node: Bugreport309697
Node: Legal309841 Node: Legal310288
Node: CommandIdx310853 Node: CommandIdx311300
Node: ConceptIdx329182 Node: ConceptIdx329629
 
End Tag Table End Tag Table

View File

@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps @c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection @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 .\" 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 .\" Please adjust this date whenever revising the manpage.
@c man .\" @c man .\"
@c man .\" Some roff macros, for reference: @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 -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 : @item -has_any_xattr :
Matches files which have any xattr other than ACL. 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"