From 2777bf4330d25a8ebcaac7aaf0faae191fe7c2d8 Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Mon, 1 Apr 2013 22:54:00 +0000 Subject: [PATCH] clean out some cruft from rpm spec. use appropriate names for weewx merging. --- pkg/debian/postinst | 9 ++++++--- pkg/weewx.spec.in | 12 ------------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/pkg/debian/postinst b/pkg/debian/postinst index 2480e5bd..bf63318d 100755 --- a/pkg/debian/postinst +++ b/pkg/debian/postinst @@ -72,10 +72,13 @@ configure_weewxconf() { # use weewx setup utilities to merge new features into existing weewx.conf merge_weewxconf() { OLDVER="$1" + NEWVER="$2" echo saving previous config file as $cfgfile-$OLDVER mv $cfgfile $cfgfile-$OLDVER - echo merging new features into config file - $mergeapp --install-dir / --old-cfg $cfgfile-$OLDVER --new-cfg $cfgfile + echo saving distribution config file as $cfgfile-$NEWVER + mv $cfgfile.dpkg-dist $cfgfile-$NEWVER + echo merging previous and distribution into $cfgfile + $mergeapp --install-dir / --a $cfgfile-$NEWVER -b $cfgfile-$OLDVER --c $cfgfile } case "$1" in @@ -86,7 +89,7 @@ configure) CFGVERSION=`grep version $cfgfile | sed -e 's/\s*version\s*=\s*//'` if dpkg --compare-versions $CFGVERSION lt $NEWVERSION; then # this is an old config, so merge new features into it - merge_weewxconf $2 + merge_weewxconf $2 $NEWVERSION else # this is a new config, so insert debconf values into it configure_weewxconf diff --git a/pkg/weewx.spec.in b/pkg/weewx.spec.in index 393b7e63..c0e5fc3d 100644 --- a/pkg/weewx.spec.in +++ b/pkg/weewx.spec.in @@ -2,29 +2,17 @@ # License: GPLv3 # Author: (c) 2013 Matthew Wall -# default configuration when OS is not known - this will fail. when it does, -# add a vendor section with an appropriate configuration. -%define layout unknown - # suse -%if 0%{?suse_version} || 0%{?sles_version} %if 0%{?suse_version} %define relos .suse%{suse_version} %endif %if 0%{?sles_version} %define relos .sles%{sles_version} %endif -%define layout suse -%define apacheconfdir %{_sysconfdir}/apache2/conf.d -%define apachecmd apache2 -%endif # redhat, fedora, centos %if "%{_vendor}" == "redhat" %define relos %{?dist:%{dist}} -%define layout redhat -%define apacheconfdir %{_sysconfdir}/httpd/conf.d -%define apachecmd httpd %endif %global relnum 1