copyparty 1.16.4__py3-none-any.whl → 1.16.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- copyparty/__init__.py +3 -0
- copyparty/__main__.py +6 -3
- copyparty/__version__.py +2 -2
- copyparty/authsrv.py +31 -18
- copyparty/fsutil.py +4 -4
- copyparty/httpcli.py +220 -79
- copyparty/httpsrv.py +6 -5
- copyparty/mtag.py +4 -4
- copyparty/smbd.py +1 -1
- copyparty/sutil.py +1 -1
- copyparty/tcpsrv.py +6 -6
- copyparty/tftpd.py +1 -1
- copyparty/th_cli.py +3 -3
- copyparty/th_srv.py +6 -6
- copyparty/u2idx.py +3 -3
- copyparty/up2k.py +91 -86
- copyparty/util.py +13 -13
- copyparty/web/deps/marked.js.gz +0 -0
- copyparty/web/rups.css.gz +0 -0
- copyparty/web/rups.html +67 -0
- copyparty/web/rups.js.gz +0 -0
- copyparty/web/shares.css.gz +0 -0
- copyparty/web/shares.html +2 -0
- copyparty/web/splash.html +1 -0
- copyparty/web/splash.js.gz +0 -0
- copyparty/web/svcs.html +0 -2
- copyparty/web/up2k.js.gz +0 -0
- copyparty/web/util.js.gz +0 -0
- {copyparty-1.16.4.dist-info → copyparty-1.16.6.dist-info}/METADATA +20 -3
- {copyparty-1.16.4.dist-info → copyparty-1.16.6.dist-info}/RECORD +34 -31
- {copyparty-1.16.4.dist-info → copyparty-1.16.6.dist-info}/LICENSE +0 -0
- {copyparty-1.16.4.dist-info → copyparty-1.16.6.dist-info}/WHEEL +0 -0
- {copyparty-1.16.4.dist-info → copyparty-1.16.6.dist-info}/entry_points.txt +0 -0
- {copyparty-1.16.4.dist-info → copyparty-1.16.6.dist-info}/top_level.txt +0 -0
copyparty/up2k.py
CHANGED
@@ -789,7 +789,7 @@ class Up2k(object):
|
|
789
789
|
if ccd != cd:
|
790
790
|
continue
|
791
791
|
|
792
|
-
self.log("xiu:
|
792
|
+
self.log("xiu: %d# %r" % (len(wrfs), cmd))
|
793
793
|
runihook(self.log, cmd, vol, ups)
|
794
794
|
|
795
795
|
def _vis_job_progress(self, job ) :
|
@@ -1053,7 +1053,7 @@ class Up2k(object):
|
|
1053
1053
|
"""mutex(main,reg) me"""
|
1054
1054
|
histpath = self.vfs.histtab.get(ptop)
|
1055
1055
|
if not histpath:
|
1056
|
-
self.log("no histpath for
|
1056
|
+
self.log("no histpath for %r" % (ptop,))
|
1057
1057
|
return None
|
1058
1058
|
|
1059
1059
|
db_path = os.path.join(histpath, "up2k.db")
|
@@ -1147,7 +1147,7 @@ class Up2k(object):
|
|
1147
1147
|
job["poke"] = time.time()
|
1148
1148
|
job["busy"] = {}
|
1149
1149
|
else:
|
1150
|
-
self.log("ign deleted file in snap:
|
1150
|
+
self.log("ign deleted file in snap: %r" % (fp,))
|
1151
1151
|
if not n4g:
|
1152
1152
|
rm.append(k)
|
1153
1153
|
continue
|
@@ -1378,12 +1378,12 @@ class Up2k(object):
|
|
1378
1378
|
xvol ,
|
1379
1379
|
) :
|
1380
1380
|
if xvol and not rcdir.startswith(top):
|
1381
|
-
self.log("skip xvol:
|
1381
|
+
self.log("skip xvol: %r -> %r" % (cdir, rcdir), 6)
|
1382
1382
|
return 0, 0, 0
|
1383
1383
|
|
1384
1384
|
if rcdir in seen:
|
1385
|
-
t = "bailing from symlink loop,\n prev:
|
1386
|
-
self.log(t
|
1385
|
+
t = "bailing from symlink loop,\n prev: %r\n curr: %r\n from: %r"
|
1386
|
+
self.log(t % (seen[-1], rcdir, cdir), 3)
|
1387
1387
|
return 0, 0, 0
|
1388
1388
|
|
1389
1389
|
# total-files-added, total-num-files, recursive-size
|
@@ -1438,7 +1438,7 @@ class Up2k(object):
|
|
1438
1438
|
and inf.st_dev != dev
|
1439
1439
|
and not (ANYWIN and bos.stat(rap).st_dev == dev)
|
1440
1440
|
):
|
1441
|
-
self.log("skip xdev
|
1441
|
+
self.log("skip xdev %s->%s: %r" % (dev, inf.st_dev, abspath), 6)
|
1442
1442
|
continue
|
1443
1443
|
if abspath in excl or rap in excl:
|
1444
1444
|
unreg.append(rp)
|
@@ -1467,10 +1467,10 @@ class Up2k(object):
|
|
1467
1467
|
tnf += i2
|
1468
1468
|
rsz += i3
|
1469
1469
|
except:
|
1470
|
-
t = "failed to index subdir
|
1471
|
-
self.log(t
|
1470
|
+
t = "failed to index subdir %r:\n%s"
|
1471
|
+
self.log(t % (abspath, min_ex()), 1)
|
1472
1472
|
elif not stat.S_ISREG(inf.st_mode):
|
1473
|
-
self.log("skip type-0%o file
|
1473
|
+
self.log("skip type-0%o file %r" % (inf.st_mode, abspath))
|
1474
1474
|
else:
|
1475
1475
|
# self.log("file: {}".format(abspath))
|
1476
1476
|
if rp.endswith(".PARTIAL") and time.time() - lmod < 60:
|
@@ -1553,7 +1553,7 @@ class Up2k(object):
|
|
1553
1553
|
db.c.execute("insert into cv values (?,?,?)", (crd, cdn, cv))
|
1554
1554
|
db.n += 1
|
1555
1555
|
except Exception as ex:
|
1556
|
-
self.log("cover
|
1556
|
+
self.log("cover %r/%r failed: %s" % (rd, cv, ex), 6)
|
1557
1557
|
|
1558
1558
|
seen_files = set([x[2] for x in files]) # for dropcheck
|
1559
1559
|
for sz, lmod, fn in files:
|
@@ -1575,9 +1575,9 @@ class Up2k(object):
|
|
1575
1575
|
self.pp.n -= 1
|
1576
1576
|
dw, dts, dsz, ip, at = in_db[0]
|
1577
1577
|
if len(in_db) > 1:
|
1578
|
-
t = "WARN: multiple entries:
|
1578
|
+
t = "WARN: multiple entries: %r => %r |%d|\n%r"
|
1579
1579
|
rep_db = "\n".join([repr(x) for x in in_db])
|
1580
|
-
self.log(t
|
1580
|
+
self.log(t % (top, rp, len(in_db), rep_db))
|
1581
1581
|
dts = -1
|
1582
1582
|
|
1583
1583
|
if fat32 and abs(dts - lmod) == 1:
|
@@ -1586,10 +1586,8 @@ class Up2k(object):
|
|
1586
1586
|
if dts == lmod and dsz == sz and (nohash or dw[0] != "#" or not sz):
|
1587
1587
|
continue
|
1588
1588
|
|
1589
|
-
t = "reindex
|
1590
|
-
|
1591
|
-
)
|
1592
|
-
self.log(t)
|
1589
|
+
t = "reindex %r => %r mtime(%s/%s) size(%s/%s)"
|
1590
|
+
self.log(t % (top, rp, dts, lmod, dsz, sz))
|
1593
1591
|
self.db_rm(db.c, rd, fn, 0)
|
1594
1592
|
tfa += 1
|
1595
1593
|
db.n += 1
|
@@ -1605,14 +1603,14 @@ class Up2k(object):
|
|
1605
1603
|
wark = up2k_wark_from_metadata(self.salt, sz, lmod, rd, fn)
|
1606
1604
|
else:
|
1607
1605
|
if sz > 1024 * 1024:
|
1608
|
-
self.log("file:
|
1606
|
+
self.log("file: %r" % (abspath,))
|
1609
1607
|
|
1610
1608
|
try:
|
1611
1609
|
hashes, _ = self._hashlist_from_file(
|
1612
1610
|
abspath, "a{}, ".format(self.pp.n)
|
1613
1611
|
)
|
1614
1612
|
except Exception as ex:
|
1615
|
-
self.log("hash:
|
1613
|
+
self.log("hash: %r @ %r" % (ex, abspath))
|
1616
1614
|
continue
|
1617
1615
|
|
1618
1616
|
if not hashes:
|
@@ -1657,8 +1655,8 @@ class Up2k(object):
|
|
1657
1655
|
|
1658
1656
|
|
1659
1657
|
if n:
|
1660
|
-
t = "forgetting
|
1661
|
-
self.log(t
|
1658
|
+
t = "forgetting %d shadowed autoindexed files in %r > %r"
|
1659
|
+
self.log(t % (n, top, sh_rd))
|
1662
1660
|
|
1663
1661
|
q = "delete from dh where (d = ? or d like ?||'/%')"
|
1664
1662
|
db.c.execute(q, erd_erd)
|
@@ -1855,7 +1853,7 @@ class Up2k(object):
|
|
1855
1853
|
stl = bos.lstat(abspath)
|
1856
1854
|
st = bos.stat(abspath) if stat.S_ISLNK(stl.st_mode) else stl
|
1857
1855
|
except Exception as ex:
|
1858
|
-
self.log("missing file: %
|
1856
|
+
self.log("missing file: %r" % (abspath,), 3)
|
1859
1857
|
f404.append((drd, dfn, w))
|
1860
1858
|
continue
|
1861
1859
|
|
@@ -1866,12 +1864,12 @@ class Up2k(object):
|
|
1866
1864
|
w2 = up2k_wark_from_metadata(self.salt, sz2, mt2, rd, fn)
|
1867
1865
|
else:
|
1868
1866
|
if sz2 > 1024 * 1024 * 32:
|
1869
|
-
self.log("file:
|
1867
|
+
self.log("file: %r" % (abspath,))
|
1870
1868
|
|
1871
1869
|
try:
|
1872
1870
|
hashes, _ = self._hashlist_from_file(abspath, pf)
|
1873
1871
|
except Exception as ex:
|
1874
|
-
self.log("hash:
|
1872
|
+
self.log("hash: %r @ %r" % (ex, abspath))
|
1875
1873
|
continue
|
1876
1874
|
|
1877
1875
|
if not hashes:
|
@@ -1891,9 +1889,8 @@ class Up2k(object):
|
|
1891
1889
|
|
1892
1890
|
rewark.append((drd, dfn, w2, sz2, mt2))
|
1893
1891
|
|
1894
|
-
t = "hash mismatch:
|
1895
|
-
t
|
1896
|
-
self.log(t, 1)
|
1892
|
+
t = "hash mismatch: %r\n db: %s (%d byte, %d)\n fs: %s (%d byte, %d)"
|
1893
|
+
self.log(t % (abspath, w, sz, mt, w2, sz2, mt2), 1)
|
1897
1894
|
|
1898
1895
|
if e2vp and (rewark or f404):
|
1899
1896
|
self.hub.retcode = 1
|
@@ -2440,7 +2437,7 @@ class Up2k(object):
|
|
2440
2437
|
q.task_done()
|
2441
2438
|
|
2442
2439
|
def _log_tag_err(self, parser , abspath , ex ) :
|
2443
|
-
msg = "
|
2440
|
+
msg = "%s failed to read tags from %r:\n%s" % (parser, abspath, ex)
|
2444
2441
|
self.log(msg.lstrip(), c=1 if "<Signals.SIG" in msg else 3)
|
2445
2442
|
|
2446
2443
|
def _tagscan_file(
|
@@ -2976,11 +2973,11 @@ class Up2k(object):
|
|
2976
2973
|
job = rj
|
2977
2974
|
break
|
2978
2975
|
else:
|
2979
|
-
self.log("asserting contents of %
|
2976
|
+
self.log("asserting contents of %r" % (orig_ap,))
|
2980
2977
|
hashes2, st = self._hashlist_from_file(orig_ap)
|
2981
2978
|
wark2 = up2k_wark_from_hashlist(self.salt, st.st_size, hashes2)
|
2982
2979
|
if dwark != wark2:
|
2983
|
-
t = "will not dedup (fs index desync): fs=%s, db=%s, file: %
|
2980
|
+
t = "will not dedup (fs index desync): fs=%s, db=%s, file: %r\n%s"
|
2984
2981
|
self.log(t % (wark2, dwark, orig_ap, rj))
|
2985
2982
|
lost.append(dupe[3:])
|
2986
2983
|
continue
|
@@ -2998,8 +2995,8 @@ class Up2k(object):
|
|
2998
2995
|
if lost:
|
2999
2996
|
c2 = None
|
3000
2997
|
for cur, dp_dir, dp_fn in lost:
|
3001
|
-
t = "forgetting desynced db entry:
|
3002
|
-
self.log(t
|
2998
|
+
t = "forgetting desynced db entry: %r"
|
2999
|
+
self.log(t % ("/" + vjoin(vjoin(vfs.vpath, dp_dir), dp_fn)))
|
3003
3000
|
self.db_rm(cur, dp_dir, dp_fn, cj["size"])
|
3004
3001
|
if c2 and c2 != cur:
|
3005
3002
|
c2.connection.commit()
|
@@ -3027,8 +3024,8 @@ class Up2k(object):
|
|
3027
3024
|
except:
|
3028
3025
|
# missing; restart
|
3029
3026
|
if not self.args.nw and not n4g:
|
3030
|
-
t = "forgetting deleted partial upload at
|
3031
|
-
self.log(t
|
3027
|
+
t = "forgetting deleted partial upload at %r"
|
3028
|
+
self.log(t % (path,))
|
3032
3029
|
del reg[wark]
|
3033
3030
|
break
|
3034
3031
|
|
@@ -3039,19 +3036,25 @@ class Up2k(object):
|
|
3039
3036
|
pass
|
3040
3037
|
|
3041
3038
|
elif st.st_size != rj["size"]:
|
3042
|
-
t = "will not dedup (fs index desync):
|
3043
|
-
t = t
|
3044
|
-
wark,
|
3039
|
+
t = "will not dedup (fs index desync): %s, size fs=%d db=%d, mtime fs=%d db=%d, file: %r\n%s"
|
3040
|
+
t = t % (
|
3041
|
+
wark,
|
3042
|
+
st.st_size,
|
3043
|
+
rj["size"],
|
3044
|
+
st.st_mtime,
|
3045
|
+
rj["lmod"],
|
3046
|
+
path,
|
3047
|
+
rj,
|
3045
3048
|
)
|
3046
3049
|
self.log(t)
|
3047
3050
|
del reg[wark]
|
3048
3051
|
|
3049
3052
|
elif inc_ap != orig_ap and not data_ok and "done" in reg[wark]:
|
3050
|
-
self.log("asserting contents of %
|
3053
|
+
self.log("asserting contents of %r" % (orig_ap,))
|
3051
3054
|
hashes2, _ = self._hashlist_from_file(orig_ap)
|
3052
3055
|
wark2 = up2k_wark_from_hashlist(self.salt, st.st_size, hashes2)
|
3053
3056
|
if wark != wark2:
|
3054
|
-
t = "will not dedup (fs index desync): fs=%s, idx=%s, file: %
|
3057
|
+
t = "will not dedup (fs index desync): fs=%s, idx=%s, file: %r\n%s"
|
3055
3058
|
self.log(t % (wark2, wark, orig_ap, rj))
|
3056
3059
|
del reg[wark]
|
3057
3060
|
|
@@ -3068,7 +3071,7 @@ class Up2k(object):
|
|
3068
3071
|
vsrc = djoin(job["vtop"], job["prel"], job["name"])
|
3069
3072
|
vsrc = vsrc.replace("\\", "/") # just for prints anyways
|
3070
3073
|
if "done" not in job:
|
3071
|
-
self.log("unfinished:\n
|
3074
|
+
self.log("unfinished:\n %r\n %r" % (src, dst))
|
3072
3075
|
err = "partial upload exists at a different location; please resume uploading here instead:\n"
|
3073
3076
|
err += "/" + quotep(vsrc) + " "
|
3074
3077
|
|
@@ -3085,7 +3088,7 @@ class Up2k(object):
|
|
3085
3088
|
raise Pebkac(422, err)
|
3086
3089
|
|
3087
3090
|
elif "nodupe" in vfs.flags:
|
3088
|
-
self.log("dupe-reject:\n
|
3091
|
+
self.log("dupe-reject:\n %r\n %r" % (src, dst))
|
3089
3092
|
err = "upload rejected, file already exists:\n"
|
3090
3093
|
err += "/" + quotep(vsrc) + " "
|
3091
3094
|
raise Pebkac(409, err)
|
@@ -3147,7 +3150,7 @@ class Up2k(object):
|
|
3147
3150
|
"",
|
3148
3151
|
)
|
3149
3152
|
if not hr:
|
3150
|
-
t = "upload blocked by xbu server config: %
|
3153
|
+
t = "upload blocked by xbu server config: %r" % (dst,)
|
3151
3154
|
self.log(t, 1)
|
3152
3155
|
raise Pebkac(403, t)
|
3153
3156
|
if hr.get("reloc"):
|
@@ -3288,7 +3291,7 @@ class Up2k(object):
|
|
3288
3291
|
times = (int(time.time()), int(cj["lmod"]))
|
3289
3292
|
bos.utime(ap, times, False)
|
3290
3293
|
|
3291
|
-
self.log("touched %
|
3294
|
+
self.log("touched %r from %d to %d" % (ap, job["lmod"], cj["lmod"]))
|
3292
3295
|
except Exception as ex:
|
3293
3296
|
self.log("umod failed, %r" % (ex,), 3)
|
3294
3297
|
|
@@ -3303,7 +3306,7 @@ class Up2k(object):
|
|
3303
3306
|
|
3304
3307
|
fp = djoin(fdir, fname)
|
3305
3308
|
if job.get("replace") and bos.path.exists(fp):
|
3306
|
-
self.log("replacing existing file at
|
3309
|
+
self.log("replacing existing file at %r" % (fp,))
|
3307
3310
|
cur = None
|
3308
3311
|
ptop = job["ptop"]
|
3309
3312
|
vf = self.flags.get(ptop) or {}
|
@@ -3346,9 +3349,9 @@ class Up2k(object):
|
|
3346
3349
|
raise Exception(t % (src, fsrc, dst))
|
3347
3350
|
|
3348
3351
|
if verbose:
|
3349
|
-
t = "linking dupe:\n point-to: {0}\n link-loc: {1}"
|
3352
|
+
t = "linking dupe:\n point-to: {0!r}\n link-loc: {1!r}"
|
3350
3353
|
if fsrc:
|
3351
|
-
t += "\n data-src: {2}"
|
3354
|
+
t += "\n data-src: {2!r}"
|
3352
3355
|
self.log(t.format(src, dst, fsrc))
|
3353
3356
|
|
3354
3357
|
if self.args.nw:
|
@@ -3418,7 +3421,7 @@ class Up2k(object):
|
|
3418
3421
|
elif fsrc and bos.path.isfile(fsrc):
|
3419
3422
|
csrc = fsrc
|
3420
3423
|
else:
|
3421
|
-
t = "BUG: no valid sources to link from! orig(%
|
3424
|
+
t = "BUG: no valid sources to link from! orig(%r) fsrc(%r) link(%r)"
|
3422
3425
|
self.log(t, 1)
|
3423
3426
|
raise Exception(t % (src, fsrc, dst))
|
3424
3427
|
shutil.copy2(fsenc(csrc), fsenc(dst))
|
@@ -3595,15 +3598,12 @@ class Up2k(object):
|
|
3595
3598
|
atomic_move(self.log, src, dst, vflags)
|
3596
3599
|
|
3597
3600
|
times = (int(time.time()), int(job["lmod"]))
|
3598
|
-
|
3599
|
-
|
3600
|
-
times, bos.path.getsize(dst), dst
|
3601
|
-
)
|
3602
|
-
)
|
3601
|
+
t = "no more chunks, setting times %s (%d) on %r"
|
3602
|
+
self.log(t % (times, bos.path.getsize(dst), dst))
|
3603
3603
|
try:
|
3604
3604
|
bos.utime(dst, times)
|
3605
3605
|
except:
|
3606
|
-
self.log("failed to utime (
|
3606
|
+
self.log("failed to utime (%r, %s)" % (dst, times))
|
3607
3607
|
|
3608
3608
|
zs = "prel name lmod size ptop vtop wark dwrk host user addr"
|
3609
3609
|
z2 = [job[x] for x in zs.split()]
|
@@ -3916,7 +3916,7 @@ class Up2k(object):
|
|
3916
3916
|
if jrem == rem:
|
3917
3917
|
if job["ptop"] != ptop:
|
3918
3918
|
t = "job.ptop [%s] != vol.ptop [%s] ??"
|
3919
|
-
raise Exception(t % (job["ptop"]
|
3919
|
+
raise Exception(t % (job["ptop"], ptop))
|
3920
3920
|
partial = vn.canonical(vjoin(job["prel"], job["tnam"]))
|
3921
3921
|
break
|
3922
3922
|
if partial:
|
@@ -3956,7 +3956,7 @@ class Up2k(object):
|
|
3956
3956
|
if is_dir:
|
3957
3957
|
# note: deletion inside shares would require a rewrite here;
|
3958
3958
|
# shares necessitate get_dbv which is incompatible with walk
|
3959
|
-
g = vn0.walk("", rem0, [], uname, permsets,
|
3959
|
+
g = vn0.walk("", rem0, [], uname, permsets, 2, scandir, True)
|
3960
3960
|
if unpost:
|
3961
3961
|
raise Pebkac(400, "cannot unpost folders")
|
3962
3962
|
elif stat.S_ISLNK(st.st_mode) or stat.S_ISREG(st.st_mode):
|
@@ -3964,7 +3964,7 @@ class Up2k(object):
|
|
3964
3964
|
vpath_dir = vsplit(vpath)[0]
|
3965
3965
|
g = [(vn, voldir, vpath_dir, adir, [(fn, 0)], [], {})] # type: ignore
|
3966
3966
|
else:
|
3967
|
-
self.log("rm: skip type-0%o file
|
3967
|
+
self.log("rm: skip type-0%o file %r" % (st.st_mode, atop))
|
3968
3968
|
return 0, [], []
|
3969
3969
|
|
3970
3970
|
xbd = vn.flags.get("xbd")
|
@@ -3988,7 +3988,7 @@ class Up2k(object):
|
|
3988
3988
|
|
3989
3989
|
volpath = ("%s/%s" % (vrem, fn)).strip("/")
|
3990
3990
|
vpath = ("%s/%s" % (dbv.vpath, volpath)).strip("/")
|
3991
|
-
self.log("rm %
|
3991
|
+
self.log("rm %r\n %r" % (vpath, abspath))
|
3992
3992
|
if not unpost:
|
3993
3993
|
# recursion-only sanchk
|
3994
3994
|
_ = dbv.get(volpath, uname, *permsets[0])
|
@@ -4011,8 +4011,8 @@ class Up2k(object):
|
|
4011
4011
|
time.time(),
|
4012
4012
|
"",
|
4013
4013
|
):
|
4014
|
-
t = "delete blocked by xbd server config:
|
4015
|
-
self.log(t
|
4014
|
+
t = "delete blocked by xbd server config: %r"
|
4015
|
+
self.log(t % (abspath,), 1)
|
4016
4016
|
continue
|
4017
4017
|
|
4018
4018
|
n_files += 1
|
@@ -4069,6 +4069,7 @@ class Up2k(object):
|
|
4069
4069
|
raise Pebkac(400, "cp: cannot copy parent into subfolder")
|
4070
4070
|
|
4071
4071
|
svn, srem = self.vfs.get(svp, uname, True, False)
|
4072
|
+
dvn, drem = self.vfs.get(dvp, uname, False, True)
|
4072
4073
|
svn_dbv, _ = svn.get_dbv(srem)
|
4073
4074
|
sabs = svn.canonical(srem, False)
|
4074
4075
|
curs = set()
|
@@ -4091,8 +4092,12 @@ class Up2k(object):
|
|
4091
4092
|
permsets = [[True, False]]
|
4092
4093
|
scandir = not self.args.no_scandir
|
4093
4094
|
|
4095
|
+
# if user can see dotfiles in target volume, only include
|
4096
|
+
# dots from source vols where user also has the dot perm
|
4097
|
+
dots = 1 if uname in dvn.axs.udot else 2
|
4098
|
+
|
4094
4099
|
# don't use svn_dbv; would skip subvols due to _ls `if not rem:`
|
4095
|
-
g = svn.walk("", srem, [], uname, permsets,
|
4100
|
+
g = svn.walk("", srem, [], uname, permsets, dots, scandir, True)
|
4096
4101
|
with self.mutex:
|
4097
4102
|
try:
|
4098
4103
|
for dbv, vrem, _, atop, files, rd, vd in g:
|
@@ -4101,7 +4106,7 @@ class Up2k(object):
|
|
4101
4106
|
svpf = "/".join(x for x in [dbv.vpath, vrem, fn[0]] if x)
|
4102
4107
|
if not svpf.startswith(svp + "/"): # assert
|
4103
4108
|
self.log(min_ex(), 1)
|
4104
|
-
t = "cp: bug at %
|
4109
|
+
t = "cp: bug at %r, top %r%s"
|
4105
4110
|
raise Pebkac(500, t % (svpf, svp, SEESLOG))
|
4106
4111
|
|
4107
4112
|
dvpf = dvp + svpf[len(svp) :]
|
@@ -4141,7 +4146,7 @@ class Up2k(object):
|
|
4141
4146
|
except:
|
4142
4147
|
pass # broken symlink; keep as-is
|
4143
4148
|
elif not stat.S_ISREG(st.st_mode):
|
4144
|
-
self.log("skipping type-0%o file
|
4149
|
+
self.log("skipping type-0%o file %r" % (st.st_mode, sabs))
|
4145
4150
|
return ""
|
4146
4151
|
else:
|
4147
4152
|
is_link = False
|
@@ -4169,7 +4174,7 @@ class Up2k(object):
|
|
4169
4174
|
time.time(),
|
4170
4175
|
"",
|
4171
4176
|
):
|
4172
|
-
t = "copy blocked by xbr server config:
|
4177
|
+
t = "copy blocked by xbr server config: %r" % (svp,)
|
4173
4178
|
self.log(t, 1)
|
4174
4179
|
raise Pebkac(405, t)
|
4175
4180
|
|
@@ -4205,7 +4210,7 @@ class Up2k(object):
|
|
4205
4210
|
)
|
4206
4211
|
curs.add(c2)
|
4207
4212
|
else:
|
4208
|
-
self.log("not found in src db:
|
4213
|
+
self.log("not found in src db: %r" % (svp,))
|
4209
4214
|
|
4210
4215
|
try:
|
4211
4216
|
if is_link and st != stl:
|
@@ -4222,7 +4227,7 @@ class Up2k(object):
|
|
4222
4227
|
if ex.errno != errno.EXDEV:
|
4223
4228
|
raise
|
4224
4229
|
|
4225
|
-
self.log("using plain copy (%s):\n %
|
4230
|
+
self.log("using plain copy (%s):\n %r\n %r" % (ex.strerror, sabs, dabs))
|
4226
4231
|
b1, b2 = fsenc(sabs), fsenc(dabs)
|
4227
4232
|
is_link = os.path.islink(b1) # due to _relink
|
4228
4233
|
try:
|
@@ -4303,13 +4308,13 @@ class Up2k(object):
|
|
4303
4308
|
scandir = not self.args.no_scandir
|
4304
4309
|
|
4305
4310
|
# following symlinks is too scary
|
4306
|
-
g = svn.walk("", srem, [], uname, permsets,
|
4311
|
+
g = svn.walk("", srem, [], uname, permsets, 2, scandir, True)
|
4307
4312
|
for dbv, vrem, _, atop, files, rd, vd in g:
|
4308
4313
|
if dbv != jail:
|
4309
4314
|
# fail early (prevent partial moves)
|
4310
4315
|
raise Pebkac(400, "mv: source folder contains other volumes")
|
4311
4316
|
|
4312
|
-
g = svn.walk("", srem, [], uname, permsets,
|
4317
|
+
g = svn.walk("", srem, [], uname, permsets, 2, scandir, True)
|
4313
4318
|
with self.mutex:
|
4314
4319
|
try:
|
4315
4320
|
for dbv, vrem, _, atop, files, rd, vd in g:
|
@@ -4322,7 +4327,7 @@ class Up2k(object):
|
|
4322
4327
|
svpf = "/".join(x for x in [dbv.vpath, vrem, fn[0]] if x)
|
4323
4328
|
if not svpf.startswith(svp + "/"): # assert
|
4324
4329
|
self.log(min_ex(), 1)
|
4325
|
-
t = "mv: bug at %
|
4330
|
+
t = "mv: bug at %r, top %r%s"
|
4326
4331
|
raise Pebkac(500, t % (svpf, svp, SEESLOG))
|
4327
4332
|
|
4328
4333
|
dvpf = dvp + svpf[len(svp) :]
|
@@ -4341,7 +4346,7 @@ class Up2k(object):
|
|
4341
4346
|
for ap in reversed(zsl):
|
4342
4347
|
if not ap.startswith(sabs):
|
4343
4348
|
self.log(min_ex(), 1)
|
4344
|
-
t = "mv_d: bug at %
|
4349
|
+
t = "mv_d: bug at %r, top %r%s"
|
4345
4350
|
raise Pebkac(500, t % (ap, sabs, SEESLOG))
|
4346
4351
|
|
4347
4352
|
rem = ap[len(sabs) :].replace(os.sep, "/").lstrip("/")
|
@@ -4412,7 +4417,7 @@ class Up2k(object):
|
|
4412
4417
|
time.time(),
|
4413
4418
|
"",
|
4414
4419
|
):
|
4415
|
-
t = "move blocked by xbr server config:
|
4420
|
+
t = "move blocked by xbr server config: %r" % (svp,)
|
4416
4421
|
self.log(t, 1)
|
4417
4422
|
raise Pebkac(405, t)
|
4418
4423
|
|
@@ -4422,8 +4427,8 @@ class Up2k(object):
|
|
4422
4427
|
|
4423
4428
|
if is_dirlink:
|
4424
4429
|
dlabs = absreal(sabs)
|
4425
|
-
t = "moving symlink from
|
4426
|
-
self.log(t
|
4430
|
+
t = "moving symlink from %r to %r, target %r"
|
4431
|
+
self.log(t % (sabs, dabs, dlabs))
|
4427
4432
|
mt = bos.path.getmtime(sabs, False)
|
4428
4433
|
wunlink(self.log, sabs, svn.flags)
|
4429
4434
|
self._symlink(dlabs, dabs, dvn.flags, False, lmod=mt)
|
@@ -4494,7 +4499,7 @@ class Up2k(object):
|
|
4494
4499
|
)
|
4495
4500
|
curs.add(c2)
|
4496
4501
|
else:
|
4497
|
-
self.log("not found in src db:
|
4502
|
+
self.log("not found in src db: %r" % (svp,))
|
4498
4503
|
|
4499
4504
|
try:
|
4500
4505
|
if is_xvol and has_dupes:
|
@@ -4515,7 +4520,7 @@ class Up2k(object):
|
|
4515
4520
|
if ex.errno != errno.EXDEV:
|
4516
4521
|
raise
|
4517
4522
|
|
4518
|
-
self.log("using copy+delete (%s):\n %
|
4523
|
+
self.log("using copy+delete (%s):\n %r\n %r" % (ex.strerror, sabs, dabs))
|
4519
4524
|
b1, b2 = fsenc(sabs), fsenc(dabs)
|
4520
4525
|
is_link = os.path.islink(b1) # due to _relink
|
4521
4526
|
try:
|
@@ -4622,7 +4627,7 @@ class Up2k(object):
|
|
4622
4627
|
"""
|
4623
4628
|
srd, sfn = vsplit(vrem)
|
4624
4629
|
has_dupes = False
|
4625
|
-
self.log("forgetting
|
4630
|
+
self.log("forgetting %r" % (vrem,))
|
4626
4631
|
if wark and cur:
|
4627
4632
|
self.log("found {} in db".format(wark))
|
4628
4633
|
if drop_tags:
|
@@ -4698,7 +4703,7 @@ class Up2k(object):
|
|
4698
4703
|
dvrem = vjoin(rd, fn).strip("/")
|
4699
4704
|
if ptop != sptop or srem != dvrem:
|
4700
4705
|
dupes.append([ptop, dvrem])
|
4701
|
-
self.log("found
|
4706
|
+
self.log("found %s dupe: %r %r" % (wark, ptop, dvrem))
|
4702
4707
|
|
4703
4708
|
if not dupes:
|
4704
4709
|
return 0
|
@@ -4711,7 +4716,7 @@ class Up2k(object):
|
|
4711
4716
|
d = links if bos.path.islink(ap) else full
|
4712
4717
|
d[ap] = (ptop, vp)
|
4713
4718
|
except:
|
4714
|
-
self.log("relink: not found:
|
4719
|
+
self.log("relink: not found: %r" % (ap,))
|
4715
4720
|
|
4716
4721
|
# self.log("full:\n" + "\n".join(" {:90}: {}".format(*x) for x in full.items()))
|
4717
4722
|
# self.log("links:\n" + "\n".join(" {:90}: {}".format(*x) for x in links.items()))
|
@@ -4719,7 +4724,7 @@ class Up2k(object):
|
|
4719
4724
|
# deleting final remaining full copy; swap it with a symlink
|
4720
4725
|
slabs = list(sorted(links.keys()))[0]
|
4721
4726
|
ptop, rem = links.pop(slabs)
|
4722
|
-
self.log("linkswap
|
4727
|
+
self.log("linkswap %r and %r" % (sabs, slabs))
|
4723
4728
|
mt = bos.path.getmtime(slabs, False)
|
4724
4729
|
flags = self.flags.get(ptop) or {}
|
4725
4730
|
atomic_move(self.log, sabs, slabs, flags)
|
@@ -4754,7 +4759,7 @@ class Up2k(object):
|
|
4754
4759
|
|
4755
4760
|
zs = absreal(alink)
|
4756
4761
|
if ldst != zs:
|
4757
|
-
t = "relink because computed != actual destination:\n %
|
4762
|
+
t = "relink because computed != actual destination:\n %r\n %r"
|
4758
4763
|
self.log(t % (ldst, zs), 3)
|
4759
4764
|
ldst = zs
|
4760
4765
|
faulty = True
|
@@ -4769,7 +4774,7 @@ class Up2k(object):
|
|
4769
4774
|
t = "relink because symlink verification failed: %s; %r"
|
4770
4775
|
self.log(t % (ex, ex), 3)
|
4771
4776
|
|
4772
|
-
self.log("relinking
|
4777
|
+
self.log("relinking %r to %r" % (alink, dabs))
|
4773
4778
|
flags = self.flags.get(parts[0]) or {}
|
4774
4779
|
try:
|
4775
4780
|
lmod = bos.path.getmtime(alink, False)
|
@@ -4884,7 +4889,7 @@ class Up2k(object):
|
|
4884
4889
|
"",
|
4885
4890
|
)
|
4886
4891
|
if not hr:
|
4887
|
-
t = "upload blocked by xbu server config:
|
4892
|
+
t = "upload blocked by xbu server config: %r" % (vp_chk,)
|
4888
4893
|
self.log(t, 1)
|
4889
4894
|
raise Pebkac(403, t)
|
4890
4895
|
if hr.get("reloc"):
|
@@ -4934,7 +4939,7 @@ class Up2k(object):
|
|
4934
4939
|
try:
|
4935
4940
|
sp.check_call(["fsutil", "sparse", "setflag", abspath])
|
4936
4941
|
except:
|
4937
|
-
self.log("could not sparse
|
4942
|
+
self.log("could not sparse %r" % (abspath,), 3)
|
4938
4943
|
relabel = True
|
4939
4944
|
sprs = False
|
4940
4945
|
|
@@ -5121,7 +5126,7 @@ class Up2k(object):
|
|
5121
5126
|
self._tag_file(cur, entags, wark, abspath, tags)
|
5122
5127
|
cur.connection.commit()
|
5123
5128
|
|
5124
|
-
self.log("tagged
|
5129
|
+
self.log("tagged %r (%d+%d)" % (abspath, ntags1, len(tags) - ntags1))
|
5125
5130
|
|
5126
5131
|
def _hasher(self) :
|
5127
5132
|
with self.hashq_mutex:
|
@@ -5140,7 +5145,7 @@ class Up2k(object):
|
|
5140
5145
|
if not self._hash_t(task) and self.stop:
|
5141
5146
|
return
|
5142
5147
|
except Exception as ex:
|
5143
|
-
self.log("failed to hash %
|
5148
|
+
self.log("failed to hash %r: %s" % (task, ex), 1)
|
5144
5149
|
|
5145
5150
|
def _hash_t(
|
5146
5151
|
self, task
|
@@ -5152,7 +5157,7 @@ class Up2k(object):
|
|
5152
5157
|
return True
|
5153
5158
|
|
5154
5159
|
abspath = djoin(ptop, rd, fn)
|
5155
|
-
self.log("hashing "
|
5160
|
+
self.log("hashing %r" % (abspath,))
|
5156
5161
|
inf = bos.stat(abspath)
|
5157
5162
|
if not inf.st_size:
|
5158
5163
|
wark = up2k_wark_from_metadata(
|
@@ -5245,7 +5250,7 @@ class Up2k(object):
|
|
5245
5250
|
|
5246
5251
|
x = pathmod(self.vfs, "", req_vp, {"vp": fvp, "fn": fn})
|
5247
5252
|
if not x:
|
5248
|
-
t = "hook_fx(%s): failed to resolve %
|
5253
|
+
t = "hook_fx(%s): failed to resolve %r based on %r"
|
5249
5254
|
self.log(t % (act, fvp, req_vp))
|
5250
5255
|
continue
|
5251
5256
|
|