Hello community, here is the log from the commit of package cfengine for openSUSE:Factory checked in at 2014-04-17 14:07:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cfengine (Old) and /work/SRC/openSUSE:Factory/.cfengine.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cfengine" Changes: -------- --- /work/SRC/openSUSE:Factory/cfengine/cfengine.changes 2013-12-13 11:55:22.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.cfengine.new/cfengine.changes 2014-04-17 14:07:59.000000000 +0200 @@ -1,0 +2,111 @@ +Fri Apr 11 07:32:08 UTC 2014 - [email protected] + +- Upgrade to 3.6.0rc + Bugfix release + Full ChangeLog at https://raw.githubusercontent.com/cfengine/core/3.6.x/ChangeLog + +------------------------------------------------------------------- +Thu Apr 10 14:02:11 UTC 2014 - [email protected] + +- add 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch + * add 'suse' class for consistency with other vendor classes + (fixes #5417) + * distinction between "SUSE Linux Enterprise Server" (sles) and + "... Desktop" (sled) + * distinction between SUSE Linux Enterprise products (suse) and + openSUSE (opensuse) + * extract version from VERSION and PATCHLEVEL lines instead of + first line of /etc/SuSE-release + +------------------------------------------------------------------- +Fri Apr 4 19:36:47 UTC 2014 - [email protected] + +- merge cfengine-server with cfengine. A policy server only + gets cfengine-masterfiles but is otherwise identical to + a client. + +------------------------------------------------------------------- +Thu Apr 3 13:10:56 UTC 2014 - [email protected] + +- install cfengine.SuSEfirewall2 + +------------------------------------------------------------------- +Thu Apr 3 12:41:44 UTC 2014 - [email protected] + +- install cfengine-masterfiles together with cfengine-server only. + A cfengine client will get the masterfiles from the server. + +------------------------------------------------------------------- +Wed Apr 2 13:14:34 UTC 2014 - [email protected] + +- clean up /var/cfengine/inputs cache on removal. + +------------------------------------------------------------------- +Wed Mar 26 16:08:16 UTC 2014 - [email protected] + +- remove '.unknown' from reported version + add drop-revision.patch + +------------------------------------------------------------------- +Wed Mar 26 08:24:00 UTC 2014 - [email protected] + +- Fix all .service files, type is forking. + +------------------------------------------------------------------- +Tue Mar 18 11:30:23 UTC 2014 - [email protected] + +- Update to 3.6.0b2 + - performance has been significantly improved, with a 10-20% speed + increase over 3.5 when using the default masterfiles + - agents support the legacy protocol without TLS envelope + This allows upgrading of an agent before the policy server. + - several general improvements and bug fixes too numerous to list + here. + +- remove cfengine-bootstrap.patch, included upstream + +- split masterfiles off as cfengine-masterfiles package + +------------------------------------------------------------------- +Tue Mar 18 10:20:55 UTC 2014 - [email protected] + +- fix build for RHEL + * MySQL connector: disabled + * docs go into versioned directory + +------------------------------------------------------------------- +Thu Feb 20 23:54:22 UTC 2014 - [email protected] + +- merge with my last (not committed changes) + * bootstrap patch +- fix changes file + * update 3.0.4b2 -> 3.4.0b2 +- fix docs install +- fix build for SLE_11 (MySQL connector: disabled) + +------------------------------------------------------------------- +Sun Feb 9 12:02:45 UTC 2014 - [email protected] + +- use lmdb instead of tokyocabinet +- add primer.pdf + +------------------------------------------------------------------- +Tue Feb 4 07:10:49 UTC 2014 - [email protected] + +- split off -examples sub-package + +------------------------------------------------------------------- +Mon Feb 3 18:30:23 UTC 2014 - [email protected] + +- Upgrade to 3.6.0b1 + - New promise type "users" for managing local user accounts. + - TLS authentication and fully encrypted network protocol + - New attributes in 'bundle server access_rules' + - New variable type 'data' for handling of structured data + - Tagging of classes and variables with meta data + - Many new built-in variables + - Many new functions + + - Replace tokyocabinet with lmdb database + +------------------------------------------------------------------- @@ -280 +391 @@ -- update to 3.0.4b2 +- update to 3.4.0b2 @@ -318,0 +430,6 @@ +------------------------------------------------------------------- +Wed Mar 7 13:02:30 UTC 2012 - [email protected] + +- add bootstrap patch + * set correct "workdir" + Old: ---- cfengine-3.5.3.tar.gz libacl-headers.patch New: ---- 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch cfengine.SuSEfirewall2 core-3.6rc.tar.gz drop-revision.patch primer.pdf ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cfengine.spec ++++++ --- /var/tmp/diff_new_pack.3Qbnkf/_old 2014-04-17 14:08:02.000000000 +0200 +++ /var/tmp/diff_new_pack.3Qbnkf/_new 2014-04-17 14:08:02.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package cfengine # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,6 +17,7 @@ Name: cfengine +%define srcname core %define libname libpromises %define libsoname %{libname}3 @@ -24,25 +25,19 @@ # reported upstream as https://cfengine.com/dev/issues/1896 %define basedir /var/%{name} %define workdir %{basedir} +# This is the place where workdir should be +#define basedir /var/lib/%{name} +#define workdir %{basedir}/work Summary: CFEngine automates large-scale IT computing infrastructure License: GPL-3.0 Group: Productivity/Networking/System -Version: 3.5.3 +Version: 3.6rc Release: 0 Url: http://www.cfengine.org/ -Source: %{name}-%{version}.tar.gz -# there's no /usr/include/acl.h in SUSE or Fedora, [email protected] -Patch1: libacl-headers.patch -# SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, [email protected] -Patch2: remove-am_subst_notmake.patch +Source: %{srcname}-%{version}.tar.gz +Source1: %{name}.SuSEfirewall2 -Source1: http://www.cfengine.org/manuals/cf3-Reference.pdf -Source2: http://www.cfengine.org/manuals/cf3-conceptguide.pdf -Source3: http://www.cfengine.org/manuals/cf3-glossary.pdf -Source4: http://www.cfengine.org/manuals/cf3-quickstart.pdf -Source5: http://www.cfengine.org/manuals/cf3-solutions.pdf -Source6: http://www.cfengine.org/manuals/cf3-tutorial.pdf # wtf? SLE_11 does not honor rpmlintrc %if 0%{?suse_version} <= 1130 BuildRequires: -post-build-checks @@ -58,13 +53,35 @@ %endif Source10: %{name}.cron Source11: %{name}-rpmlintrc + +# docs +Source101: http://www.cfengine.org/manuals/cf3-Reference.pdf +Source102: http://www.cfengine.org/manuals/cf3-conceptguide.pdf +Source103: http://www.cfengine.org/manuals/cf3-glossary.pdf +Source104: http://www.cfengine.org/manuals/cf3-quickstart.pdf +Source105: http://www.cfengine.org/manuals/cf3-solutions.pdf +Source106: http://www.cfengine.org/manuals/cf3-tutorial.pdf +Source107: http://www.verticalsysadmin.com/cfengine/primer.pdf + +# SLE 11 or RHEL5 autoconf does not support AM_SUBST_NOTMAKE, [email protected] +Patch2: remove-am_subst_notmake.patch + +# drop revision from configure.ac, autotools will evaluate it as 'unkwown' +# [email protected] +Patch3: drop-revision.patch + +# PATCH-FIX-UPSTREAM add 'suse' class for consistency with other vendor classes +# PATCH-FEATURE-UPSTREAM better /etc/SuSE-release parsing, upstream #5423 +Patch5: 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: db-devel BuildRequires: flex -BuildRequires: libtokyocabinet-devel BuildRequires: libtool BuildRequires: libxml2-devel +BuildRequires: lmdb-devel +BuildRequires: pam-devel # # Disable mysql for SLE_11: # @@ -73,7 +90,7 @@ # library or disable MySQL connector. See # http://bugs.mysql.com/bug.php?id=65055 for details. # -%if 0%{?suse_version} != 1110 +%if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0 BuildRequires: mysql-devel %endif BuildRequires: libacl-devel @@ -101,6 +118,8 @@ BuildRequires: fdupes %endif +Requires: %{libsoname} = %{version} + %description CFEngine is the core of a configuration management system: ensuring the availability, security and compliance of mission-critical @@ -114,8 +133,8 @@ %package -n %{libsoname} Summary: Shared library of cfengine Group: System/Libraries -Provides: %{libname}1 -Obsoletes: %{libname}1 +Provides: %{libname}1 = %{version} +Obsoletes: %{libname}1 < %{version} %if 0%{?suse_version} == 1010 Requires: glibc %endif @@ -126,7 +145,7 @@ %package -n %{libname}-devel Summary: Development package for libpromises Group: Development/Libraries/C and C++ -Provides: %{name}-devel < %{version} +Provides: %{name}-devel = %{version} Obsoletes: %{name}-devel < %{version} Requires: %{libsoname} = %{version} Requires: glibc-devel @@ -139,7 +158,7 @@ %package doc Summary: CFEngine automates large-scale IT computing infrastructure - documentation -Group: Productivity/Networking/System +Group: Documentation/Other %if 0%{?rhel_version} || 0%{?centos_version} BuildRequires: tetex BuildRequires: tetex-dvips @@ -150,26 +169,23 @@ %description doc Full documentation for cfengine -%package server -Summary: CFEngine automates large-scale IT computing infrastructure - server -Group: Productivity/Networking/System -Requires: %{name} = %{version}-%{release} - -%description server -This package contains the files of the cfengine server. +%package examples +Summary: CFEngine example promises +Group: Documentation/Other +%description examples +Lots of examples promises for CFEngine. %prep -%setup -q -n %{name}-%{version} -%if 0%{?suse_version} || 0%{?fedora_version} || 0%{?rhel_version} -%patch1 -p1 -%endif -%if 0%{?suse_version} > 0 && 0%{?suse_version} <= 1110 +%setup -q -n %{srcname}-%{version} +%if 0%{?suse_version} <= 1110 %patch2 -p1 %endif %if 0%{?rhel_version} >= 500 && 0%{?rhel_version} < 600 %patch2 -p1 %endif +%patch3 -p1 +%patch5 -p1 ##### rpmlint #### wrong-file-end-of-line-encoding @@ -177,25 +193,36 @@ ### http://www.fsf.org/about/contact/ find ./examples -type f -name "*.cf" -exec perl -p -i -e 's|\r\n|\n|,s|^# Foundation.*|# Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA|' {} \; +### install extra docs +%{__install} -d docs +cp -a $RPM_SOURCE_DIR/*pdf docs/ + %build -autoreconf -fi +autoreconf -fi -I m4 # /usr/include/sys for acl.h CC=gcc CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" \ %configure \ --disable-static \ --enable-fhs \ - --with-libxml2 \ --datadir=/var \ --with-workdir=%{workdir} \ --with-postgresql \ +%if 0%{?suse_version} != 1110 && 0%{?rhel_version} == 0 && 0%{?fedora_version} != 20 + --with-mysql \ +%endif + --without-qdbm \ + --without-tokyocabinet \ + --with-lmdb \ --with-pthreads \ --with-openssl \ --with-pcre \ --with-libvirt \ --with-libacl \ --with-libxml2 \ -%if 0%{?suse_version} >= 1110 || 0%{?rhel_version} >= 600 +%if 0%{?suse_version} >= 1110 --docdir=%{_docdir}/%{name} +%else if 0%{?rhel_version} >= 600 + --docdir=%{_docdir}/%{name}-%{version} %endif # SLE 10 and RHEL5 don't recognize --docdir @@ -211,10 +238,16 @@ [ -d %{buildroot} ] && [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot} %endif %{__make} "DESTDIR=%{buildroot}" install + +%if 0%{?suse_version} >= 1110 || 0%{?rhel_version} >= 600 +# will appear in cfengine-examples +rm -rf %{buildroot}/%{_docdir}/%{name}/examples +%endif + %{__install} -d %{buildroot}/{usr/sbin,%{workdir}/{bin,inputs,reports}} # create dirs needed for better organizing dirs and files -%{__install} -d %{buildroot}/%{basedir}/{backup,failsafe,config} +%{__install} -d %{buildroot}/%{basedir}/{backup,failsafe,config,plugins} #%%{__install} -d %{buildroot}/%%{basedir}/config/{development,production} # install cron file @@ -239,28 +272,30 @@ %{buildroot}/etc/init.d/cf-* %{buildroot}/etc/cron.d/%{name} %endif -# install docs -%{__install} -d %{buildroot}/%{_datadir}/doc/%{name} -%{__install} -m 0644 %{S:1} %{S:2} %{S:3} %{S:4} %{S:5} %{S:6} %{buildroot}/%{_datadir}/doc/%{name} - # create symlinks for sbin_PROGRAMS # because: cf-promises needs to be installed in /var/cfengine/work/bin for pre-validation of full configuration -for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd; do +for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd cf-upgrade; do %{__ln_s} -f ../../..%{_sbindir}/${i} %{buildroot}%{workdir}/bin/${i} done -# Install masterfiles (as %%config(noreplace) ) -%{__install} -d %{buildroot}/%{basedir}/masterfiles -%{__install} -m 0644 masterfiles/def.cf %{buildroot}/%{basedir}/masterfiles -%{__install} -m 0644 masterfiles/promises.cf %{buildroot}/%{basedir}/masterfiles -%{__install} -m 0644 masterfiles/libraries/cfengine_stdlib.cf %{buildroot}/%{basedir}/masterfiles - rm -rf %{buildroot}/%{_libdir}/%{name}/libpromises.la # will appear in %%docdir rm -rf %{buildroot}/%{_datadir}/%{name}/ChangeLog rm -rf %{buildroot}/%{_datadir}/%{name}/README +# create man pages, see https://cfengine.com/dev/issues/2989 +%{__install} -d %{buildroot}/%{_mandir}/man8 +for i in cf-agent cf-execd cf-key cf-monitord cf-promises cf-runagent cf-serverd +do + LD_LIBRARY_PATH=%{buildroot}%{_libdir}/%{name} %{buildroot}%{_sbindir}/$i -M > %{buildroot}%{_mandir}/man8/$i.8 + gzip %{buildroot}%{_mandir}/man8/$i.8 +done + +%if 0%{?suse_version} > 1010 +install -D -m 644 %{S:1} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine +%endif + %if 0%{?suse_version} > 01020 %fdupes %{buildroot}/usr/share/cfengine %endif @@ -268,55 +303,53 @@ # systemd %if 0%{?suse_version} >= 1210 +#################################################################### +# Systemd +#################################################################### + %pre -%service_add_pre cf-execd.service cf-monitord.service +%service_add_pre cf-execd.service cf-monitord.service cf-serverd.service %post -%service_add_post cf-execd.service cf-monitord.service +%service_add_post cf-execd.service cf-monitord.service cf-serverd.service %if 0%{?suse_version} > 1010 %install_info --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz %endif /sbin/ldconfig if [ $1 -lt 2 ]; then + # first install, generate key pair cf-key fi %preun -%service_del_preun cf-execd.service cf-monitord.service +%service_del_preun cf-execd.service cf-monitord.service cf-serverd.service %postun -%service_del_postun cf-execd.service cf-monitord.service +%service_del_postun cf-execd.service cf-monitord.service cf-serverd.service %if 0%{?suse_version} > 1010 %install_info_delete --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz %endif -/sbin/ldconfig - -%pre server -%service_add_pre cf-serverd.service - -%post server -if [ ${1:-0} -ne 1 ]; then - cp -a /usr/share/cfengine/CoreBase/controls /var/cfengine/inputs - cp -a /usr/share/cfengine/CoreBase/libraries /var/cfengine/inputs - cp -a /usr/share/cfengine/CoreBase/services /var/cfengine/inputs +if [ $1 -eq 0 ]; then + # clean up inputs cache dir on removal + rm -rf %{basedir}/inputs/* fi -%service_add_post cf-serverd.service - -%preun server -%service_del_preun cf-serverd.service - -%postun server -%service_del_postun cf-serverd.service +/sbin/ldconfig %else # !systemd +#################################################################### +# Non-systemd +#################################################################### + %preun %if 0%{?suse_version} %stop_on_removal cf-monitord %stop_on_removal cf-execd +%stop_on_removal cf-serverd %else /etc/init.d/cf-execd stop /etc/init.d/cf-monitord stop +/etc/init.d/cf-serverd stop %endif %post @@ -329,13 +362,13 @@ %if 0%{?suse_version} > 1010 %install_info_delete --name=%{name} --info-dir=%{_infodir} %{_infodir}/cf3-reference.info.gz %insserv_cleanup - for i in execd monitord; do + for i in execd monitord serverd; do %restart_on_update cf-${i} done %else # Update ? if [ ${1:-0} -eq 1 ]; then - for i in execd monitord; do + for i in execd monitord serverd; do /etc/init.d/cf-${i} restart done else @@ -344,25 +377,6 @@ %endif /sbin/ldconfig -%preun server -%if 0%{?suse_version} -%stop_on_removal cf-serverd -%else -/etc/init.d/cf-serverd stop -%endif - -%postun server -%if 0%{?suse_version} -%restart_on_update cf-serverd -%else - # Update ? - if [ ${1:-0} -eq 1 ]; then - /etc/init.d/cf-serverd restart - else -: - fi -%endif - %endif # !systemd %post -n %{libsoname} -p /sbin/ldconfig @@ -371,45 +385,38 @@ %files %defattr(-,root,root) -%doc LICENSE -# %doc README -%doc ChangeLog +%doc ChangeLog LICENSE README.md %{_sbindir}/cf-agent %{_sbindir}/cf-execd %{_sbindir}/cf-key %{_sbindir}/cf-monitord %{_sbindir}/cf-promises +%{_sbindir}/cf-serverd +%{_sbindir}/cf-upgrade %{_sbindir}/cf-runagent %{_sbindir}/rpmvercmp %if 0%{?suse_version} >= 1210 %_unitdir/cf-execd.service %_unitdir/cf-monitord.service +%_unitdir/cf-serverd.service %else -%exclude /etc/init.d/cf-serverd %config %attr(0755,root,root) /etc/init.d/* %{_sbindir}/rccf-execd %{_sbindir}/rccf-monitord +%{_sbindir}/rccf-serverd +%endif +%if 0%{?suse_version} > 1010 +%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/cfengine %endif -# %{_mandir}/man?/* +%{_mandir}/man8/* %dir %{basedir} -/var/%{name} -%exclude %{basedir}/backup -%exclude %{basedir}/config -#%%exclude %%{basedir}/failsafe - -%dir %{_datadir}/%{name} -%{_datadir}/%{name}/* %dir %{workdir} %{workdir}/* -%exclude %{workdir}/bin/cf-serverd %config(noreplace) /etc/cron.d/%{name} -%dir %{basedir}/masterfiles -%config(noreplace) %{basedir}/masterfiles/*.cf - %files -n %{libsoname} %defattr(-,root,root) %dir %{_libdir}/%{name} @@ -421,20 +428,10 @@ %files doc %defattr(-,root,root) -%dir %{_datadir}/doc/%{name} -%{_datadir}/doc/%{name}/* +%doc docs/*.pdf -%files server +%files examples %defattr(-,root,root) -%{basedir}/backup -%{basedir}/config -%{_sbindir}/cf-serverd -%{workdir}/bin/cf-serverd -%if 0%{?suse_version} >= 1210 -%_unitdir/cf-serverd.service -%else -/etc/init.d/cf-serverd -%{_sbindir}/rccf-serverd -%endif +%doc examples/*cf %changelog ++++++ 0001-Simplify-and-fix-parsing-of-etc-SuSE-release-fixes-i.patch ++++++ >From 2790065efcf484d5b51e2f5ab410983d9f37c74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <[email protected]> Date: Fri, 11 Apr 2014 09:25:05 +0200 Subject: [PATCH] Simplify and fix parsing of /etc/SuSE-release (fixes issue #5423) This patch is a simplification of sysinfo.c:Linux_Suse_Version() to achieve the following - distinction between "SUSE Linux Enterprise Server" (sles) and "... Desktop" (sled) - distinction between SUSE Linux Enterprise products (suse) and openSUSE (opensuse) - extract version from VERSION and PATCHLEVEL lines instead of first line of /etc/SuSE-release - verified for sles version 9,10,11,12; sled versions 10,11,12, openSUSE 13.1 --- libenv/sysinfo.c | 187 ++++++++++++++++++------------------------------------- 1 file changed, 60 insertions(+), 127 deletions(-) diff --git a/libenv/sysinfo.c b/libenv/sysinfo.c index 72eb71f75d8d..6f2a05fc4cdd 100644 --- a/libenv/sysinfo.c +++ b/libenv/sysinfo.c @@ -1629,6 +1629,7 @@ static int Linux_Suse_Version(EvalContext *ctx) #define SUSE_RELEASE_FLAG "linux " char classbuf[CF_MAXVARSIZE]; + char *vendor = "suse"; Log(LOG_LEVEL_VERBOSE, "This appears to be a SUSE system."); EvalContextClassPutHard(ctx, "SUSE", "inventory,attribute_name=none,source=agent"); @@ -1648,23 +1649,26 @@ static int Linux_Suse_Version(EvalContext *ctx) return 1; } - char vbuf[CF_BUFSIZE], strversion[CF_MAXVARSIZE], strpatch[CF_MAXVARSIZE]; - strversion[0] = '\0'; - strpatch[0] = '\0'; + char vbuf[CF_BUFSIZE]; int major = -1, minor = -1; while (fgets(vbuf, sizeof(vbuf), fp) != NULL) { if (strncmp(vbuf, "VERSION", strlen("version")) == 0) { - strlcpy(strversion, vbuf, sizeof(strversion)); - sscanf(vbuf, "VERSION = %d", &major); + int res; + res = sscanf(vbuf, "VERSION = %d.%d", &major, &minor); + Log(LOG_LEVEL_VERBOSE, "VERSION sscanf returned %d.", res); + if (res < 1) + major = -1; + else if (res < 2) + minor = -1; } if (strncmp(vbuf, "PATCH", strlen("PATCH")) == 0) { - strlcpy(strpatch, vbuf, sizeof(strpatch)); - sscanf(vbuf, "PATCHLEVEL = %d", &minor); + if (sscanf(vbuf, "PATCHLEVEL = %d", &minor) != 1) + minor = -1; } } if (ferror(fp)) @@ -1678,28 +1682,38 @@ static int Linux_Suse_Version(EvalContext *ctx) fclose(fp); - /* Check if it's a SUSE Enterprise version */ + /* Check which SUSE/openSUSE product it is */ - Log(LOG_LEVEL_VERBOSE, "Looking for SUSE enterprise info in '%s'", relstring); + Log(LOG_LEVEL_VERBOSE, "Looking for SUSE product info in '%s'", relstring); - /* Convert relstring to lowercase to handle rename of SuSE to - * SUSE with SUSE 10.0. - */ - - for (int i = 0; i < strlen(relstring); i++) + if (!strncasecmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID))) { - relstring[i] = tolower(relstring[i]); + EvalContextClassPutHard(ctx, "SLES8", "inventory,attribute_name=none,source=agent"); } - - /* Check if it's a SUSE Enterprise version (all in lowercase) */ - - if (!strncmp(relstring, SUSE_SLES8_ID, strlen(SUSE_SLES8_ID))) + else if (!strncasecmp(relstring, SUSE_SLES_ID, strlen(SUSE_SLES_ID))) { - classbuf[0] = '\0'; - strcat(classbuf, "SLES8"); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + EvalContextClassPutHard(ctx, "sles", "inventory,attribute_name=none,source=agent"); + if (major != -1) + { + snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", major); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + } + } + else if (!strncasecmp(relstring, SUSE_SLED_ID, strlen(SUSE_SLED_ID))) + { + EvalContextClassPutHard(ctx, "sled", "inventory,attribute_name=none,source=agent"); + if (major != -1) + { + snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", major); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + } + } + else if (!strncasecmp(relstring, "opensuse", strlen("opensuse"))) + { + vendor = "opensuse"; + EvalContextClassPutHard(ctx, vendor, "inventory,attribute_name=none,source=agent"); } - else if (strncmp(relstring, "sles", 4) == 0) + else if (strncasecmp(relstring, "sles", 4) == 0) { Item *list, *ip; @@ -1717,120 +1731,39 @@ static int Linux_Suse_Version(EvalContext *ctx) } else { - for (int version = 9; version < 13; version++) - { - snprintf(vbuf, CF_BUFSIZE, "%s %d ", SUSE_SLES_ID, version); - Log(LOG_LEVEL_DEBUG, "Checking for SUSE [%s]", vbuf); - - if (!strncmp(relstring, vbuf, strlen(vbuf))) - { - snprintf(classbuf, CF_MAXVARSIZE, "SLES%d", version); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - } - else - { - snprintf(vbuf, CF_BUFSIZE, "%s %d ", SUSE_SLED_ID, version); - Log(LOG_LEVEL_DEBUG, "Checking for SUSE [%s]", vbuf); - - if (!strncmp(relstring, vbuf, strlen(vbuf))) - { - snprintf(classbuf, CF_MAXVARSIZE, "SLED%d", version); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - } - } - } + Log(LOG_LEVEL_WARNING, "Unknown product '%s' in /etc/SuSE-release", relstring); } - /* Determine release version. We assume that the version follows - * the string "SuSE Linux" or "SUSE LINUX". - */ - - char *release = strstr(relstring, SUSE_RELEASE_FLAG); - if (release == NULL) + if (major != -1) { - release = strstr(relstring, "opensuse"); - if (release == NULL) + strncpy(classbuf, vendor, CF_MAXVARSIZE); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", major); + SetFlavour(ctx, classbuf); + if (minor != -1) { - release = strversion; + snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", minor); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); } - } - - if (release == NULL) - { - Log(LOG_LEVEL_VERBOSE, - "Could not find a numeric OS release in %s", - SUSE_REL_FILENAME); - return 2; + /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". + * Keep this for backwards compatibility until CFEngine 3.7 + */ + strncpy(classbuf, "SuSE", CF_MAXVARSIZE); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", major); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + if (minor != -1) + { + snprintf(classbuf + strlen(classbuf), CF_MAXVARSIZE - strlen(classbuf), "_%d", minor); + EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); + } + Log(LOG_LEVEL_VERBOSE, "Discovered %s version %d.%d", vendor, major, minor); } else { - char strmajor[PRINTSIZE(major)], strminor[PRINTSIZE(minor)]; - if (strchr(release, '.')) - { - sscanf(release, "%*s %d.%d", &major, &minor); - sprintf(strmajor, "%d", major); - sprintf(strminor, "%d", minor); - - if (major != -1 && minor != -1) - { - strcpy(classbuf, "SUSE"); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - strcat(classbuf, "_"); - strcat(classbuf, strmajor); - SetFlavour(ctx, classbuf); - strcat(classbuf, "_"); - strcat(classbuf, strminor); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - - /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". - * Keep this for backwards compatibility until CFEngine 3.7 - */ - strcpy(classbuf, "SuSE"); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - strcat(classbuf, "_"); - strcat(classbuf, strmajor); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - strcat(classbuf, "_"); - strcat(classbuf, strminor); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - - Log(LOG_LEVEL_VERBOSE, "Discovered SUSE version %s", classbuf); - return 0; - } - } - else - { - sscanf(strversion, "VERSION = %s", strmajor); - sscanf(strpatch, "PATCHLEVEL = %s", strminor); - - if (major != -1 && minor != -1) - { - strcpy(classbuf, "SLES"); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - strcat(classbuf, "_"); - strcat(classbuf, strmajor); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - strcat(classbuf, "_"); - strcat(classbuf, strminor); - EvalContextClassPutHard(ctx, classbuf, "inventory,attribute_name=none,source=agent"); - - snprintf(classbuf, CF_MAXVARSIZE, "SUSE_%d", major); - SetFlavour(ctx, classbuf); - - /* The correct spelling for SUSE is "SUSE" but CFEngine used to use "SuSE". - * Keep this for backwards compatibility until CFEngine 3.7 - */ - snprintf(classbuf, CF_MAXVARSIZE, "SuSE_%d", major); - EvalContextClassPutHard(ctx, classbuf, "source=agent"); - - Log(LOG_LEVEL_VERBOSE, "Discovered SUSE version %s", classbuf); - return 0; - } - } + Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME); } - Log(LOG_LEVEL_VERBOSE, "Could not find a numeric OS release in %s", SUSE_REL_FILENAME); - return 0; } -- 1.8.4.5 ++++++ cf-execd.service ++++++ --- /var/tmp/diff_new_pack.3Qbnkf/_old 2014-04-17 14:08:02.000000000 +0200 +++ /var/tmp/diff_new_pack.3Qbnkf/_new 2014-04-17 14:08:02.000000000 +0200 @@ -3,6 +3,7 @@ After=syslog.target [Service] +Type=forking ExecStart=/usr/sbin/cf-execd [Install] ++++++ cf-monitord.service ++++++ --- /var/tmp/diff_new_pack.3Qbnkf/_old 2014-04-17 14:08:02.000000000 +0200 +++ /var/tmp/diff_new_pack.3Qbnkf/_new 2014-04-17 14:08:02.000000000 +0200 @@ -3,6 +3,7 @@ After=syslog.target [Service] +Type=forking ExecStart=/usr/sbin/cf-monitord [Install] ++++++ cf-serverd.service ++++++ --- /var/tmp/diff_new_pack.3Qbnkf/_old 2014-04-17 14:08:02.000000000 +0200 +++ /var/tmp/diff_new_pack.3Qbnkf/_new 2014-04-17 14:08:02.000000000 +0200 @@ -3,6 +3,7 @@ After=syslog.target [Service] +Type=forking ExecStart=/usr/sbin/cf-serverd [Install] ++++++ cfengine.SuSEfirewall2 ++++++ ## Name: CFEngine server ## Description: opens ports for CFEngine server in order to be used as a policy hub # space separated list of allowed ports TCP="5308" ++++++ drop-revision.patch ++++++ diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs ../orig-core-3.6rc/configure.ac ./configure.ac --- ../orig-core-3.6rc/configure.ac 2014-04-10 14:27:57.000000000 +0200 +++ ./configure.ac 2014-04-11 09:30:17.105777237 +0200 @@ -25,7 +25,7 @@ dnl _AM_SET_OPTION([tar-ustar]) -AM_INIT_AUTOMAKE(cfengine, 3.6.0rc.revision) +AM_INIT_AUTOMAKE(cfengine, 3.6.0rc) AM_MAINTAINER_MODE([enable]) AC_DEFINE(BUILD_YEAR, esyscmd([date +%Y | tr -d '\n']), "Software build year") -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
