Merge lp:~kevinoid/duplicity/windows-port into lp:duplicity/0.6
Status: | Rejected | ||||||||
---|---|---|---|---|---|---|---|---|---|
Rejected by: | Kenneth Loafman | ||||||||
Proposed branch: | lp:~kevinoid/duplicity/windows-port | ||||||||
Merge into: | lp:duplicity/0.6 | ||||||||
Diff against target: |
1552 lines (+668/-245) 18 files modified
dist/makedist (+58/-35) dist/setup.py (+9/-10) duplicity-bin (+96/-17) duplicity.1 (+5/-3) duplicity/GnuPGInterface.py (+215/-127) duplicity/backend.py (+14/-1) duplicity/backends/localbackend.py (+10/-1) duplicity/commandline.py (+14/-1) duplicity/compilec.py (+16/-3) duplicity/dup_temp.py (+9/-5) duplicity/globals.py (+48/-5) duplicity/manifest.py (+9/-3) duplicity/patchdir.py (+15/-0) duplicity/path.py (+102/-17) duplicity/selection.py (+21/-11) duplicity/tarfile.py (+6/-2) po/update-pot (+0/-4) po/update-pot.py (+21/-0) |
||||||||
To merge this branch: | bzr merge lp:~kevinoid/duplicity/windows-port | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
duplicity-team | Pending | ||
Review via email: mp+39287@code.launchpad.net |
Description of the change
This branch includes changes to support running Duplicity natively on Windows, as requested in bug 451582. I have done my best to separate out each change into logical units for commits and provide a detailed explanation and rationale for each change in the commit message.
The current work is only intended to port the main functionality of Duplicity and the local backend. The other backends have not been tested (and several, particularly ssh, are known not to work on Windows).
Most of the commits should not change any of the functionality of Duplicity. However, you may wish to take particular notice of revision 677 and 698 which do introduce functionality changes.
Note: Revision 682 added some portability improvements for the restart process and fixed bug 637556 in the process.
Unmerged revisions
- 703. By Kevin Locke <email address hidden>
-
Include updates to GnuPGInterface
These updates are from the current state of a branch of development that
I created to port GnuPGInterface to Windows, fix some bugs, and add
Python 3 support. The branch is available on github at
<http://github. com/kevinoid/ py-gnupg>. These changes are taken from
commit 91667c.I have assurances from the original author of GnuPGInterface that the
changes will be merged into his sources with minimal changes (if any)
once he has time and that it is safe to merge these changes into other
projects that need them without introducing a significant maintenance
burden.Note: This version of GnuPGInterface now uses subprocess rather than
"raw" fork/exec. The threaded waitpid was removed due to threading
issues with subprocess (particularly Issue 1731717). It should be
largely unnecessary as any zombie child processes are reaped when a new
subprocess is started. If the more immediate reaping is required, the
threaded wait can easily be re-added (and less-easily be made thread
safe with subprocess).Signed-off-by: Kevin Locke <email address hidden>
- 702. By Kevin Locke <email address hidden>
-
Unwrap temporary file instances
tempfile.
TemporaryFile returns an instance of a wrapper class on
non-POSIX, non-Cygwin systems. Yet the librsync code requires a
standard file object. On Windows, the wrapper is unnecessary since the
file is opened with O_TEMPORARY and is deleted automatically on close.
On other systems the wrapper may be necessary to delete a file, so we
error out (in a way that future developers on those systems should be
able to find and understand...).Note: This is a bit of a hack and relies on undocumented properties of
the object returned from tempfile.TemporaryFile. However, it avoids
the need to track and delete the temporary file ourselves.Signed-off-by: Kevin Locke <email address hidden>
- 701. By Kevin Locke <email address hidden>
-
Make the manifest format more interoperable
At the cost of losing a bit of information, use the POSIX path
and EOL convention as part of the file format for manifest files.
This way backups created on one platform can be restored on another with
a different path and/or EOL convention.To accomplish this, change the file mode to binary and convert native
paths to POSIX paths during manifest creation and back during load.Note: During load the drive specifier for the target directory (if
there is one) is added to the POSIX-converted path. This allows
restoring cross-platform files more easily at the cost of losing a
warning about restoring files to a different drive than the original
backup. If this is unacceptable, the drive could be the first component
of the POSIX path or the cross-platform interoperability could be
dropped.Signed-off-by: Kevin Locke <email address hidden>
- 700. By Kevin Locke <email address hidden>
-
Prevent Windows paths from being parsed as URLs
Windows paths which begin with a drive specifier are parsed as having a
scheme which is the drive letter. In order to avoid against these paths
being treated as URLs, check if the potential url_string looks like a
Windows path.Note: The regex is not perfect, since it is possible that the "c" URL
scheme would not require slashes after the protocol. So limit the
checks to Windows platforms where paths are more likely to have this
form.Signed-off-by: Kevin Locke <email address hidden>
- 699. By Kevin Locke <email address hidden>
-
Make file:// URL parsing more portable
Create path.from_url_path utility function which takes the path
component of a file URL and converts it into the native path
representation on the platform.Note: RFC 1738 specifies that anything after file:// before the next
slash is a hostname (and therefore, implicitly, all paths are absolute).
However, to maintain backwards compatibility, allow for relative paths
to be specified in this manner.Signed-off-by: Kevin Locke <email address hidden>
- 698. By Kevin Locke <email address hidden>
-
Ensure prefix ends with empty path component
WARNING: Functionality change
In order to prevent the given prefix from matching directories which
begin with the last component of prefix, ensure that prefix ends with an
empty path component (causing a tailing slash on POSIX systems).
Otherwise the prefix /foo/b would also include /foo/bar.Note: If this functionality really was intended, wherever prefix is
removed from a path, the result should not start with a directory
separator (since it would result in a "/" first element in the return
value from path.split_all).Signed-off-by: Kevin Locke <email address hidden>
- 697. By Kevin Locke <email address hidden>
-
Replace path manipulation based on "/"
Make use of path.split_all and os.path.join where paths were manipulated
based on "/"In selection, change path import to keep path namespace, but alias
path.Path to Path to minimize the diff. The bare uses of split_all
seemed unnecessarily confusing and the other members of path are not
used directly so there is no real need for the * import.Note: Removed unnecessary use of filter to remove blanks as this is
handled implicitly by os.path.split and therefore by path.split_all.Note2: Need to be careful that os.path.join must have at least 1
argument, while "/".join() could work on a 0-length array.Signed-off-by: Kevin Locke <email address hidden>
- 696. By Kevin Locke <email address hidden>
-
Create split_all utility function in path
This function is intended to replace the pathstr.split("/") idiom in
many places and provides a convenient way to break an arbitrary path
into its constituent components.Note: Although it would be possible to split on os.altsep and os.sep
and it would work in many cases, and run a bit faster, it doesn't handle
more complex path systems and is likely to fail in corner cases even in
less complex path systems.Signed-off-by: Kevin Locke <email address hidden>
- 695. By Kevin Locke <email address hidden>
-
Support systems without pwd and/or grp in tarfile
Inside tarfile this case is normally checked by the calling code, but
since uid2uname and gid2gname are called by Path without checking for
pwd and grp (and we want to support this case), remove the assertion
that these modules are defined. When they are not, throw KeyError
indicating the ID could not be mapped.Signed-off-by: Kevin Locke <email address hidden>
- 694. By Kevin Locke <email address hidden>
-
Support more path systems in glob->regex conversion
- Match against the system path separators, rather than "/"
- Update duplicity.1 man page to indicate that the metacharacters match
against the directory separator, rather than "/"Note: This won't be portable to systems with more complex path systems
(like VMS), but that case is not trivial so it is worth waiting for a
need to arise.Signed-off-by: Kevin Locke <email address hidden>
Rejecting for now. This needs to be reworked at this point to make it viable in the current codebase.