Skip to content

Commit edf5999

Browse files
committed
tsumugu: Update version, add delay updates flag
1 parent 29c1342 commit edf5999

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -450,16 +450,17 @@ Stackage doesn't need to specify upstream.
450450

451451
An alternative HTTP(S) syncing tool, replacing `rclone` and `lftp` in some cases. See [usage](https://github.com/taoky/tsumugu#usage).
452452

453-
| Parameter | Description |
454-
| ---------------------- | --------------------------------------------------------------------------------------------------- |
455-
| `UPSTREAM` | Sets the url of upstream. |
456-
| `TSUMUGU_MAXDELETE` | Maximum number of files that can be removed. Defaults to `1000`. |
457-
| `TSUMUGU_TIMEZONEFILE` | The file URL for guessing remote server timezone. |
458-
| `TSUMUGU_EXCLUDE` | Files to be excluded. Value example: `"--exclude '^temp'"` |
459-
| `TSUMUGU_USERAGENT` | The user agent of `tsumugu` syncing program. Defaults to `Tsumugu Syncing Tool/$(tsumugu_version)`. |
460-
| `TSUMUGU_PARSER` | HTML parser used to parse index page. Defaults to `nginx`. |
461-
| `TSUMUGU_THREADS` | Number of threads to use to download in parallel. Defaults to 2. |
462-
| `TSUMUGU_EXTRA` | Extra options. Defaults to empty. |
453+
| Parameter | Description |
454+
| ----------------------- | --------------------------------------------------------------------------------------------------- |
455+
| `UPSTREAM` | Sets the url of upstream. |
456+
| `TSUMUGU_MAXDELETE` | Maximum number of files that can be removed. Defaults to `1000`. |
457+
| `TSUMUGU_TIMEZONEFILE` | The file URL for guessing remote server timezone. |
458+
| `TSUMUGU_EXCLUDE` | Files to be excluded. Value example: `"--exclude '^temp'"` |
459+
| `TSUMUGU_USERAGENT` | The user agent of `tsumugu` syncing program. Defaults to `Tsumugu Syncing Tool/$(tsumugu_version)`. |
460+
| `TSUMUGU_PARSER` | HTML parser used to parse index page. Defaults to `nginx`. |
461+
| `TSUMUGU_THREADS` | Number of threads to use to download in parallel. Defaults to 2. |
462+
| `TSUMUGU_EXTRA` | Extra options. Defaults to empty. |
463+
| `TSUMUGU_DELAY_UPDATES` | Delay updates until end of transfer. Defaults to `metadata`. Set to `all` to delay all files. |
463464

464465
### winget-source
465466

tsumugu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM ustcmirror/base:alpine
22
LABEL maintainer="Keyu Tao <taoky AT ustclug.org>"
33
LABEL bind_support=true
4-
ARG TSUMUGU_VERSION=20251128
4+
ARG TSUMUGU_VERSION=20260207
55

66
RUN <<EOF
77
set -euo pipefail

tsumugu/sync.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#TSUMUGU_PARSER=
1313
#TSUMUGU_THREADS=
1414
#TSUMUGU_EXTRA=
15+
#TSUMUGU_DELAY_UPDATE=
1516

1617
set -eu
1718
[[ $DEBUG = true ]] && set -x
@@ -25,6 +26,7 @@ TSUMUGU_USERAGENT=${TSUMUGU_USERAGENT:-"Tsumugu HTTP Syncing Tool/"$(tsumugu --v
2526
TSUMUGU_PARSER=${TSUMUGU_PARSER:-"nginx"}
2627
TSUMUGU_THREADS=${TSUMUGU_THREADS:-"2"}
2728
TSUMUGU_EXTRA=${TSUMUGU_EXTRA:-}
29+
TSUMUGU_DELAY_UPDATE=${TSUMUGU_DELAY_UPDATE:-"metadata"}
2830

2931
if [[ -n $TSUMUGU_TIMEZONEFILE ]]; then
3032
TSUMUGU_TIMEZONEFILE="--timezone-file $TSUMUGU_TIMEZONEFILE"
@@ -34,6 +36,12 @@ if [[ $DEBUG = true ]]; then
3436
export RUST_LOG="tsumugu=debug"
3537
fi
3638

39+
if [[ $TSUMUGU_DELAY_UPDATE = "metadata" ]]; then
40+
TSUMUGU_EXTRA+=" --delay-update-metadata"
41+
elif [[ $TSUMUGU_DELAY_UPDATE = "all" ]]; then
42+
TSUMUGU_EXTRA+=" --delay-update"
43+
fi
44+
3745
export NO_COLOR=1
3846

3947
exec tsumugu sync $TSUMUGU_TIMEZONEFILE \

0 commit comments

Comments
 (0)