1 |
commit: c9ad265f80178b8786974e0d1e250daa42e6a742 |
2 |
Author: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Nov 21 06:43:38 2018 +0000 |
4 |
Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 21 19:07:26 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/releng.git/commit/?id=c9ad265f |
7 |
|
8 |
scripts/copy_buildsync: try to exclude rsync tempfile |
9 |
|
10 |
In-progress uploads are named .<filename>.<rsynctemp> and were |
11 |
mistakenly recognized by copy_buildsync.sh as targets to sweep to the |
12 |
mirrors. When it did, it deleted the file causing the in-progress upload |
13 |
to fail. |
14 |
|
15 |
Since the script is run by cron every 15 minutes, this would lead to a |
16 |
large portion of the generated installation media to fail to upload, and |
17 |
worse there is no pattern to it -- it just happens whenever an upload |
18 |
spans the 15 minute boundary. |
19 |
|
20 |
The fix is to ignore hidden files and to tell rsync (via the filter |
21 |
rules) to exclude them from its sweep to the mirrors. |
22 |
|
23 |
Closes: https://bugs.gentoo.org/670458 |
24 |
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org> |
25 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
26 |
|
27 |
scripts/copy_buildsync.sh | 6 +++--- |
28 |
1 file changed, 3 insertions(+), 3 deletions(-) |
29 |
|
30 |
diff --git a/scripts/copy_buildsync.sh b/scripts/copy_buildsync.sh |
31 |
index d67cf6ee..6c6085ff 100755 |
32 |
--- a/scripts/copy_buildsync.sh |
33 |
+++ b/scripts/copy_buildsync.sh |
34 |
@@ -70,14 +70,14 @@ copy_arch_to_outgoing() { |
35 |
fi |
36 |
|
37 |
# Copying |
38 |
- for i in $(find ${indir} -type f | egrep -- '-20[0123][0-9]{5}(([0-9]{6})|(T[0-9]{6}Z))?' | sed -e 's:^.*-\(20[^.]\+\).*$:\1:' | sort -ur); do |
39 |
+ for i in $(find ${indir} -not -path '*/\.*' -type f | egrep -- '-20[0123][0-9]{5}(([0-9]{6})|(T[0-9]{6}Z))?' | sed -e 's:^.*-\(20[^.]\+\).*$:\1:' | sort -ur); do |
40 |
#echo "Doing $i" |
41 |
t="${outdir}/${i}" |
42 |
mkdir -p ${t} 2>/dev/null |
43 |
- rsync "${RSYNC_OPTS[@]}" --temp-dir=${tmpdir} --partial-dir=${tmpdir} ${indir}/ --filter "S *${i}*" --filter 'S **/' --filter 'H *' ${t} |
44 |
+ rsync "${RSYNC_OPTS[@]}" --temp-dir=${tmpdir} --partial-dir=${tmpdir} ${indir}/ --filter '- **/.*' --filter "S *${i}*" --filter 'S **/' --filter 'H *' ${t} |
45 |
rc=$? |
46 |
if [ $rc -eq 0 ]; then |
47 |
- find ${indir} -type f -name "*${i}*" -print0 | xargs -0 --no-run-if-empty $DEBUGP rm $VERBOSEP -f |
48 |
+ find ${indir} -not -path '*/\.*' -type f -name "*${i}*" -print0 | xargs -0 --no-run-if-empty $DEBUGP rm $VERBOSEP -f |
49 |
else |
50 |
echo "Not deleting ${indir}/*${i}*, rsync failed!" 1>&2 |
51 |
fail=1 |