]> asedeno.scripts.mit.edu Git - sipb-mirrors.git/commitdiff
Switch PASS1 to an array
authorAlexander Chernyakhovsky <achernya@mit.edu>
Sun, 8 Feb 2015 05:30:27 +0000 (00:30 -0500)
committerAlexander Chernyakhovsky <achernya@mit.edu>
Sun, 8 Feb 2015 05:30:27 +0000 (00:30 -0500)
Patch courtesy of andersk@mit.edu. Correct the shell escaping of globs by
switching to a bash array; this avoids sending a literal backslash to rsync.

fetch-scripts/debian
fetch-scripts/debian-backports

index abad14ac51b1ca7f8005720e5b71279b07c3572d..f38a09a65e009f23104b4fdcc570aff3cadd7e28 100644 (file)
@@ -14,7 +14,7 @@ RSYNC_OPTS="--recursive --links --hard-links --times --sparse --hard-links --blo
 OTHER_OPTS="--verbose --stats"
 
 # Options we only use in the first pass, where we do not want packages/sources to fly in yet and dont want to delete files
-PASS1="--exclude Packages\* --exclude Sources\* --exclude Release\* --exclude InRelease --exclude i18n/\* --exclude ls-lR\*"
+PASS1=(--exclude Packages\* --exclude Sources\* --exclude Release\* --exclude InRelease --exclude i18n/\* --exclude ls-lR\*)
 # Options for the second pass, where we do want everything, including deletion of old and now unused files
 PASS2="--max-delete=40000 --delay-updates --delete --delete-after --delete-excluded --exclude \"project/trace/${HOSTNAME}\""
 
@@ -22,7 +22,7 @@ PASS2="--max-delete=40000 --delay-updates --delete --delete-after --delete-exclu
 # world-readable remotely. Always exclude it to avoid errors. 
 EXCLUDE="--exclude .~tmp~/"
 
-rsync ${RSYNC_OPTS} ${OTHER_OPTS} ${PASS1} ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
+rsync ${RSYNC_OPTS} ${OTHER_OPTS} "${PASS1[@]}" ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
 rsync ${RSYNC_OPTS} ${OTHER_OPTS} ${PASS2} ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
 
 mkdir -p ${BASEDIR}/project/trace
index bad2a9882e8d244c4572bc7654f763f39e80fb86..079ed18b20bb77aa13ce0ae6874216b2d2f19c4f 100644 (file)
@@ -14,7 +14,7 @@ RSYNC_OPTS="--recursive --links --hard-links --times --sparse --hard-links --blo
 OTHER_OPTS="--verbose --stats"
 
 # Options we only use in the first pass, where we do not want packages/sources to fly in yet and dont want to delete files
-PASS1="--exclude Packages\* --exclude Sources\* --exclude Release\* --exclude ls-lR\*"
+PASS1=(--exclude Packages\* --exclude Sources\* --exclude Release\* --exclude ls-lR\*)
 # Options for the second pass, where we do want everything, including deletion of old and now unused files
 PASS2="--max-delete=40000 --delay-updates --delete --delete-after --delete-excluded --exclude \"project/trace/${HOSTNAME}\""
 
@@ -22,7 +22,7 @@ PASS2="--max-delete=40000 --delay-updates --delete --delete-after --delete-exclu
 # world-readable remotely. Always exclude it to avoid errors. 
 EXCLUDE="--exclude .~tmp~/"
 
-rsync ${RSYNC_OPTS} ${OTHER_OPTS} ${PASS1} ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
+rsync ${RSYNC_OPTS} ${OTHER_OPTS} "${PASS1[@]}" ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
 rsync ${RSYNC_OPTS} ${OTHER_OPTS} ${PASS2} ${EXCLUDE} ${RSYNCSOURCE} ${BASEDIR}
 
 mkdir -p ${BASEDIR}/project/trace