rarslave2.git
6 years agoAdd support for Join sets where the parity protects the split files master
Ira W. Snyder [Wed, 7 May 2014 01:08:09 +0000 (18:08 -0700)]
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.

6 years agoPAR2Set/utils: add the ability to redirect stdout
Ira W. Snyder [Wed, 7 May 2014 01:07:15 +0000 (18:07 -0700)]
PAR2Set/utils: add the ability to redirect stdout

The subprocess module supports redirecting stdout to an open file
descriptor. Expose this in our wrapper.

6 years agoPAR2Set/ZIP: fix output directory
Ira W. Snyder [Wed, 7 May 2014 01:06:26 +0000 (18:06 -0700)]
PAR2Set/ZIP: fix output directory

It is unclear when or why this was changed. I'm sure it fixed a bug
which was noticed at some point.

11 years agoImprove distribution v2.1.0
Ira W. Snyder [Sun, 9 Nov 2008 20:22:54 +0000 (12:22 -0800)]
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>
11 years agoPrint a traceback on unknown exceptions
Ira W. Snyder [Sun, 9 Nov 2008 20:04:23 +0000 (12:04 -0800)]
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>
11 years agoUse else clauses in exception handlers
Ira W. Snyder [Sun, 9 Nov 2008 20:02:50 +0000 (12:02 -0800)]
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>
11 years agoMajor Update
Ira W. Snyder [Sun, 2 Nov 2008 06:02:39 +0000 (23:02 -0700)]
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>
11 years agoUse exceptions for error handling
Ira W. Snyder [Fri, 31 Oct 2008 03:47:46 +0000 (20:47 -0700)]
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>
13 years agoClean up program name and version code
Ira W. Snyder [Wed, 14 Feb 2007 04:50:26 +0000 (20:50 -0800)]
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>
13 years agoAdd sdist to Makefile & Cleanup setup.py syntax.
Ira W. Snyder [Wed, 14 Feb 2007 04:45:57 +0000 (20:45 -0800)]
Add sdist to Makefile & Cleanup setup.py syntax.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoAdding python distutils-based setup.
Ira W. Snyder [Wed, 14 Feb 2007 04:40:50 +0000 (20:40 -0800)]
Adding python distutils-based setup.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoBugfix: Fix deletion of .1 files for NoExtract type v2.0.0
Ira W. Snyder [Sat, 27 Jan 2007 19:27:50 +0000 (11:27 -0800)]
Bugfix: Fix deletion of .1 files for NoExtract type

The NoExtract type failed to delete files that were produced during the
repair stage. These files typically end with the extension ".1". This patch
updates the update_matches() function to handle this case.

Note that it is possible that other sets will have this problem, in which
case this patch could be ported to the PAR2Set.Base.Base class, but I have
never seen such a case in the wild.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RSUTIL] Fix directory handling
Ira W. Snyder [Wed, 10 Jan 2007 07:48:57 +0000 (23:48 -0800)]
[RSUTIL] Fix directory handling

Fix the directory handling to make it more os-portable, using os.join()
instead of hardcoded paths.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[PAR2Set] Fix extraction head regular expression
Ira W. Snyder [Mon, 8 Jan 2007 19:56:43 +0000 (11:56 -0800)]
[PAR2Set] Fix extraction head regular expression

The regular expression for finding the extraction heads of an OldRAR type
was incorrect. This patch adds the missing termination character.

This keeps it from trying to extract files created during repair, such as:
X.rar.1

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[DETECTOR] Add detected type to log message
Ira W. Snyder [Mon, 8 Jan 2007 19:54:29 +0000 (11:54 -0800)]
[DETECTOR] Add detected type to log message

Add the PAR2Set type that was detected to the log message.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[JOIN] Fix os.path.samefile() check for win32
Ira W. Snyder [Mon, 8 Jan 2007 04:04:04 +0000 (20:04 -0800)]
[JOIN] Fix os.path.samefile() check for win32

The function os.path.samefile() doesn't exist on win32, so we will just
check and see if the names are the same, that will be good enough to fix mv
in this case.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[JOIN] Fix removal of protected files
Ira W. Snyder [Mon, 8 Jan 2007 03:58:18 +0000 (19:58 -0800)]
[JOIN] Fix removal of protected files

In the join case, since we are not extracting files, we don't really want
to remove the files. So, in this case, remove all files that the
delete_regex matches, but not the files that are protected.

