Kevin Day [Thu, 8 May 2025 04:53:19 +0000 (23:53 -0500)]
Workaround: The compiler and linker fail to understand that compiling statically should also link statically.
This is a logic or design flaw that is just plain idiotic.
When compiling statically (passing `-static`), there cannot be any shared/dynamic linked data.
Rather than recognizing this, if there is a shared library during a static build then the shared library is linked to.
The compiler and linker, at least, supports explicitly forcing the point that a static library is to be linked.
This is done via `-l:libc.a` for libc linking rather than `-lc`.
This should not be necessary, but it unfortunately is.
Kevin Day [Thu, 1 May 2025 02:50:28 +0000 (21:50 -0500)]
Update: Some macros and documentation.
I am starting to get back to working on TacocaT.
This addresses a single `@todo` regarding adding documentation and also renames several of the related macros.
Kevin Day [Thu, 1 May 2025 01:50:51 +0000 (20:50 -0500)]
Update: Next micro version (0.7.2).
The following are the commands that I ran to make this change.
# find data/ sources/ specifications/ documents/ licenses/ install.sh -type f -exec sed -i -e 's|0\.7\.1|0.7.2|g' '{}' ';'
# find data/ sources/ specifications/ documents/ licenses/ -type f -exec sed -i -e 's|^version_micro 1|version_micro 2|g' '{}' ';'
# find sources/ -name *.h -exec sed -i -e 's|_program_version_micro_s F_string_ascii_1_s|_program_version_micro_s F_string_ascii_2_s|g' '{}' ';'
# find sources/ -name *.h -exec sed -i -e 's|_program_version_micro_s_length F_string_ascii_1_s_length|_program_version_micro_s_length F_string_ascii_2_s_length|g' '{}' ';'
# sed -i -e 's|version_micro 1|version_micro 2|g' data/build/{remove,tacocat}/settings data/build/stand_alone/settings/settings.*
Kevin Day [Fri, 25 Apr 2025 04:23:55 +0000 (23:23 -0500)]
Progress: Continue working on completing the remove program.
Tweak the logic to ensure the simulate prints the simulate message only once for the top-most directory and then only for the second simulate pass (which is after the recursion into the directory children).
Make so the `--remember yes` works as intended.
Make the `--remember yes` the default for the `remove` program.
Print the "skip yes" when simulating and remember state causes a skip.
A unit test is failing due to a bug/regression in `kt_remove_operate_recurse_action()`.
I belive this line is the concern:
```
if (!(flag & f_directory_recurse_do_flag_action_d) || !kt_remove_operate_shall_remove(recurse->state.code) && !((main->setting.flag & kt_remove_main_flag_simulate_d) && !recurse->depth)) return;
```
This is not yet addressed.
Kevin Day [Wed, 23 Apr 2025 03:45:50 +0000 (22:45 -0500)]
Update: Add higher level testfile.
Previously, something like the following is needed to perform the "remove" program runtime unit tests:
```
fake -w /tmp/fll-0.7/ clean make -f testfile -U build/remove
```
This new `testfile` allows for shortening the command to:
```
fake -w /tmp/fll-0.7/ clean make -f testfile
```
Note tat the `-w /tmp/fll-0.7/` is an example use-case for where I am storing the work directory files.
The command can be simplified to just the following (given a clean source directory and proper system installation of dependencies):
```
fake -f testfile
```
Kevin Day [Wed, 23 Apr 2025 02:47:54 +0000 (21:47 -0500)]
Progress: Continue working on completing the remove program.
Remove no longer used flags and code.
Add recurse flags.
The statistics cache ended up not being used.
Remove it entirely and the related code adding to the cache.
The tree mode is now updated to be in line with the latest functionality..
Ensure that the simulate is not printed twice for the top level directory being recursed.
This is done by adding an additional "simulate not" flag that is then passed to simulate printing functions as appropriate.
This is only needed for cases where the recursion is enabled.
Kevin Day [Mon, 21 Apr 2025 03:18:08 +0000 (22:18 -0500)]
Progress: Continue working on completing the remove program.
Update to the latest FLL changes.
The FLL changes include parameter processing changes to support the `--` parameter as a stop processing parameters option.
Enable this and remove the manual process that was previously performed.
Add the root path check.
Make sure a parameter exists in the `remove` program to toggle this behavior.
A lot of the simulate and directory recursion behavior is now dead code due to the recent recursion changes.
Remove the dead code and simplify the parameters.
Update the unit tests.
I noticed some situations in the unit tests that could be improved to be more accurate and correct.
An `@fixme` has been added to accomplish this.
Kevin Day [Sat, 19 Apr 2025 02:22:26 +0000 (21:22 -0500)]
Progress: Continue working on completing the remove program.
Remove final remove command in directory recursion.
It turns out that there is a bug in FLL `fl_directory_do()` that makes this necessary.
That bug is now fixed and this code is no longer needed.
In fact, with `fl_directory_do()` fixed this now causes a problem with attempt to double delete a directory.
Kevin Day [Sun, 13 Apr 2025 19:53:27 +0000 (14:53 -0500)]
Update: Pass 0 to f_directory_remove() to avoid nftw() calls.
The `fl_directory_do()` already is taking care of the recursive delete.
The `f_directory_remove()` should not need to recurse.
The `nftw()` uses a lot of resources and slows down the speed even when the directory is empty.
The massif-visualizer shows that with `nftw()` there are two ~548.8 Kb spikes to remove empty directories.
Without the `nftw()` there is only a single 64Kb spike to remove the same empty directories.
The time taken with `nftw()` takes about 4e+06.
The time taken without `nftw()` takes about 1.6e+06.
The memory usage according to valgrind with `nftw()` is about 84 allocs, 84 frees, 3,303,959 bytes allocated.
The memory usage according to valgrind without `nftw()` is about 74 allocs, 74 frees, 497,999 bytes allocated.
The command I used to test this is:
```
clear ; md a/b/{c/d,e/f} && touch xxx && touch a/b/file.txt && valgrind remove a/b xxx -r ; t a
clear ; md a/b/{c/d,e/f} && touch xxx && touch a/b/file.txt && valgrind --tool=massif remove a/b xxx -r ; t a
```
Kevin Day [Sun, 13 Apr 2025 03:12:51 +0000 (22:12 -0500)]
Progress: Continue working on completing the remove program.
Add normal allocation length define and shrink the path to this size if the size is larger than the large length.
Restructure the simulate to be called during the directory recursion so that there is only a single `fl_directory_do()` recursion.
The simulate must not be aware of when it is being called during recursion and when it is not being called during recursion.
The directory has to be processed to determine if and when it is being recursed.
However, the directory should be deleted after recursion into its child paths.
Update the unit rests accordingly.
The directory recursion is now moved into a top level cache.
This reduces the amount of allocations necessary and makes clean up on exit easier.
The parent path logic needs to be updated.
I added sample snippet of code with a todo, commented out.
Remove some stale documentation comments.
I did some basic tests using (with and without `-S` added):
```
clear ; md a/b/c/d && touch a/b/file.txt && valgrind --leak-check=full remove +V a/b -r ; t a
```
And (with and without `-S` added):
```
clear ; md a/b/{c/d,e/f} && touch a/b/file.txt && valgrind --leak-check=full remove +V a/b -r ; t a
```
The file statistics for the top-level directory being recursed needs to be preserved and passed through to the simulate.
The first directory processing pass before recursion should retain this.
During recursion, the parent directory should utilize this information when needed.
Kevin Day [Fri, 11 Apr 2025 03:55:39 +0000 (22:55 -0500)]
Progress: Continue working on completing the remove program.
Add file type ignore flags to conditionally suppress printing types when not wanted during simulation.
This is needed for the `rm` program when simulate is wrong.
Prior to this change the `rm` program is showing all file types.
Kevin Day [Thu, 10 Apr 2025 02:48:01 +0000 (21:48 -0500)]
Progress: Continue working on completing the remove program.
I want to remove the multiple `fl_directory_do()` calls.
This means that I need to change how pre-processing and removal is performed.
The pre-processing needs to happen before each remove.
The recursion needs to happen during the remove.
This begins refactoring the code to allow for this design change.
The recursive functions do not use the `main.setting.state.status` and so the functions need to be updated to instead return the status.
I placed a delete on the top level, but recursion is not necessarily properly done yet.
I only partially changed the structure to test out some of the recent changes, primarily trying to confirm/deny if the simulate is working as desired.
I still need to complete/correct the logic for proper deletion with recursion.
Update to utilize the newly added `fll_program_signal_check_loop()` and `fll_program_signal_check_simple()`.
Remove all stale and no longer needed signal check defines.
Kevin Day [Thu, 3 Apr 2025 03:28:22 +0000 (22:28 -0500)]
Progress: Continue working on completing the remove program.
Make sure to not set the `kt_remove_main_flag_option_type_d` for the "different" and "same" parameters.
Make sure to not set the `kt_remove_main_flag_option_used_d` for the "empty" parameters.
The `kt_remove_flag_file_operate_recurse_d` flag is being set on a directory, but it is always being set without regard to te recursive parameter.
Remove it an and just check the recurse parameter instead.
The empty not flag should be checked when checking empty states.
Remove accidental assignment of `kt_remove_flag_file_operate_remove_d` when `is` is true for the `kt_remove_preprocess_file_type()`.
Address the program unit tests.
Add the empty parameters in places where the tests were originally expecting the remove command to remove non-empty directories by default.
The directory tree tests were improperly returning false on the mocked empty for the parent directory after the child directory was mock deleted.
I'm currently investigating problems where the following does not work as expect:
```shell
clear ; md a/b/c ; touch a/b/file ; remove a/b/ -r +V ; t a
```
Cast the `flag_operate` when transfering to/from the `recurse.state.code`.
Kevin Day [Wed, 2 Apr 2025 04:24:47 +0000 (23:24 -0500)]
Progress: Continue working on completing the remove program.
Remove redundant code and get rid of a lot of the callbacks.
I did further structural investigation and found that I really didn't need most callbacks.
Add special flags to distinguish when file types are being specified and when they are not.
Then when this is set, handle accordingly and print errors.
This reduces the need for custom handling code in each of the other programs like `rm`, `rmdir`, and `unlink`.
Update the settings and flags accordingly.
I have not gotten the time to update the unit tests, which currently now fail.
I also need to review the programs and their replacement counterparts for any problems.
Kevin Day [Wed, 2 Apr 2025 02:11:32 +0000 (21:11 -0500)]
Progress: Continue working on completing the remove program.
Clean up the function naming.
The file remove and directory remove structure is rather confusing, name-wise.
Simplify the names.
Now that I know how I intended to implement the callbacks, I can remove unused callbacks.
This is being committed in isolation to allow for better diagnostics.
I will follow this up with additional testing whose changes, if any, will be in additional commits.
I still need to review existing functionality and also resolve incomplete functionality.
Kevin Day [Tue, 1 Apr 2025 00:53:28 +0000 (19:53 -0500)]
Progress: Continue working on completing the remove program.
Fix recursion parameter to actually work by setting the `kt_remove_depth_max_d` when calling `f_directory_remove()`.
Make sure `--force` works as expected as well as work when not specified (remove unnecessary checks).
Still print verbose messages even when in debug mode while the force parameter is passed.
Oops! I incorrectly used `macro_f_console_parameter_t_initialize_6()` when I instead should have used `macro_f_console_parameter_t_initialize_4()`.
The `macro_f_console_parameter_t_initialize_4()` is for the short parameter type where the `macro_f_console_parameter_t_initialize_6()` is for the simple parameter type.
Finish the `--help` messages for the `rm` program.
Make sure to note that the `--one-file-system` is not supported.
Fix messaage for `--preserve-root=all` error.
Make sure to handle `--preserve-root=/`.
Kevin Day [Sun, 30 Mar 2025 03:12:49 +0000 (22:12 -0500)]
Progress: Continue working on completing the remove program.
Implement most of the `rm` program.
There are some remaining details and I need to also test the program.
Move some of the repeated setup code into `kt_remove_setting_load_standard()`.
Add the initial settings needed to support the `--preserve-root` and `--presserve-root-not` support via the newly added `root` flag.
This work is not yet implemented and needs to be completed.
Add support for all programs to return `2` instead of `1` when `F_support_not` is an error return to the main program.
I might end up applying this behavior to all of my FLL and related programs.
The `rm` program in particular has the `--` being manually processed.
I figured given the simple nature of this program that it would be easier to manually pre-process than to utilize the custom callbacks supported by the `f_console_parameter_process()`.
Kevin Day [Fri, 28 Mar 2025 22:38:06 +0000 (17:38 -0500)]
Progress: Continue working on completing the remove program.
Make sure the `--force` parameter is properly suppressing errors and warnings when a file is not found.
Do not print an error or error out when `--force` is used.
Utilize the `ignore` string and print the boolean state based on `--force` when a file is not found during simulation mode.
Remove the warning on file not found because an error is potentially printed later on.
Update the `--prompt` settings.
Update the program unit tests.
The program now properly returns non-zero on file not found when trying to remove.
The program unit tests are updated to match this expectation.
Update the readme documentation for the remove program.
Fix the standard parameters and properly use `f_console_standard_parameter_last_e`.
Kevin Day [Fri, 28 Mar 2025 03:15:01 +0000 (22:15 -0500)]
Progress: Continue working on completing the remove program.
Add the `rmdir` program.
The `install.sh` script doesn't utilize the `-s` parameter.
There only needs to be a single `install.sh` command, which attempts to install everything in the build directory.
Update the version numbers to `0.7.1` just to make relating to the 0.7.x FLL more consistent and obvious.
Eventually these will separate and change in their own ways but for now this is not a problem as there is no official Kevux Tools release.
Change how the `--remember` logic works.
Skip the pre-process entirely if the remember matches.
Do not append a trailing slash for directories.
(There may need to be more code reviews due to the new remember logic and I will have to do this later.)
The `skip` printing in the simulation mode is no longer needed due to this change.
The `--empty` logic along with the `--ignore-fail-on-non-empty` is changed.
I need to rethink the design but for now just make the logic work for `--ignore-fail-on-non-empty`.
This allows for `rmdir` to work as expected with `--ignore-fail-on-non-empty` and without `--ignore-fail-on-non-empty`.
These changes break some of the unit tests.
The `--force` tests also started failing.
It looks like I didn't actually finish those tests and they happened to previously pass so I didn't notice that it is incomplete.
I will come back to these tests later to address them.
Kevin Day [Thu, 27 Mar 2025 03:34:00 +0000 (22:34 -0500)]
Progress: Continue working on completing the remove program.
Update the copyright year.
Add the `unlink` program.
Make sure all necessary callbacks are available to perform this.
Use a custom parameter processing to more closely match the standard Coreutils unlink argument.
I am still preserving some of the core parameters of the FLL/Kevux projects.
(This means that there is the `++version` and the `--version`.)
Fix bug where no error was being printed on non-existent file.
Make sure to also exit on error in this situation.
Kevin Day [Thu, 27 Mar 2025 01:18:50 +0000 (20:18 -0500)]
Progress: Continue working on completing the remove program.
Use polling on the standard input to allow for blocking in an interruptible way.
Once there is input the file read can be called to read the input.
This finishes the `remove` program development.
I am still designating this as progress because the following wrapper programs now need to be written:
- `rm`
- `rmdir`
- `unlink`
Kevin Day [Wed, 26 Mar 2025 22:43:56 +0000 (17:43 -0500)]
Progress: Continue working on completing the remove program.
This wraps up most of the `remove` program functionality.
It seems that I already had Time and EpochTime logic in place and I didn't have to do anything.
Add the program unit tests for time and EpochTime.
Fix some documentation comments in the program unit tests.
There is a remaining `@todo` in the `remove` program that will need to be address in the FLL.
I will have to brain storm on how I want to do this and I may end up adding callbacks to all file read and write functions.
Kevin Day [Wed, 26 Mar 2025 00:24:36 +0000 (19:24 -0500)]
Progress: Continue working on completing the remove program.
Add UNIX Timestamp tests.
Fix date changed tests where I forgot to reset temporary date loop variable assignment before committing.
Add the accessed and updated (modified) time tests.
When recursion is disabled and a directory is being followed, then prevent a double delete by not performing the delete on the "after" at the top level.
Implement the `--prompt` support.
Make sure to take in command line input.
Make sure to quit the program when prompt is one time and the answer is no.
Change the flag to 32-bit for consistency reasons.
Kevin Day [Tue, 25 Mar 2025 03:01:12 +0000 (22:01 -0500)]
Progress: Continue working on completing the remove program.
Finish some work that I thought I finished in the previous commit.
There were some commented out cases where I was doing controlled manual testing and I forgot to restore the commented out logic.
The Time and EpochTime are not well documented and are also not actually implemented!
Add more of the Time and EpochTime documentation.
I will look into implementing this at a later date.
Kevin Day [Mon, 24 Mar 2025 02:16:41 +0000 (21:16 -0500)]
Progress: Continue working on completing the remove program.
This adds the yesterday and today program unit tests.
Focus on getting the unit tests working and correcting the logic.
There is a lot of logic surrounding the relative dates and times that makes this ripe for an error.
I will need to add more program unit tests over time to better catch logic mistakes.
Kevin Day [Sat, 22 Mar 2025 16:41:33 +0000 (11:41 -0500)]
Progress: Continue working on completing the remove program.
The existing program unit tests revealed that the date pre-processing is:
1. Happening even when none of the date flags (access, changed, and updated) are set.
2. Is incorrectly returning `F_yes` due to the initial `F_okay` assignment to `status`.
Add `accessed_changed_updated` helper flag and use that flag to ensure the `kt_remove_preprocess_file_dates()` only gets called when needed.
Initialize the `status` value to `F_false` in the `kt_remove_preprocess_file_dates()`.
The newly added pint functions is resulting in an extra call to `geteuid()`.
Add a second wrap call to address this.
I may want to use a variable in the future to prevent multiple calls to this function.
Kevin Day [Sat, 22 Mar 2025 03:18:53 +0000 (22:18 -0500)]
Progress: Continue working on completing the remove program.
Utilize the FLL file type strings.
Merge the separate file stat printing into the simulate function and create the appropriate print functions.
Fix the loop variable name order ('i' before 'j').
Fix the printing of the Time and EpochTime units.
Print the time units on the same line as the `updated`, `accessed`, and `changed`.
Improve error printing for user and group IDs when the ID is not found or too large.
Kevin Day [Fri, 21 Mar 2025 03:12:49 +0000 (22:12 -0500)]
This provides changes that were documented in that commit.
Fix the `--force` flag, which essentially means that it must ignore missing files.
Update the help documentation regarding this.
The file stat printing function is very redundant and should be combined into the simulate function.
I noticed that the date based pre-processing is only in the printing and is not yet toggling the flags.
Begin moving this over.
I decided to make a separate function to handle this given its size.
Reset the `!(^)` check back to a `==`.
The compiler should be able to determine the most efficient operation and using plain `==` is just more readable.
Add some additional help messages describing how the `<` and `>` characters must be quoted to prevent them being used as redirect characters.
Is `stop_year` not being used when it should be?
Plan on investigating this.
Be more consistent with the parameter handling strings in the program unit tests.
This includes changes that were supposed to be in that commit.
Add file type based program unit tests.
Add user based program unit tests.
Add group based program unit tests.
Fix bug exposed by the program unit tests where the id tests are only being performed as a group test even when it needs to be a user test.
This is fixed by creating and passing the `is_user` boolean to the functions.
Fix bug exposed by the program unit tests where the `--same` and `--different` boolean logic is reversed resulting in `--same` removing for different users and `--different` removing for the same user.
Kevin Day [Tue, 18 Mar 2025 01:20:32 +0000 (20:20 -0500)]
Progress: Continue working on completing the remove program.
Add more recurse simple program unit tests.
Add the tree simple program unit tests.
Implement the tree delete operation.
Relocate the parent directory pre-process to a loop that is processed after all other files and directories are removed.
Kevin Day [Mon, 17 Mar 2025 03:55:14 +0000 (22:55 -0500)]
Progress: Continue working on completing the remove program.
Add the first more complex file removal runtime unit tests.
I may start calling these "program unit tests" as that sounds more accurate than "runtime unit tests".
The `f_directory_is()` should not be needed because the `fl_directory_do()` already passed a flag designating that the path is or is not a directory.
Remove the calls to `f_directory_is()` and instead use the appropriate flag.
Add `directory_parent` helper flag.
Report whether or not the path is a parent path when using tree mode.
The tree mode has changes in this commit that are not yet tested and need to be tested.
I should write a program unit test for this as well.
The "list" flag is not needed for the `fl_diectory_do()` processing.
The `parent` and `child` flags are now used differently.
The `parent` flag is now used to represent a parent directory only in the case where tree mode is enabled and the directory is only a parent directory do to parent tree traversal.
The `child` flag is now used to represent recursion from some directory.
The recursion cannot happen on a `parent` as the tree mode does not support recursion on a parent.
The `child` is passed to any directory or file that is being recursed into.
The lack of the `child` flag should designate that this is a top-level directory as far as recursion is concerned.
Fix an issue where the wrong flag is being used for the `flag_operate` `directory` flag.
Both the `kt_remove_operate_file_directory()` and the `kt_remove_preprocess_file()` should have the directory and parent flags cleared when called via pre-process recursion.
The pre-process recursion does not need to pass any flags to the recursion callback (via the `recurse.flag`).
The operate recursion does not need to pass the list flag to the recursion callback (via the `recurse.flag`).
Make sure the directory state is preserved by mapping the flag from the `fl_directory_do()` to a flag for the kt_remove file operations.
Kevin Day [Wed, 12 Mar 2025 03:06:33 +0000 (22:06 -0500)]
Progress: Continue working on completing the remove program.
Add more runtime unit tests.
This begins adding simple directory recurse tests.
The current test written for this is incomplete and needs the `fl_directory_do()` to be unwrapped.
Then the individual parts need to be mocked as needed.
Kevin Day [Tue, 11 Mar 2025 04:47:08 +0000 (23:47 -0500)]
Progress: Continue working on completing the remove program.
Fix a bug exposed by the directory unit tests where the `recurse.path_top` is not being defined and must be.
Add additional safety checks to fall back to a NULL string if `recurse.path_top` is NULL.
Add basic file and directory tests.
There are still a lot more tests to write.
This should be an acceptable start.
Refresh the stand alone build settings and config.h files.
Kevin Day [Mon, 10 Mar 2025 03:22:43 +0000 (22:22 -0500)]
Progress: Continue working on completing the remove program.
I discovered that the `fl_directory_do()` could use some improvements while working on this.
Those changes are now made in the FLL project.
Make changes to this project based on the `fl_directory_do()` updates.
I began writing some tests and I encountered several problems and concerns that side-tracked me.
Rename the `kt_remove_operate_file_recurse()` to `kt_remove_operate_file_directory()`.
This should make its design and purpose more clear.
Make sure that the recurse status is processed in the proper order for the file operation directory.
Fix the problem where the recursion is being performed even when the recurse flag is not set.
Add checks to see if the directory is empty or not before deleting when recursion is not enabled.
The flag (called code in this case) needs to accurately reflect the directory status of the file during recursion.
Make sure the recurse error handler uses the top path or the recurse path as appropriate.
Print debug messages before recursion begins.
Add missing `f_status_t` return states to several print functions.
I did not do an exhaustive look (I imagine the TacocaT program needs similar changes).
Fix problems where the program output is being used for the print functions rather than the print output.
The runtime unit tests do not work correctly because the standard outputs are being closed.
Add additional ifdef checks to prevent the set down functions from being called.
Kevin Day [Sat, 8 Mar 2025 05:37:15 +0000 (23:37 -0600)]
Progress: Continue working on completing the remove program.
This adds the beginnings of the runtime, unit test like, testing.
This approach for a runtime test is being done to make mocking functions easier.
The goal here is to not have actual files created and especially to have no files actually deleted.
If the delete doesn't work properly, then there should be no consequences due to not actually running any real deletes.
The current state of this simply tests the help and version parameters.
I chose this as a way to hash out the process that I am going to use.
This fixes a mistake in the individual library link name for `-lfl_directory`.
Kevin Day [Thu, 13 Feb 2025 03:34:43 +0000 (21:34 -0600)]
Progress: Continue working on completing the remove program.
Complete the recursion logic.
There wasn't much left to do at glance.
Additional testing will weed out any remaining incomplete functionality.
This should leaves:
- The remaining `@todo` notes.
- Any remaining advanced matching (if any).
- Adding runtime tests.
A note about adding unit or runtime tests.
I am thinking that I need to mock all of the remove functions.
These mocked functions will write a flag bit in something that will designate all of the removed files.
This result of marked removals can be matched to the expected removals.
This could operate like a combination of a unit test and a runtime test (unit test over the main program, which would be effectively the same as a runtime test in some ways).
Kevin Day [Wed, 12 Feb 2025 02:01:28 +0000 (20:01 -0600)]
Progress: Continue working on completing the remove program.
Utilize the recently added `f_id_t`, `f_gid_t`, and `f_uid_t` types and the respective function to reduce the amount of code for user and group ID processing.
Kevin Day [Sun, 9 Feb 2025 06:42:07 +0000 (00:42 -0600)]
Progress: Continue working on completing the remove program and update with FLL changes.
There is a lot of work on the recursion behavior.
These changes were interrupted and I need to relook at them and get back to where I was.
There are likely partially complete changes that puts this code in a bad state, in terms of execution.
Kevin Day [Wed, 29 Jan 2025 04:24:47 +0000 (22:24 -0600)]
Progress: Continue working on completing the remove program.
Implement the prompt simulate message logic.
Change the "prompt all" to "prompt each".
Move link detection outside of the print function (which it probably should not have been there anyway) and perform the link detection during preprocessing.
The simulate function is renamed to preprocess.
Add a tree cache structure for building a distinct list of tree paths.
I may very likely need to sort this somehow.
The tree caching allows for dynamically building the tree list and allowing for the tree removal during a post process step.
I am trying to avoid excessive pre-processing loops.
I am currently thinking that the simulate can still handle the processing without a pre-process loop that organizes everything before the simulate.
There will need to be some sort of logic added to detect and ignore already deleted paths in cases where the same path appears multiple times.
Kevin Day [Thu, 23 Jan 2025 07:02:18 +0000 (01:02 -0600)]
Progress: Continue working on completing the remove program.
A good portion of the settings loader is simplified.
Swithc to using `fl_path_clean()` instead of `fl_path_canonical()`.
I find the shorter paths more convenient at this time than the full canonical ones.
I may add a custom option in the future that toggles on canonical paths.
Kevin Day [Sat, 18 Jan 2025 23:08:20 +0000 (17:08 -0600)]
Progress: Continue working on completing the remove program.
Clean up the code a bit and fix some obvious mistakes.
Problems with the parameters are now fixed.
Start organizing and fixing the simulate.
Added some strings that may or may not be needed and will be removed if the future if it turns out they are not needed.
Add and use the process_operate_file_simulate() function.
The process_operate_file() shouldn't be called within simulate.
Do some work regarding directories and the empty state.
Additional flags are added.
Add flag bits to designate that if the remove flag bit is set then it should be ignored.
It is ignored as do not remove or it is ignored as do not remove then throw an error.
Using a bit like this allows for the rest of the code to only care about when it should add the remove flag.
Only in cases that explicitly prevent removal should the remove not and remove fail flags be set.
Kevin Day [Thu, 16 Jan 2025 05:11:56 +0000 (23:11 -0600)]
Progress: Resume work on completing the remove program.
This may be simpler to complete than TacocaT.
Make a few improvements while reviewing the state of the code and trying to remember where to resume development.
I should try to wrap up the simulate function entirely as the starting point.
Kevin Day [Thu, 16 Jan 2025 04:14:17 +0000 (22:14 -0600)]
Cleanup: Remove kt_remove_parameter_isolate_e commented out code.
The isolate parameter is not supported and is not planned to be supported.
One of the reasons why I decided to write this remove program is because I observed odd bugs with the rm and rmdir programs in a chroot environment when compiling Kevux.
The `/proc` might not be mounted and the remove commands fail.
Adding support for `/proc` adds more code that requires special user-space paths to exist.
This is not an unideal situations.
I've decided to not support the `-i`/`--isolate` command because of this reason and because not implementing this simplifies the code.
Kevin Day [Wed, 31 Jul 2024 02:42:49 +0000 (21:42 -0500)]
Refactor: Change bit-wise enumerations into defines.
I did some reviewing of how the enumerations used for flags are used.
These generally are not being used as a type.
An enumeration slightly increases the resulting binary size.
Enumeration values might be limited to just type of int.
This seems like an easy (small) optimization to just use defines rather than enumerations for flags and other bit-wise numbers.
Kevin Day [Thu, 23 May 2024 04:34:24 +0000 (23:34 -0500)]
Update: Remove the ++first and ++last parameters and relating logic.
I have used this for a while and have decided these are not worth the effort.
The addition is very nice but the additional code and logic is just extra maintenance and complexity for very little gain.
Kevin Day [Wed, 13 Mar 2024 03:20:10 +0000 (22:20 -0500)]
Progress: Further work in TacocaT, updating "salt" and "time" packet headers.
The "salt" header is now in the FLL project.
Remove the "salt" string definition from this project.
The packet send now utilizes the "time" header via the standard UTC time.
This is for informative purposes rather than for any accurancy.
Which means that the lack of microseconds or nanoseconds is acceptable.
Kevin Day [Sat, 9 Mar 2024 06:51:51 +0000 (00:51 -0600)]
Update: The payload header structures based on recent development changes.
The f_fss_payload_header_state_t and f_fss_payload_header_internal_t should instead be fl_fss_payload_header_state_t and fl_fss_payload_header_internal_t.
Kevin Day [Wed, 28 Feb 2024 02:34:24 +0000 (20:34 -0600)]
Cleanup: The OSLv1 license, fixing grammar and clarifying intent.
This does not change the license other than fixing grammar and making the intent more consistent and clear.
This also adds a day to the license data that represents that last time this license has been modified.
The version number is changed only when there is a functional or substantial change to the license.
I have noticed that in some places individuals decide the "includes" is a restrictive word.
It is not, especially given that it is literally an inclusive word.
This changes the wording from "includes" or "including" to something like "including but not limited to" avoid any of that non-sense.
The proper application of the English language would result in the "but not limited to" being redundant and pointless.
This specific language is added just in case somebody does not understand the English language when it comes to the word "including".
Try to be consistent and use "lawful" instead of "legal" (except in cases where both are mentioned).
Generally, referring to "lawful" here also includes "legal".
The "lawful" is chosen to represent actual law rather than the more questionable "legal" terminology.
The wording of "access to use, implement, etc.." can be misinterpreted such that the "access to" is applied to implement (and etc..) such that it becomes "access to implement".
The actual intent and design is not simply around "access to implement".
Instead, it is around "to implement", period.
Clarify this by splitting out "access to use" into "to access", "to use", etc...
Kevin Day [Sun, 25 Feb 2024 16:30:29 +0000 (10:30 -0600)]
Update: Disable -fstrict-flex-arrays=3 flag because it doesn't work on GCC 11.
I just did tests on GCC 11, which is not too old.
The -fstrict-flex-arrays flag does not work there.
For now, just disable the flag by setting it to the non-existent gcc_13 mode.
The mode can be added to the mode list and enabled if so desired.
I may make version specific modes available in the future (or not) but that will require some planning.
The fakefile should be designed to test the GCC version, but I would rather avoid such logic by design.
Let the distributor or the system administrator handle such decisions.