From c13e3e090cc4d97dbf87a21b9de77e0b37ee5dd9 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Wed, 14 Dec 2011 13:37:36 -0500 Subject: Make volfile-save scriptlet follow .rpmsave convention. Change-Id: I7a106defcc441679cf7c48f78eea2c04feb2853e BUG: 764702 Signed-off-by: Jeff Darcy Reviewed-on: http://review.gluster.com/788 Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY Reviewed-by: Vijay Bellur --- glusterfs.spec.in | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/glusterfs.spec.in b/glusterfs.spec.in index 7cb5fb44d1b..c55da7f2d9e 100644 --- a/glusterfs.spec.in +++ b/glusterfs.spec.in @@ -175,11 +175,20 @@ echo "%{_prefix}/lib" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/glusterfs.conf /sbin/ldconfig if [ -d /etc/glusterd/vols ]; then -#for each dir under vols, backup non-fuse .vol files as .Vol.old -for file in `find /etc/glusterd/vols -type f ! -name *-fuse.vol `; -do -grep ".vol" $file &> /dev/null && fname=`basename $file .vol` && dname=`dirname $file` && cp $file $dname/$fname.Vol.old -done + # Rename old volfiles in an RPM-standard way. These aren't actually + # considered package config files, so %config doesn't work for them. + # + # NB: we used to exempt client-side volfiles from this treatment. The + # only reason we do it at all (I'm guessing) is because they might be + # rewritten differently by a new version of code, and the old versions might + # be useful for a merge or rollback (especially if they were tweaked). + # Since that rationale does apply to client-side volfiles as well, the + # exception has been removed. + for file in $(find /etc/glusterd/vols -name '*.vol'); do + newfile=${file}.rpmsave + echo "warning: ${file} saved as ${newfile}" + cp ${file} ${newfile} + done fi pidof -c -o %PPID -x glusterd &> /dev/null -- cgit