This fixes the following case:
==========================================
X.rar.par2
X.rar.vol0+1.par2
...
X.rar.001
X.rar.002
...

Where X.rar is the only protected file. When the process completes, X.rar
will be the only file left.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoAdd Copyright / License information + Documentation
Ira W. Snyder [Tue, 2 Jan 2007 19:43:42 +0000 (11:43 -0800)]
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>
13 years ago[RARSLAVE] Add executable bit
Ira W. Snyder [Tue, 2 Jan 2007 08:38:14 +0000 (00:38 -0800)]
[RARSLAVE] Add executable bit

Add the executable bits to the rarslave.py file.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[PAR2SET] Add missing os declarations
Ira W. Snyder [Tue, 2 Jan 2007 03:36:32 +0000 (19:36 -0800)]
[PAR2SET] Add missing os declarations

Add the missing os declarations to the PAR2Set-derived classes.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoAdd NoExtract detector
Ira W. Snyder [Tue, 2 Jan 2007 01:07:09 +0000 (17:07 -0800)]
Add NoExtract detector

Add a new PAR2Set-derived detector which will detect types that are not
extractable, and should be repaired only.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoConvert all return values to use rsutil package
Ira W. Snyder [Tue, 2 Jan 2007 00:48:52 +0000 (16:48 -0800)]
Convert all return values to use rsutil package

All of the return values used values defined in the rsutil package. This
fixes all of them so that rsutil is used.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoMove common functionality into rsutil package
Ira W. Snyder [Tue, 2 Jan 2007 00:40:43 +0000 (16:40 -0800)]
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>
13 years agoMigrate all PAR2Set-derived classes to the package notation
Ira W. Snyder [Mon, 1 Jan 2007 23:15:38 +0000 (15:15 -0800)]
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>
13 years agoPackage PAR2Set and derived classes
Ira W. Snyder [Mon, 1 Jan 2007 22:18:24 +0000 (14:18 -0800)]
Package PAR2Set and derived classes

