- Jun 26, 2024
-
-
Cédric Marie authored
Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
Cédric Marie authored
The capability to parse a checksum file that has not been ordered into case-sensitive alphabetical order should not be considered to be a bug fix, but rather an improvement. It doesn't change anything if the checksum files have been created by Unaltered, but it can be useful if they have been created by another tool. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
Cédric Marie authored
Make the difference between too few (no command) and too many arguments. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
Cédric Marie authored
In the README file, make it clear that the command is executed in the current directory. Providing directories in arguments may be risky, if the ENTER key is pressed too soon by accident, whereas checking the current directory has to be done before typing the command. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
Cédric Marie authored
When computing the checksum with try_digest(), don't use unwrap() which will panic in case of error (permission denied for example). Instead, print an explicit error message, and exit with failure. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
- Jun 25, 2024
-
-
Cédric Marie authored
If anything went wrong, return a failure exit status. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
Cédric Marie authored
In case of error when handling the checksum file, print the explicit error message. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
- Jun 17, 2024
-
-
Cédric Marie authored
Use an enum (List, Update or Check) for the command, instead of two booleans (update and check). This makes more sense, because the two booleans cannot both be true at the same time. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
Cédric Marie authored
It sounds more natural to list the files that have been removed before the ones that need to be added. Therefore, parse the checksum file at first, to detect all the files that are not present anymore in the directory list. And then parse the directory list again, to detect all the files that have not been found and must be added. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
- Jun 14, 2024
-
-
Cédric Marie authored
Add CHANGELOG.md file, to describe the changes since the first release. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
Cédric Marie authored
If the checksum file is not sorted as expected (case-sensitive alphabetical order), some files will be detected as removed and added, and their checksum will be computed again. This can happen if the checksum file was sorted into case-insensitive alphabetical order, for example with "sha256sum *" command in a terminal with en_US.UTF-8 locale. To avoid this, read all the checksums into an array at the beginning, and then, when parsing the content of the directory, search for each file in the whole array, whatever its position. In the end, reorder the content of the checksum file if necesssary, even if there is no other change. The algorithm is slightly less efficient if the checksum files were created by Unaltered (and thus sorted as expected), but it is more robust and compatible with checksum files created by other tools. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
- May 17, 2024
-
-
Cédric Marie authored
Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
Cédric Marie authored
Try to make the description and the instructions clearer. In the README file, provide the detailed steps for typical use cases. Mention that the alphabetical order is case-sensitive, and that the checksum files are compatible with sha256sum command. In the help message, instead of describing the details of each command, first describe what the expected status is, because it will be checked by all commands. It simplifies the description of the commands. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
- May 15, 2024
-
-
Cédric Marie authored
Read the last modification time of each file. If a file is already listed, but more recent than the checksum file, then it means that the checksum file is not up to date for this file. In that case, the file must not be considered altered (bad checksum). It has obviously been deliberately modified after the checksum file was created or updated for the last time. * When using the 'list' or 'check' command, a warning must be printed (with the 'check' command it is not even necessary to verify the checksum). * When using the 'update' command, the checksum of the file must be updated. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
- May 13, 2024
-
-
Cédric Marie authored
When the checksum file is created or updated, make sure to set the read-only permission on it. This file should not be manually edited. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-
- May 06, 2024
-
-
Cédric Marie authored
With this first version you can create checksum files, update them if some files are added or removed, and verify the checksums. Signed-off-by:
Cédric Marie <cedric@hjuvi.fr.eu.org>
-