12 Commits

Author SHA1 Message Date
Sybren A. Stüvel
b3fb7845c3 Cleanup: Reformat with black
No functional changes.
2023-11-02 14:40:27 +01:00
Sybren A. Stüvel
803c38dac1 Cleanup: reformat with Black 2021-07-22 10:14:43 +02:00
Sybren A. Stüvel
e4bf2e8e35 Improved path handling
This commit fixes a bunch of issues at the same time, as they are all
related to path handling:

- `pathlib.Path.resolve()` or `.absolute()` are replaced by
  `bpathlib.make_absolute()`. The latter does NOT follow symlinks and does
  NOT network mounts from a drive letter to UNC notation. This also has
  advantages on non-Windows sytems, as it allows BAT-packing a directory
  structure with symlinked files (such as a Shaman checkout).
- Better handling of drive letters, and of paths that cross drive
  boundaries.
- Better testing of Windows-specific cases when running the tests on
  Windows, and of POSIX-specific cases on other platforms.

Thanks to @wisaac for starting this patch in D6676.

Thanks to @jbakker for pointing out the drive letter issue. This fixes
T70655.
2020-03-17 17:15:19 +01:00
Sybren A. Stüvel
03fb4da583 Convert target path from Path to str & PurePath
The target path is just read as string from the CLI now, to allow more
complex targets (such as URLs) that don't directly map to a path.

The Packer subclass now handles the conversion from that string to a
`pathlib.PurePath`, and specific subclasses & transfer classes can convert
those to a `pathlib.Path` to perform actual filesystem operations when
necessary.
2019-02-26 16:35:08 +01:00
Sybren A. Stüvel
bf7d2b1e27 Added some more unit tests for BlendPath 2019-02-04 15:42:40 +01:00
Sybren A. Stüvel
d81fe590db BlendPath: don't use os.path.join() for slash notations
The BlendPath should just use forward slashes, and not be depending on the
current platform.
2019-01-02 15:14:50 +01:00
Sybren A. Stüvel
5635895d0c Attempt at making BAT work on Windows
All BlendPath instances will use forward slashes, and there should be
more use of PurePosixPath instead of Path.
2019-01-02 15:14:50 +01:00
Sybren A. Stüvel
e9ee5b69ec Disallow BlendPath(str) 2018-03-08 14:18:07 +01:00
Sybren A. Stüvel
71dd5bc11b Path rewriting when packing.
Doesn't work with sequences, nor with split dirname/basename fields.
2018-03-06 16:06:36 +01:00
Sybren A. Stüvel
92f91b42cf Added test case for Windows-style paths 2018-03-06 11:45:35 +01:00
Sybren A. Stüvel
6b9c0a3f95 Support slash notation for BlendPath
This mimicks the slash notation of pathlib.Path
2018-02-27 17:29:44 +01:00
Sybren A. Stüvel
15cd74cda4 Start of dependency tracer work. 2018-02-26 18:16:15 +01:00