Added the 'packages' disco ball that installs and removes packages for you from parameters. Minor fixups to disco-fs-diff. Fixed a bug in disco-ball where files would not get deleted, and .unionfs was rsynced back into /.
This commit is contained in:
1
balls/packages/parameters/packages/commands/absent
Normal file
1
balls/packages/parameters/packages/commands/absent
Normal file
@@ -0,0 +1 @@
|
||||
yum remove -y -d 0 -e 0
|
||||
1
balls/packages/parameters/packages/commands/present
Normal file
1
balls/packages/parameters/packages/commands/present
Normal file
@@ -0,0 +1 @@
|
||||
yum install -y -d 1 -e 0
|
||||
25
balls/packages/scripts/00-installpkgs.sh
Normal file
25
balls/packages/scripts/00-installpkgs.sh
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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/*
|
||||
|
||||
Reference in New Issue
Block a user