Skip to content

Commit f43a77d

Browse files
committed
Do not consider failure to sync fatal
We still log the error but we assume it is okay to fail. See: https://progress.opensuse.org/issues/112871
1 parent 6576417 commit f43a77d

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

script/cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
read_files_isos = '''rsync -4 --list-only $rsync_pwd_option PRODUCTISOPATH/ | grep -P 'Media1?.iso$' | grep -E 'ARCHORS' | awk '{ $1=$2=$3=$4=""; print substr($0,5); }' >> __envsub/files_iso.lst
2121
'''
2222

23-
read_files_repo = '''rsync -4 --list-only $rsync_pwd_option PRODUCTREPOPATH/ | grep -P 'Media[1-3](.license)?$' | awk '{ $1=$2=$3=$4=""; print substr($0,5); } ' | grep -v IGNOREPATTERN | grep -E 'REPOORS' | grep -E 'ARCHORS' >> __envsub/files_repo.lst
23+
read_files_repo = '''rsync -4 --list-only $rsync_pwd_option PRODUCTREPOPATH/ | { grep -P 'Media[1-3](.license)?$' || true; } | awk '{ $1=$2=$3=$4=""; print substr($0,5); } ' | grep -v IGNOREPATTERN | grep -E 'REPOORS' | grep -E 'ARCHORS' >> __envsub/files_repo.lst
2424
'''
2525

2626
read_files_repo_media = '''rsync -4 $rsync_pwd_option PRODUCTREPOPATH/*Media1/media.1/media __envsub/Media1.lst'''

t/test_rsync.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
scriptdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4+
5+
errs=0
6+
7+
function rsync() {
8+
[ $successful -eq 1 ] && return 0
9+
echo "[sender] change_dir $3 (in repos) failed: No such file or directory (2)" >&2
10+
echo "rsync error: some files/attrs were not transferred" >&2
11+
echo "read_files.sh failed for in $dir" >&2
12+
return 256
13+
}
14+
function curl() {
15+
return 0
16+
}
17+
export -f rsync curl
18+
19+
successful=0
20+
export successful
21+
22+
for dir in "$@"; do
23+
for expected in $(seq 0 1); do
24+
successful=$expected
25+
out=$(bash -e "$@/read_files.sh" $dir)
26+
[ $? -eq 0 ] || echo "FAIL $dir : $out" $((++errs))
27+
done
28+
done
29+
(exit $errs)

0 commit comments

Comments
 (0)