Move the PAR2Set class and it's derived classes into a new PAR2Set package.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[LOGGER] Switch to built-in logging class
Ira W. Snyder [Mon, 1 Jan 2007 21:33:04 +0000 (13:33 -0800)]
[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>
13 years ago[PAR2SET_JOIN] Fix detection code
Ira W. Snyder [Mon, 1 Jan 2007 08:56:06 +0000 (00:56 -0800)]
[PAR2SET_JOIN] Fix detection code

This makes the detection code more exact. This will now properly fail when
a set with the following files comes along:

Name matches:
X.par2
X.vol0+1.par2
X.001
X.002
...

Protection matches:
X.001
X.002
...

This new type will have to be handled in a seperate PAR2Set-derived class.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoMajor Projectwide Restructuring
Ira W. Snyder [Mon, 1 Jan 2007 08:36:14 +0000 (00:36 -0800)]
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>
13 years ago[PAR2PARSER] Force file closure
Ira W. Snyder [Mon, 1 Jan 2007 02:59:48 +0000 (18:59 -0800)]
[PAR2PARSER] Force file closure

Make sure that the par2 file we are parsing gets closed after each time we
parse it, regardless of whether or not we return successfully or raise an
exception.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoRemove inappropriate class variables, add instance variable documentation
Ira W. Snyder [Sun, 31 Dec 2006 22:50:04 +0000 (14:50 -0800)]
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>
13 years agoAdd .gitignore
Ira W. Snyder [Sun, 31 Dec 2006 22:46:47 +0000 (14:46 -0800)]
Add .gitignore

Add the .gitignore file to the project. This should ignore most common
things that show up.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Remove forgotten debugging code
Ira W. Snyder [Fri, 29 Dec 2006 05:52:08 +0000 (21:52 -0800)]
[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>
13 years ago[RARSLAVE] Fix runCheckAndRepair() for joined files
Ira W. Snyder [Fri, 29 Dec 2006 03:17:32 +0000 (19:17 -0800)]
[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>
13 years ago[RARSLAVE] Major Refactoring
Ira W. Snyder [Fri, 29 Dec 2006 00:56:18 +0000 (16:56 -0800)]
[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>
13 years ago[RARSLAVE] Refactoring of PAR2Set
Ira W. Snyder [Thu, 28 Dec 2006 19:40:17 +0000 (11:40 -0800)]
[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>
13 years ago[RARSLAVE] Eliminate duplicates when finding deleteable files
Ira W. Snyder [Thu, 28 Dec 2006 07:28:34 +0000 (23:28 -0800)]
[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>
13 years ago[RARSLAVE] Have find_deleteable_files() search when called
Ira W. Snyder [Thu, 28 Dec 2006 07:19:23 +0000 (23:19 -0800)]
[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>
13 years ago[RARSLAVE] Fix exception syntax
Ira W. Snyder [Thu, 28 Dec 2006 05:12:26 +0000 (21:12 -0800)]
[RARSLAVE] Fix exception syntax

Fixes a stupid error in syntax made in the last commit.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[PAR2PARSER] Fix Par2Parser class
Ira W. Snyder [Thu, 28 Dec 2006 05:09:36 +0000 (21:09 -0800)]
[PAR2PARSER] Fix Par2Parser class

The original class was registering every PAR2 file as corrupt, even though
the old parser handled them fine. This reverts to the old parser, fixing
the problem.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Fix default deletion option
Ira W. Snyder [Thu, 28 Dec 2006 04:42:38 +0000 (20:42 -0800)]
[RARSLAVE] Fix default deletion option

Change the default null response to the deletion prompt to not delete
anything.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Update par2parser calls
Ira W. Snyder [Thu, 28 Dec 2006 04:18:53 +0000 (20:18 -0800)]
[RARSLAVE] Update par2parser calls

Update calls to the par2parser class to Par2Parser to reflect the name
change made in the previous commit.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Rename par2parser to Par2Parser
Ira W. Snyder [Thu, 28 Dec 2006 04:14:54 +0000 (20:14 -0800)]
[RARSLAVE] Rename par2parser to Par2Parser

Renamed the par2parser module to Par2Parser. Updated rarslave.py with the
change.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Catch exceptions from par2parser
Ira W. Snyder [Thu, 28 Dec 2006 04:00:17 +0000 (20:00 -0800)]
[RARSLAVE] Catch exceptions from par2parser

Add try / except blocks to catch exceptions that happen in the par2parser
class.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[PAR2PARSER] Add extra corrupt file checks
Ira W. Snyder [Thu, 28 Dec 2006 03:56:01 +0000 (19:56 -0800)]
[PAR2PARSER] Add extra corrupt file checks

Add checks to calls of file.read() and file.seek() to make sure that
exceptions caused by these calls are caught. They usually occur because of
corrupt PAR2 files.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[PAR2PARSER] Tabify the file properly
Ira W. Snyder [Thu, 28 Dec 2006 03:53:18 +0000 (19:53 -0800)]
[PAR2PARSER] Tabify the file properly

Tabify the par2parser.py file properly.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[TESTS] Remove old tests
Ira W. Snyder [Thu, 28 Dec 2006 02:55:16 +0000 (18:55 -0800)]
[TESTS] Remove old tests

Remove some tests that correspond to features that were removed.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Fix interactive deletion
Ira W. Snyder [Wed, 27 Dec 2006 06:52:46 +0000 (22:52 -0800)]
[RARSLAVE] Fix interactive deletion

Adds the accidentally ommitted list of files to the prompt that gets
displayed during interactive deletion.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Change message log-level
Ira W. Snyder [Wed, 27 Dec 2006 06:48:43 +0000 (22:48 -0800)]
[RARSLAVE] Change message log-level

Change the message of using the default extractor to be a verbose message,
since it is likely to come up when extracting mp3 sets, etc.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Improve "likely file" detection
Ira W. Snyder [Wed, 27 Dec 2006 06:43:01 +0000 (22:43 -0800)]
[RARSLAVE] Improve "likely file" detection

Improve the likely file detection by using not only the name of the par2
files, but also what they are protecting. This should help a lot.

Update all uses of find_likely_files() to the new API.

Also, fix the filetype detectors so that they work, and move the duplicate
code to a new function.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Fix delete_list()
Ira W. Snyder [Wed, 27 Dec 2006 04:44:46 +0000 (20:44 -0800)]
[RARSLAVE] Fix delete_list()

Fixes the delete_list() function so that it looks in the corrent directory
for the files to delete.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Fix directory switching 2
Ira W. Snyder [Tue, 26 Dec 2006 19:54:13 +0000 (11:54 -0800)]
[RARSLAVE] Fix directory switching 2

Important bugfix. This resets the directory we are in after running the
command given to run_command(). This is the expected behavior, but was
overlooked.

None of the current code relies on this behavior, but it's good to act as
expected, anyway.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Enable production actions
Ira W. Snyder [Tue, 26 Dec 2006 19:42:01 +0000 (11:42 -0800)]
[RARSLAVE] Enable production actions

Remove all of the non-production testing actions, and enable all of the
real actions, including running commands, deleting files, etc.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Fix noextract extraction
Ira W. Snyder [Wed, 27 Dec 2006 04:25:15 +0000 (20:25 -0800)]
[RARSLAVE] Fix noextract extraction

This adds a fix to the noextract type of extraction (usually mv), which
will exit early (and successfully) if the same file is being moved between.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Fix working directory option
Ira W. Snyder [Wed, 27 Dec 2006 04:00:52 +0000 (20:00 -0800)]
[RARSLAVE] Fix working directory option

Add a check to make sure the working directory is valid before trying
anything, that way we don't fail later.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Add porcelain
Ira W. Snyder [Wed, 27 Dec 2006 03:49:49 +0000 (19:49 -0800)]
[RARSLAVE] Add porcelain

Add all of the user-level polish, such as the option parser, and all
related functions which are needed to implement its actions.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[CONFIG] Remove unneeded option
Ira W. Snyder [Wed, 27 Dec 2006 03:42:14 +0000 (19:42 -0800)]
[CONFIG] Remove unneeded option

Remove an unnecessary option from the RarslaveConfig class' default
options. Also, change the default loglevel to 0. (Fatal and Normal
messages only)

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Add debug logging messages
Ira W. Snyder [Tue, 26 Dec 2006 22:41:09 +0000 (14:41 -0800)]
[RARSLAVE] Add debug logging messages

Add a couple of debug-level messages.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[LOGGER] Change inner workings (again)
Ira W. Snyder [Tue, 26 Dec 2006 21:37:23 +0000 (13:37 -0800)]
[LOGGER] Change inner workings (again)

Change the inner workings of the RarslaveLogger class so that it has
four different message types: Fatal, Normal, Verbose, Debug. This also
adds the function printLoglevel() to the RarslaveLogger class. It will
print all messages at a certain loglevel.

Also update the unit tests so that they behave with the current workings of
the RarslaveLogger class.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Add logging messages
Ira W. Snyder [Tue, 26 Dec 2006 05:05:22 +0000 (21:05 -0800)]
[RARSLAVE] Add logging messages

Adds a lot of logging messages. Also audited (and added) many error return
values, as well as missing success paths.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Remove id requirement from RarslaveLogger
Ira W. Snyder [Tue, 26 Dec 2006 03:51:34 +0000 (19:51 -0800)]
[RARSLAVE] Remove id requirement from RarslaveLogger

Remove the id requirement from RarslaveLogger. This reduces the class'
utility, but makes it much easier to use in the existing rarslave
infrastructure.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Change RarslaveLogger operation
Ira W. Snyder [Mon, 25 Dec 2006 18:55:07 +0000 (10:55 -0800)]
[RARSLAVE] Change RarslaveLogger operation

Changes the RarslaveLogger class' method of operation to not require a
pre-generated id. Instead, it still requires an id, but keeps track of all
id's given to it.

This also removes the unit tests that tested the old behavior.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[CONFIG] Fix automatic absolutizing of directories
Ira W. Snyder [Wed, 27 Dec 2006 00:00:07 +0000 (16:00 -0800)]
[CONFIG] Fix automatic absolutizing of directories

Fix the automatic absolutizing of directories in the RarslaveConfig class.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[CONFIG] Automatically absolute-ize directories
Ira W. Snyder [Tue, 26 Dec 2006 23:52:57 +0000 (15:52 -0800)]
[CONFIG] Automatically absolute-ize directories

This patch makes the RarslaveConfig class automatically return the absolute
paths to directories, even though they are not stored in the config that
way.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Config-ify rarslave
Ira W. Snyder [Tue, 26 Dec 2006 23:42:10 +0000 (15:42 -0800)]
[RARSLAVE] Config-ify rarslave

Have rarslave rely on the RarslaveConfig class for all of its configuration
needs, such as options, regexes, etc.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[CONFIG] Update RarslaveConfig for rarslave2
Ira W. Snyder [Tue, 26 Dec 2006 23:28:28 +0000 (15:28 -0800)]
[CONFIG] Update RarslaveConfig for rarslave2

Updates the RarslaveConfig class for rarslave2, removing things that were
only needed in the original rarslave, and adding new things that we need.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[CONFIG] Add RarslaveConfig class
Ira W. Snyder [Tue, 26 Dec 2006 22:43:55 +0000 (14:43 -0800)]
[CONFIG] Add RarslaveConfig class

Add the RarslaveConfig class, which is almost entirely imported from the
original rarslave program.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Fix extraction
Ira W. Snyder [Tue, 26 Dec 2006 23:45:25 +0000 (15:45 -0800)]
[RARSLAVE] Fix extraction

Important bugfix. If the extraction directory is None, then we can safely
assume that we just don't want to do anything but a default extraction, not
outputting the files anywhere special.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Fix directory switching
Ira W. Snyder [Tue, 26 Dec 2006 19:49:48 +0000 (11:49 -0800)]
[RARSLAVE] Fix directory switching

Important bugfix. This fixes the directory switching code in the
run_command() function. Without this fix, the directory never gets switched
as expected.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Improve error handling
Ira W. Snyder [Mon, 25 Dec 2006 09:13:51 +0000 (01:13 -0800)]
[RARSLAVE] Improve error handling

Improve the error handling, mostly of the main operations that occur during
a program run (check, repair, join, extract, delete).

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Improve deletion
Ira W. Snyder [Mon, 25 Dec 2006 08:21:23 +0000 (00:21 -0800)]
[RARSLAVE] Improve deletion

Improve the deletion capabilities. This has initial support for deleting
interactively as well.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Add main program logic
Ira W. Snyder [Mon, 25 Dec 2006 04:56:05 +0000 (20:56 -0800)]
[RARSLAVE] Add main program logic

Add the main program logic to the PAR2Set class. This handles verifying,
repairing, joining, extraction, and deletion of the leftover files in the
PAR set.

This also converts over the main() code to use this function exclusively.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Add PAR2 Parser
Ira W. Snyder [Mon, 25 Dec 2006 01:45:56 +0000 (17:45 -0800)]
[RARSLAVE] Add PAR2 Parser

Add the class par2parser which parses PAR2 files to extract the list of
files which are "protected" by them.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Add PAR2Set class
Ira W. Snyder [Mon, 25 Dec 2006 01:39:24 +0000 (17:39 -0800)]
[RARSLAVE] Add PAR2Set class

Add the PAR2Set class, which is able to tell whether a parset is the same
as another set.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Add repairer
Ira W. Snyder [Sun, 24 Dec 2006 20:33:36 +0000 (12:33 -0800)]
[RARSLAVE] Add repairer

Add the class RarslaveRepairer which will repair / join par sets.

Also, change the no-extract heads to return the files that are protected by
the rar set, so that they can be mv'd later.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoMerge with add-logger
Ira W. Snyder [Sun, 24 Dec 2006 03:14:22 +0000 (19:14 -0800)]
Merge with add-logger

13 years ago[RARSLAVE] Add extraction class
Ira W. Snyder [Sun, 24 Dec 2006 03:08:11 +0000 (19:08 -0800)]
[RARSLAVE] Add extraction class

Adds the RarslaveExtractor class which handles extraction of all types of
set supported by rarslave.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years ago[RARSLAVE] Add logging class
Ira W. Snyder [Sun, 24 Dec 2006 03:04:21 +0000 (19:04 -0800)]
[RARSLAVE] Add logging class

This adds the RarslaveLogger class, used for logging of messages on a
per-set basis. It also adds the support class RarslaveMessage, which is
used within RarslaveLogger.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
13 years agoInitial work on extraction.
Ira W. Snyder [Sat, 16 Dec 2006 21:19:03 +0000 (13:19 -0800)]
Initial work on extraction.

13 years agoAdd type detection code.
Ira W. Snyder [Sat, 16 Dec 2006 07:22:34 +0000 (23:22 -0800)]
Add type detection code.

13 years agoInitial commit of the rarslave project.
Ira W. Snyder [Sat, 16 Dec 2006 05:17:23 +0000 (21:17 -0800)]
Initial commit of the rarslave project.