tests: Support older versions of rsync

Older versions of rsync (< 3.1) lack an --ignore-missing-args option.
Use this workaround [1] to allow "make vmsync" to work on CentOS 7.

[1] https://stackoverflow.com/questions/43391493/rsync-simulate-ignore-missing-args-on-old-server-version

Closes: #870
Approved by: cgwalters
This commit is contained in:
Matthew Barnes 2017-07-10 19:18:47 -04:00 committed by Atomic Bot
parent c7024d69ae
commit 2934799741
2 changed files with 12 additions and 4 deletions

View File

@ -31,11 +31,15 @@ if test -z "${INSIDE_VM:-}"; then
for pkg in ostree{,-libs,-grub2}; do
rpm -q $pkg
# We do not have perms to read /etc/grub2 as non-root
rpm -ql $pkg |grep -v '^/etc/'> list.txt
rpm -ql $pkg | grep -v '^/etc/' | sed "s/^/+ /" > list.txt
echo "- *" >> list.txt
# In the prebuilt container case, manpages are missing. Ignore that.
# Also chown everything to writable, due to https://bugzilla.redhat.com/show_bug.cgi?id=517575
chmod -R u+w ${DESTDIR}/
rsync -l --ignore-missing-args --files-from=list.txt / ${DESTDIR}/
# The --ignore-missing-args option was added in rsync 3.1.0,
# but CentOS7 only has rsync 3.0.9. Can simulate the behavior
# with --include-from and the way we constructed list.txt.
rsync -l --include-from=list.txt / ${DESTDIR}/
rm -f list.txt
done
make install DESTDIR=${DESTDIR}

View File

@ -23,11 +23,15 @@ if test -z "${INSIDE_VM:-}"; then
for pkg in ostree{,-libs,-grub2}; do
rpm -q $pkg
# We do not have perms to read /etc/grub2 as non-root
rpm -ql $pkg |grep -v '^/etc/'> list.txt
rpm -ql $pkg | grep -v '^/etc/' | sed "s/^/+ /" > list.txt
echo "- *" >> list.txt
# In the prebuilt container case, manpages are missing. Ignore that.
# Also chown everything to writable, due to https://bugzilla.redhat.com/show_bug.cgi?id=517575
chmod -R u+w ${VMCHECK_INSTTREE}/
rsync -l --ignore-missing-args --files-from=list.txt / ${VMCHECK_INSTTREE}/
# The --ignore-missing-args option was added in rsync 3.1.0,
# but CentOS7 only has rsync 3.0.9. Can simulate the behavior
# with --include-from and the way we constructed list.txt.
rsync -l --include-from=list.txt / ${VMCHECK_INSTTREE}/
rm -f list.txt
done