X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=myplc.spec;h=f8ffe9806395c36cf46493f48212df8269f095ac;hb=8489f047aebac5802e7708349d1094226b549800;hp=7a94a724745725a7f2bceb7a87735378fede5856;hpb=60fe435eb4e2be0cd3eb854d47b2fad1de569f5e;p=myplc.git diff --git a/myplc.spec b/myplc.spec index 7a94a72..f8ffe98 100644 --- a/myplc.spec +++ b/myplc.spec @@ -82,6 +82,10 @@ install -D -m 644 devel/root.img $RPM_BUILD_ROOT/plc/devel/root.img # Install data directory find devel/data | cpio -p -d -u $RPM_BUILD_ROOT/plc/ +# Make sure /cvs is never upgraded once installed by giving it a +# unique name. A hard-linked copy is made in %post. +mv $RPM_BUILD_ROOT/plc/devel/data/{cvs,cvs.%{version}-%{release}} + popd %clean @@ -112,6 +116,9 @@ fi # upgrading from one of these old versions of myplc, we must back up # the database and /etc/planetlab and restore them after the old # version has been uninstalled in %triggerpostun. +# +# This code can be removed once all myplc-0.4-1 installations have +# been upgraded to at least myplc-0.4-2. # 0 = install, 1 = upgrade if [ $1 -gt 0 ] ; then @@ -167,30 +174,17 @@ if [ -x %{_sysconfdir}/init.d/plc-devel ] ; then %{_sysconfdir}/init.d/plc-devel stop fi -# 0 = install, 1 = upgrade -if [ $1 -gt 0 ] ; then - # Never overwrite /cvs - if [ -d /plc/devel/data/cvs ] ; then - echo "Preserving /plc/devel/data/cvs" - mv /plc/devel/data/cvs /plc/devel/data/cvs.rpmsave - fi -fi - %post devel if [ -x /sbin/chkconfig ] ; then /sbin/chkconfig --add plc-devel /sbin/chkconfig plc-devel on fi -%triggerpostun -- %{name} -# 0 = erase, 1 = upgrade -if [ $1 -gt 0 ] ; then - if [ -d /plc/devel/data/cvs.rpmsave ] ; then - echo "Restoring /plc/devel/data/cvs" - mv /plc/devel/data/cvs /plc/devel/data/cvs.%{version}-%{release} - mv /plc/devel/data/cvs.rpmsave /plc/devel/data/cvs - fi -fi +# If /cvs does not already exist, make a hard-linked copy of this +# version's /cvs repository. +if [ ! -d /plc/devel/data/cvs ] ; then + cp -rl /plc/devel/data/{cvs.%{version}-%{release},cvs} +fi %preun devel # 0 = erase, 1 = upgrade