mirror of
https://github.com/weewx/weewx.git
synced 2026-05-24 17:55:15 -04:00
clean out some cruft from rpm spec. use appropriate names for weewx merging.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user