Revision 10030
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/sync.sh | ||
---|---|---|
5 | 5 |
|
6 | 6 |
alias use_sync='declare prefix=sync_; import_vars; unset prefix' |
7 | 7 |
|
8 |
upload() #usage: local_dir=... remote_url=serv:dir [swap=1] upload [opt|path]... |
|
8 |
upload() # usage: local_dir=... remote_url=serv:dir [swap=1] [subpath=...] \ |
|
9 |
# upload [opt|path]... |
|
9 | 10 |
# swap: downloads instead of uploads |
11 |
# subpath: relative to *currdir*, not $local_dir as in `put` |
|
10 | 12 |
# path: relative to *currdir*, not $local_dir. when invoking from a script, use |
11 | 13 |
# an absolute path (e.g. "$(dirname "${BASH_SOURCE[0]}")"/...). |
12 | 14 |
# requires put from https://uutils.googlecode.com/svn/trunk/bin/put |
13 | 15 |
{ |
14 | 16 |
echo_func; kw_params local_dir remote_url; echo_vars swap |
15 | 17 |
|
18 |
# make subpath relative to currdir |
|
19 |
if test "$subpath"; then |
|
20 |
local subpath="$(base_dir="$local_dir" canon_rel_path "$subpath")" |
|
21 |
if test "$subpath" = .; then unset subpath; fi |
|
22 |
fi |
|
23 |
|
|
16 | 24 |
# change path args to --includes |
17 | 25 |
local has_includes= args=() |
18 | 26 |
local a; for a in "$@"; do |
Also available in: Unified diff
lib/sh/sync.sh: upload(): make put's $subpath option relative to the currdir instead, like the --include paths. note that $subpath unfortunately can't be used in subdirs at this point because it will cause rsync to ignore the .rsync_ignores and .rsync_filters in parent dirs, including the essential .rsync_ignore in the sync root dir.