aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2017-09-18 15:06:05 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2017-09-18 15:06:05 -0700
commit283ce5efe4e8381fc2f319bd5b9bbeb2d5fd6b5f (patch)
tree7236fbeffe3a0f1417788e1dea932f99e6ac4ec0
parentsnapshots-create: improved tar arguments (diff)
downloadmastermirror-scripts-283ce5efe4e8381fc2f319bd5b9bbeb2d5fd6b5f.tar.gz
mastermirror-scripts-283ce5efe4e8381fc2f319bd5b9bbeb2d5fd6b5f.tar.bz2
mastermirror-scripts-283ce5efe4e8381fc2f319bd5b9bbeb2d5fd6b5f.zip
snapshots-create: exclude some content from the rsync, better than exclusion during tar
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xsnapshots-create.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh
index 9b2cbe7..66873fa 100755
--- a/snapshots-create.sh
+++ b/snapshots-create.sh
@@ -85,11 +85,35 @@ cd ${TEMP}
# create the tarball and move it to the right location
write_time_log "START TARBALL $(date -u)"
if [ ! -f "${FILENAME%.bz2}" ]; then
+ # Build exclusion list
+ # app-bar/ChangeLog is a valid package name, so we have to be careful about it!
+ EXCLUSION_LIST="$(mktemp -p ${TEMP} snapshot-exclude.XXXXXXXXXX)"
+ find "${MASTER}" \
+ \( \
+ -type f \
+ -regextype posix-egrep \
+ \( \
+ -path "${MASTER}/eclass/ChangeLog*" -o \
+ -path "${MASTER}/profiles/ChangeLog*" -o \
+ -path "${MASTER}/profiles/*/ChangeLog*" -o \
+ -regex "${MASTER}/[^/]+/[^/]+/ChangeLog(-[0-9]+)?$" \
+ \) \
+ \) \
+ -o \
+ -name '.checksum-test-marker' \
+ \
+ | sed "s,${MASTER}/*,,g" \
+ \
+ | sort \
+ \
+ >"${EXCLUSION_LIST}"
+
# Build a directory of stuff to tar up.
rm -rf portage
rsync -Wqa \
"$MASTER"/ \
- portage/
+ portage/ \
+ --exclude-from "${EXCLUSION_LIST}"
if [ $? -ne 0 ]; then
echo "rsync run failed!"
exit 1