From ca27f8587cbda40c695e7301a8aa7e6be5a355d2 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 12 Jun 2021 01:55:45 +0200 Subject: [PATCH] add cygpath support for volume src too --- README.md | 3 ++- copyparty/authsrv.py | 3 +++ scripts/test/smoketest.py | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8eb6e44a..a78d118e 100644 --- a/README.md +++ b/README.md @@ -301,7 +301,7 @@ note: * `e2tsr` is probably always overkill, since `e2ds`/`e2dsa` would pick up any file modifications and cause `e2ts` to reindex those * the rescan button in the admin panel has no effect unless the volume has `-e2ds` or higher -you can choose to only index filename/path/size/last-modified (and not the hash of the file contents) by setting `--no-hash` or the volume-flag `cnhash`, this has the following consequences: +you can choose to only index filename/path/size/last-modified (and not the hash of the file contents) by setting `--no-hash` or the volume-flag `cdhash`, this has the following consequences: * initial indexing is way faster, especially when the volume is on a networked disk * makes it impossible to [file-search](#file-search) * if someone uploads the same file contents, the upload will not be detected as a dupe, so it will not get symlinked or rejected @@ -319,6 +319,7 @@ this can instead be kept in a single place using the `--hist` argument, or the ` note: * markdown edits are always stored in a local `.hist` subdirectory * on windows the volflag path is cyglike, so `/c/temp` means `C:\temp` but use regular paths for `--hist` + * you can use cygpaths for volumes too, `-v C:\Users::r` and `-v /c/users::r` both work ## metadata from audio files diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 4755b9dc..69bfc3f9 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -439,6 +439,9 @@ class AuthSrv(object): raise Exception("invalid -v argument: [{}]".format(v_str)) src, dst, perms = m.groups() + if WINDOWS and src.startswith("/"): + src = "{}:\\{}".format(src[1], src[3:]) + # print("\n".join([src, dst, perms])) src = fsdec(os.path.abspath(fsenc(src))) dst = dst.strip("/") diff --git a/scripts/test/smoketest.py b/scripts/test/smoketest.py index d6dff9df..9a9ca500 100644 --- a/scripts/test/smoketest.py +++ b/scripts/test/smoketest.py @@ -44,14 +44,15 @@ class Cpp(object): def await_idle(self, ub, timeout): req = ["scanningFalse", "hash-q0", "tag-q0"] + lim = int(timeout * 10) u = ub + "?h" - for _ in range(timeout * 10): + for n in range(lim): try: time.sleep(0.1) r = requests.get(u, timeout=0.1) for x in req: if x not in r.text: - print("ST: miss " + x) + print("ST: {}/{} miss {}".format(n, lim, x)) raise Exception() print("ST: idle") return