Hello community,
here is the log from the commit of package smartmontools for openSUSE:Factory checked in at 2013-12-08 19:49:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/smartmontools (Old)
and /work/SRC/openSUSE:Factory/.smartmontools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "smartmontools"
Changes:
--------
--- /work/SRC/openSUSE:Factory/smartmontools/smartmontools.changes 2013-08-01 06:56:56.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.smartmontools.new/smartmontools.changes 2013-12-08 19:49:44.000000000 +0100
@@ -1,0 +2,11 @@
+Thu Dec 5 18:52:44 UTC 2013 - sbrabec@suse.com
+
+- Add supplementary drivedb.h update script
+ (smartmontools-drivedb_h-update.sh, bnc#851276).
+- Skip drivedb.h verification by rpm -V (bnc#851276).
+- Implement intelligent drivedb.h update not overwriting newer
+ drivedb.h releases.
+- Update smartmontools-drivedb.h to the latest version from the
+ upstream branch trunk.
+
+-------------------------------------------------------------------
New:
----
smartmontools-drivedb.h
smartmontools-drivedb_h-update.sh
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ smartmontools.spec ++++++
--- /var/tmp/diff_new_pack.NYesyX/_old 2013-12-08 19:49:45.000000000 +0100
+++ /var/tmp/diff_new_pack.NYesyX/_new 2013-12-08 19:49:45.000000000 +0100
@@ -17,6 +17,18 @@
Name: smartmontools
+# Important: When doing a version update that changes DRIVEDB_BRANCH
+# in smartmontools-drivedb_h-update.sh, you have to check,
+# that the packaged drivedb.h has a higher svn release number than any
+# version that exist in older svn branches. If not, you have
+# to implement special case in the %%post section.
+# Numbers in quotes are release numbers on 2013-12-04.
+# http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_5_39_... (3412)
+# http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_5_40_... (3850)
+# http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_5_41_... (3850)
+# http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_5_43_... (3850)
+# http://sourceforge.net/p/smartmontools/code/HEAD/tree/branches/RELEASE_6_0_D... (3850)
+# http://sourceforge.net/p/smartmontools/code/HEAD/tree/trunk/smartmontools/dr... (3856)
Version: 6.2
Release: 0
Source: http://sourceforge.net/projects/smartmontools/files/smartmontools/%{version}/%{name}-%{version}.tar.gz
@@ -24,7 +36,12 @@
Source2: smartmontools.sysconfig
Source3: %{name}-rpmlintrc
Source4: %{name}.keyring
+# SOURCE-FEATURE-OPENSUSE smartmontools.generate_smartd_opts.in sbrabec@suse.cz -- sysconfig support for systemd.
Source5: %{name}.generate_smartd_opts.in
+# SOURCE-FEATURE-SLE smartmontools-drivedb_h-update.sh bnc851276 sbrabec@suse.cz -- Supplementary script to update drivedb.h.
+Source6: smartmontools-drivedb_h-update.sh
+# SOURCE-FEATURE-UPSTREAM smartmontools-drivedb.h bnc851276 sbrabec@suse.cz -- Update of drivedb.h.
+Source7: smartmontools-drivedb.h
# PATCH-FEATURE-UNITEDLINUX smartmontools-default-enabled.patch sbrabec@suse.cz -- Enable smartd by default.
Patch1: smartmontools-default-enabled.patch
# PATCH-FEATURE-OPENSUSE smartmontools-removable.patch sbrabec@suse.cz -- Skip removable devices. (bnc#308557) Report raw temperature.
@@ -79,6 +96,7 @@
%endif
%setup -q
cp -a %{SOURCE2} %{SOURCE5} .
+cp -a %{SOURCE7} drivedb.h
%patch1
%patch4
%patch8 -p1
@@ -127,12 +145,30 @@
cp smartd.service %{buildroot}/%{_unitdir}
# INSTALL file is intended only for packagers.
rm %{buildroot}%{_defaultdocdir}/%{name}/INSTALL
+# Check syntax of drivedb.h that may come from a later snapshot (code from update-smart-drivedb)
+if ./smartctl -B drivedb.h -P showall >/dev/null; then :; else
+ echo "drivedb.h.error: rejected by smartctl, probably no longer compatible" >&2
+ exit 1
+fi
+# Intelligent drivedb.h update, part 0.
+# Check that drivedb.h has well formed svn RELEASE. We will need it for the intelligent update.
+DRIVEDB_H_RELEASE_CHECK="$(sed -n 's/^.*$Id: drivedb.h \([0-9][0-9]*\) .*$/\1/p' <%{buildroot}%{_datadir}/smartmontools/drivedb.h)"
+# Fail if the file has broken release number.
+test "$DRIVEDB_H_RELEASE_CHECK" -ge 0
%clean
rm -rf %{buildroot}
%pre
%service_add_pre smartd.service
+# Intelligent drivedb.h update, part 1.
+# Save installed drivedb.h. Maybe the sysadmin called update-smart-drivedb,
+# and the installed drivedb.h may be even newer than the new packaged one.
+if test -f %{_datadir}/smartmontools/drivedb.h ; then
+ # Be on safe side, remove any potential drivedb.h.rpmsave.
+ rm -f %{_datadir}/smartmontools/drivedb.h.rpmsave
+ ln %{_datadir}/smartmontools/drivedb.h %{_datadir}/smartmontools/drivedb.h.rpmsave
+fi
%post
# First prepare sysconfig.
@@ -144,6 +180,24 @@
%endif
# No start by default here.. belongs to -presets packages
%service_add_post smartd.service
+# Intelligent drivedb.h update, part 2.
+# Now we have the old system drivedb.h and the new packaged drivedb.h.
+if test -f %{_datadir}/smartmontools/drivedb.h.rpmsave ; then
+ # Compare their release numbers.
+ DRIVEDB_H_RELEASE_RPM="$(sed -n 's/^.*$Id: drivedb.h \([0-9][0-9]*\) .*$/\1/p' <%{_datadir}/smartmontools/drivedb.h)"
+ DRIVEDB_H_RELEASE_SAVED="$(sed -n 's/^.*$Id: drivedb.h \([0-9][0-9]*\) .*$/\1/p' <%{_datadir}/smartmontools/drivedb.h.rpmsave)"
+ # File has broken release number. Skip the update.
+ # Note: The SAVED release number may be broken. The test syntax must cover it.
+ if test "$DRIVEDB_H_RELEASE_RPM" -lt "$DRIVEDB_H_RELEASE_SAVED" ; then
+ mv %{_datadir}/smartmontools/drivedb.h.rpmsave %{_datadir}/smartmontools/drivedb.h
+ else
+ # Saved file is older or equal, or saved file has broken release number.
+ rm %{_datadir}/smartmontools/drivedb.h.rpmsave
+ # We returned to the vanilla packages, remove files created by update-smart-drivedb.
+ rm -f %{_datadir}/smartmontools/drivedb.h.old %{_datadir}/smartmontools/drivedb.h.lastcheck
+
+ fi
+fi
%preun
%service_del_preun smartd.service
@@ -154,7 +208,8 @@
%files
%defattr(-, root, root)
%doc %{_docdir}/%{name}
-%{_datadir}/smartmontools
+%dir %{_datadir}/smartmontools
+%verify(not md5 size mtime) %{_datadir}/smartmontools/drivedb.h
%doc %{_mandir}/man*/*
%dir %{_localstatedir}/lib/smartmontools
%if 0%{?suse_version} > 1140
++++++ smartmontools-drivedb.h ++++++
++++ 3655 lines (skipped)
++++++ smartmontools-drivedb_h-update.sh ++++++
#!/bin/bash
set -o errexit
VERSION=`sed -n 's/^Version:[[:space:]]*//p'