Thomas Waldmann
5d8801e72c
macOS: fix mtime timestamp extraction if ResourceFork xattr is present, fixes #7234
...
setting the timestamps after xattrs helps for correct mtime,
but atime is still broken in this case.
2023-01-06 21:58:35 +01:00
Thomas Waldmann
6a27c6b763
macOS: test correct timestamp extraction if ResourceFork xattr is present, see #7234
2023-01-06 21:58:33 +01:00
Franco Ayala
cd68f71d07
Fix query quota ( #7237 )
...
rinfo: added support for --iec
also: added a missing \n to the generated output
2022-12-31 21:11:23 +01:00
TW
ed6dcbebb1
Merge pull request #7233 from systemcrash/spfix
...
Docs and comments consistency and readability improvement
2022-12-30 15:13:17 +01:00
Paul D
8ada680c87
'Want' fixes
...
aka who are you to presume what I want?
2022-12-29 22:26:55 +00:00
Paul D
253d8e8d4e
Docs grammar fixes
...
joined split infinitives, and relocated adverbs appropriately.
2022-12-29 22:26:54 +00:00
Paul D
a85b643866
Docs grammar fixes.
...
One cannot "to not x", but one can "not to x".
Avoiding split infinitives gives the added bonus that machine
translation yields better results.
setup (n/adj) vs set(v) up. We don't "I setup it" but "I set it up".
Likewise for login(n/adj) and log(v) in, backup(n/adj) and back(v) up.
2022-12-29 00:01:48 +00:00
TW
f5d6a8d051
Merge pull request #7231 from ThomasWaldmann/list-or-progress
...
--list xor --progress
2022-12-29 00:39:53 +01:00
Thomas Waldmann
c461fa8d0b
do not use markup in simple error messages
2022-12-28 17:23:41 +01:00
Thomas Waldmann
bdc2dbfc08
disallow --list with --progress, fixes #7219
2022-12-28 17:23:04 +01:00
Thomas Waldmann
f27e61b2b0
fix --progress display description, fixes #7180
2022-12-28 16:54:46 +01:00
Franco Ayala
ab465a75d4
Adding used storage quota to borg info ( #7121 )
2022-12-24 01:55:47 +01:00
Rayyan Ansari
cf61e7d58a
testsuite: archiver: skip block device in test_transfer_upgrade
...
On MINGW, the S_IFBLK macro is incorrectly set as 0x3000 instead of 0x6000.
https://github.com/mingw-w64/mingw-w64/blob/v10.0.0/mingw-w64-headers/crt/sys/stat.h#L133
2022-12-18 14:05:24 +00:00
Rayyan Ansari
66a407ff9f
Use \n for the {NL} format specifier
...
\n is automatically converted on write to the platform-dependent os.linesep.
Using os.linesep instead of \n means that on Windows, the line ending becomes "\r\r\n".
Also switches mentions of {LF} to {NL} in code and docs.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
d32ae512a8
testsuite: archiver: change regex excludes in test_extract_include_exclude_regex_from_file
...
On Windows, the ":" character cannot be used in a filename.
Python does not error on this because the ":" character represents data streams.
See https://stackoverflow.com/a/54508979
2022-12-18 14:05:24 +00:00
Rayyan Ansari
2505118fff
testsuite: archiver: check if symlinks supported before test_create_read_special_broken_symlink
...
On Windows, symlinks can only be created by administrator accounts.
Using are_symlinks_supported() skips the test if the symlink cannot be created.
See https://docs.python.org/3/library/os.html#os.symlink
2022-12-18 14:05:24 +00:00
Rayyan Ansari
e97a966b46
testsuite: archiver: fix test_create_paths_from_command on Windows
...
On Windows, `echo` is a shell builtin and can only output one line at a time.
A batch file that outputs the filenames is instead used as the command.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
9e9b94615e
archiver: key_cmds: check if key path is a directory before opening
...
On Windows, Python raises PermissionError instead of IsADirectoryError (like on Unix) if the file to open is actually a directory.
See https://github.com/python/cpython/issues/87261
2022-12-18 14:05:24 +00:00
Rayyan Ansari
fff2c21e65
testsuite: archiver: skip test_file_status_cs_cache_mode on Windows
...
On Windows, the ctime attribute of stat represents the time of creation, unlike Unix.
See https://docs.python.org/3/library/os.html#os.stat_result.st_ctime
2022-12-18 14:05:24 +00:00
Rayyan Ansari
12245761c0
testsuite: archiver: diff_cmd: ignore modes
...
Windows does not have file modes.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
d8e8247c6d
testsuite: archiver: increase hashing test bytes
...
A lower value results in the hash running too fast and the time being rounded down to 0.0, resulting in the test failing.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
061397740c
testsuite: archiver: skip test_umask on Windows
...
Windows does not have file modes, so os.stat always returns 777.
2022-12-18 14:05:24 +00:00
Rayyan Ansari
208add518f
testsuite: archiver: skip test_unix_socket on Windows
...
Python on Windows does not support the AF_UNIX socket type yet.
https://github.com/python/cpython/issues/77589
2022-12-18 14:05:23 +00:00
Rayyan Ansari
2f9c7d98e5
testsuite: archiver: use os.linesep instead of hardcoded newline string
...
On Windows, a newline is \r\n instead of \n.
2022-12-18 14:05:15 +00:00
Rayyan Ansari
e65c6ac787
platform: windows: use root/0 as dummy user and id values
...
Windows does not have the uid/gid system.
2022-12-18 14:00:35 +00:00
Rayyan Ansari
5e8452a705
archiver: create_cmd: do not add preexec_fn on Windows
...
The preexec_fn argument of Popen is not supported on Windows.
2022-12-18 14:00:35 +00:00
Rayyan Ansari
1deeb0b17d
testsuite: archiver: do not try to create special devices on Windows
...
Windows does not support these file types in userspace programs.
2022-12-18 14:00:35 +00:00
Thomas Waldmann
8747644540
remove --save-space
...
this option did not change behaviour since longer,
we only had kept it for API compatibility.
as a borg2 repo server won't have old clients talking to it,
we can safely remove this everywhere now.
2022-12-17 16:48:54 +01:00
Thomas Waldmann
a475227e18
use archivename_validator everywhere
...
also: simplify, reuse code from text_validator.
2022-12-15 22:54:46 +01:00
TW
d0d21e7928
Merge pull request #7197 from ThomasWaldmann/valid-archive-names
...
text attributes: validate more strictly, fixes #2290
2022-12-15 19:24:17 +01:00
Thomas Waldmann
61e5115d1d
fix fso.stats updating
...
fso is None in dry_run mode.
2022-12-15 18:10:36 +01:00
Thomas Waldmann
19e25043b5
create: --list --dry-run output for directories, fixes #7209
...
Without the status being set no output was generated in
dry-run mode, confusing users about whether borg would back
up directories (in non-dry-run mode).
- == item not backed up just because of dry-run mode
x == item excluded
2022-12-15 17:37:51 +01:00
Thomas Waldmann
b9dc2be661
remove support for bpath placeholder
...
this needs to get done differently later, maybe base64 for json output.
2022-12-12 19:39:52 +01:00
Thomas Waldmann
1e2741ad3d
remove support for barchive placeholder
...
not needed any more as the archive name is now validated pure text.
2022-12-12 19:10:58 +01:00
Thomas Waldmann
1517db07ec
remove support for bcomment placeholder
...
not needed any more as the comment is now validated pure text.
2022-12-12 18:55:14 +01:00
Thomas Waldmann
4b54b5565e
use comment validator for cli args and borg transfer
2022-12-12 18:48:01 +01:00
Thomas Waldmann
99c6afbc61
add generic text and comment validator
2022-12-12 18:01:07 +01:00
Thomas Waldmann
ebff12ad41
transfer: validate archive names before transfer
2022-12-12 17:06:13 +01:00
Thomas Waldmann
fe2b2bc007
archive names: validate more strictly, fixes #2290
...
we want to be able to use an archive name as a directory name,
e.g. for the FUSE fs built by borg mount.
thus we can not allow "/" in an archive name on linux.
on windows, the rules are more restrictive, disallowing
quite some more characters (':<>"|*?' plus some more).
we do not have FUSE fs / borg mount on windows yet, but
we better avoid any issues.
we can not avoid ":" though, as our {now} placeholder
generates ISO-8601 timestamps, including ":" chars.
also, we do not want to have leading/trailing blanks in
archive names, neither surrogate-escapes.
control chars are disallowed also, including chr(0).
we have python str here, thus chr(0) is not expected in there
(is not used to terminate a string, like it is in C).
2022-12-12 17:05:01 +01:00
Thomas Waldmann
15139a80c9
bugfix: switch archive timestamps to utc
...
we use utc for file timestamps and manifest timestamp,
so let's use utc for archives also.
2022-12-04 10:55:20 +01:00
Thomas Waldmann
1f859c9f17
refactor: get archive timestamps via archive_ts_now()
2022-12-04 10:55:17 +01:00
Thomas Waldmann
6a82d01b35
tests for borg transfer --upgrader=From12To20
2022-12-04 09:07:48 +01:00
Thomas Waldmann
87e597011a
bugfix: file timestamps should use tz-aware utc datetime objs
...
the UNIX time used for timestamp is seconds since 1.1.1970,
in UTC. thus, the natural way to represent it is with a
tz-aware utc datetime object.
but previously (in borg 1.x), they used naive datetime
objects and localtime.
2022-12-04 09:07:29 +01:00
Thomas Waldmann
c343673ab5
bugfix: do no assume hardlink_master=True if not present, see #7175
...
this would produce unneeded item.hlid attributes
for fifos, char and block devices when transferring /
upgrading from faulty borg 1.x archives.
2022-11-28 23:57:59 +01:00
Thomas Waldmann
83576ae94c
fix crash in borg transfer, fixes #7156
2022-11-25 13:32:47 +01:00
Thomas Waldmann
ae0017d174
skip test_create_read_special_symlink on cygwin
...
test is broken on cygwin and hangs infinitely.
2022-11-22 18:16:18 +01:00
Thomas Waldmann
15c51ee3c6
fix test_recreate_basic on cygwin
...
looks like that chmod should only get done IF we are root (and on linux?).
taking away write permissions on windows/cygwin (and when running as normal
user) makes create_regular_file fail when it tries to create dir2/file3.
2022-11-22 18:16:15 +01:00
Thomas Waldmann
f088682bc9
ignore testsuite test for slow msgpack on cygwin
...
we don't want to have a failing test just because a
not compiled msgpack was used to run the tests.
2022-11-22 18:16:12 +01:00
Rayyan Ansari
4445fe3bdb
testsuite: repository: skip some tests for RemoteRepository
2022-11-15 19:14:33 +00:00
Rayyan Ansari
c209daec63
file_integrity.py: make sure file_fd is always closed on exit
2022-11-15 18:46:08 +00:00