diff --git a/balls/packages/parameters/packages/commands/absent b/balls/packages/parameters/packages/commands/absent new file mode 100644 index 0000000..ffb895e --- /dev/null +++ b/balls/packages/parameters/packages/commands/absent @@ -0,0 +1 @@ +yum remove -y -d 0 -e 0 diff --git a/balls/packages/parameters/packages/commands/present b/balls/packages/parameters/packages/commands/present new file mode 100644 index 0000000..791bdc2 --- /dev/null +++ b/balls/packages/parameters/packages/commands/present @@ -0,0 +1 @@ +yum install -y -d 1 -e 0 diff --git a/balls/packages/scripts/00-installpkgs.sh b/balls/packages/scripts/00-installpkgs.sh new file mode 100644 index 0000000..f77164b --- /dev/null +++ b/balls/packages/scripts/00-installpkgs.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +######################### +# +# 00-installpkgs.sh +# +# For each package listed under $(hostname)/packages/[present|absent], +# install/remove the package there using the package management +# commands under $(hostname)/packages/commands/[present|absent]. +######################### + +HOSTNAME=$(hostname) +RETVAL=0 + +for op in present absent +do + PKGCMD=$(disco-param get ${HOSTNAME}/packages/commands/${op}) + for pkgname in $(disco-param keys ${HOSTNAME}/packages/${op}) + do + $PKGCMD $pkgname + RETVAL=$(expr $RETVAL + $?) + done +done + +exit $RETVAL \ No newline at end of file diff --git a/client/bin/disco-fs-diff b/client/bin/disco-fs-diff index 29177d1..9546f56 100755 --- a/client/bin/disco-fs-diff +++ b/client/bin/disco-fs-diff @@ -25,7 +25,7 @@ do MD5_NEW=$(md5sum ${DISCOROOT}/scratchfs${FNAME} 2>/dev/null| cut -d " " -f 1) STAT_NEW=$(chroot ${DISCOROOT}/chroot stat --format "owner='%G:%U', selinux='%C', md5='${MD5_NEW}'" /${FNAME} 2>/dev/null) if [ ! -d ${FNAME} ] && [ ! -d ${DISCOROOT}/scratchfs${FNAME} ]; then - diff -N ${FNAME} ${DISCOROOT}/scratchfs${FNAME} 2>/dev/null > /tmp/$$.diff + diff -N ${FNAME} ${DISCOROOT}/scratchfs${FNAME} 2>/dev/null | grep -v "^Binary file" > /tmp/$$.diff fi echo "${LINE}, ${STAT_NEW}" if [ -f /tmp/$$.diff ]; then diff --git a/universe/bin/disco-ball b/universe/bin/disco-ball index 3f9aa90..e35024f 100755 --- a/universe/bin/disco-ball +++ b/universe/bin/disco-ball @@ -129,12 +129,14 @@ function spin() { /usr/bin/time -f "$TIME" -o /var/disco/reports/${module}/diff disco-fs-diff if [ "$NOOP" == "" ]; then # Now for the real rsync back home - rsync -aWH /var/disco/testfs/real/scratchfs/. / cd /var/disco/testfs/real/scratchfs/.unionfs - for file in $(find . -iname "_HIDDEN~" -type f); + for file in $(find . -iname "*_HIDDEN~" | sed -e s/"^\."/""/g -e s/"_HIDDEN~$"/""/g); do rm -rf /${file} done + cd .. + rm -rf ./.unionfs + rsync -aWH /var/disco/testfs/real/scratchfs/. / fi rm -rf /var/disco/testfs/noop/scratchfs/* rm -rf /var/disco/testfs/real/scratchfs/*