Add support for Join sets where the parity protects the split files These sorts of sets are sometimes created by people who do not know exactly what they are doing. It is beneficial to be able to extract these sets appropriately.
Improve distribution Add a ChangeLog and example configuration file to the source distribution. This makes things nicer for the end user. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Print a traceback on unknown exceptions Unknown exceptions were already handled by the code, but they would not lead to a traceback, making errors harder to find. Now we add a traceback to the log to help in tracking them down. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Use else clauses in exception handlers The else clause in an exception handler helps to define what should happen during normal running, when an exception doesn't happen. Use them to make the code clearer. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Major Update This changes the structure of the entire program, making it much simpler to maintain. The old structure was needlessly complicated by improper use of packages. This version is lacking a few features that were present in the original version, but nothing that I ever used. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Use exceptions for error handling The previous error handling strategy was very Linux kernel like, showing influence from what I was working on while I designed this program. Refactor the program to use exceptions, which significantly reduces the amount of code needed for error handling. Best practices are now followed: we only catch exceptions where we need to log a message and rethrow, or for a complete unit of work. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Clean up program name and version code This makes the program name and version be defined in only one place in the code, right at the beginning of rarslave.py. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Add Copyright / License information + Documentation Add the COPYING file (GPLv2). Add the GPLv2 copyright notice to all files. Add documentation to all modules, classes, and functions. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
[RARSLAVE] Add executable bit Add the executable bits to the rarslave.py file. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Move common functionality into rsutil package This patch moves all of the common functionality from the RarslaveCommon, RarslaveConfig, and RarslaveGlobals classes into a new package, called rsutil. It then converts everything over to the new package. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Migrate all PAR2Set-derived classes to the package notation This package migrates all of the PAR2Set-derived classes to the new PAR2Set package notation. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
[LOGGER] Switch to built-in logging class Switch from the homegrown RarslaveLogger class to the built-in logging class. Convert all code that used RarslaveLogger to use the logging class, and remove the RarslaveLogger class completely. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Major Projectwide Restructuring Some major deficiencies were noticed in the previous design. Specifically, the order of execution of steps was not customizable on a per-type basis. This led to the problem of some types not being able to finish correctly. Since this was obviously sub-optimal, the change was needed. This adds a RarslaveDetector class, and many PAR2Set-derived classes. Each of the PAR2Set-derived classes will be able to detect and fully verify / repair / extract their type of set. When adding new sets, the new types only need to be added to the RarslaveDetector class. Everything else is automatic. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
Remove inappropriate class variables, add instance variable documentation Removes all of the improperly used class variables. In their place, adds documentation for all of the instance variables that should be used throughout the life of each instance of a class. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
[RARSLAVE] Remove forgotten debugging code Remove some debugging code that was accidentally left in by mistake. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
[RARSLAVE] Fix runCheckAndRepair() for joined files The function runCheckAndRepair() was broken for files that needed to be joined, because it was including protected files on the par2 command line. This patch fixes the behavior so that only split pieces are added. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
[RARSLAVE] Major Refactoring This continues the refactoring started in the last commit. The changes encompass both the PAR2Set and RarslaveExtractor classes. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
[RARSLAVE] Refactoring of PAR2Set This patch moves much of the functionality required only by the PAR2Set class from the global scope into the PAR2Set class itself. It is now much more careful about only generating sets of data once (where possible). Also, it is much more careful to re-generate a set of data when it is possible (and likely) that it has changed. Fixes: Failure to remove original versions (.1 extension) of repaired files. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
[RARSLAVE] Eliminate duplicates when finding deleteable files Use a set() to eliminate duplicates when searching for deletable files. This fixes the OSError that happens when the file cannot be found because it was already deleted. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
[RARSLAVE] Have find_deleteable_files() search when called Changes the function find_deleteable_files() to do a search when it is called, rather than operating on old (and probably out-of-date) data. Signed-off-by: Ira W. Snyder <devel@irasnyder.com>