Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package smartmontools for openSUSE:Factory checked in at 2025-12-02 13:19:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/smartmontools (Old) and /work/SRC/openSUSE:Factory/.smartmontools.new.14147 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "smartmontools" Tue Dec 2 13:19:08 2025 rev:95 rq:1320673 version:7.5 Changes: -------- --- /work/SRC/openSUSE:Factory/smartmontools/smartmontools.changes 2025-09-26 22:24:42.810494033 +0200 +++ /work/SRC/openSUSE:Factory/.smartmontools.new.14147/smartmontools.changes 2025-12-02 13:19:53.214174744 +0100 @@ -1,0 +2,10 @@ +Sat Nov 8 21:51:07 UTC 2025 - Stanislav Brabec <[email protected]> + +- update-smart-drivedb: Provide support for the new upstream + GitHub repository. (smartmontools-update-smart-drivedb.patch, + refactor smartmontools-drivedb_h-update.sh). +- update-smart-drivedb: Do not overwrite files in /usr/share. Use + /var/lib provided by --with-drivedbinstdir. +- Add smartmontools-drivedb.h version 5894 from the branch 7.5. + +------------------------------------------------------------------- @@ -9 +19 @@ -- Update to 7.5 +- Update to 7.5 (jsc#PED-13806). New: ---- smartmontools-drivedb.h smartmontools-update-smart-drivedb.patch ----------(New B)---------- New:- update-smart-drivedb: Provide support for the new upstream GitHub repository. (smartmontools-update-smart-drivedb.patch, refactor smartmontools-drivedb_h-update.sh). ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ smartmontools.spec ++++++ --- /var/tmp/diff_new_pack.gpaudz/_old 2025-12-02 13:19:54.274219249 +0100 +++ /var/tmp/diff_new_pack.gpaudz/_new 2025-12-02 13:19:54.278219417 +0100 @@ -37,9 +37,11 @@ # SOURCE-FEATURE-SLE smartmontools-drivedb_h-update.sh bnc851276 [email protected] -- Supplementary script to update drivedb.h. Source6: smartmontools-drivedb_h-update.sh # SOURCE-FEATURE-UPSTREAM smartmontools-drivedb.h bnc851276 [email protected] -- Update of drivedb.h. (Following line is handled by smartmontools-drivedb_h-update.sh.) -#Source7: smartmontools-drivedb.h +Source7: smartmontools-drivedb.h Source8: smartd_generate_opts.path Source9: smartd_generate_opts.service +# PATCH-FEATURE-UPSTREAM smartmontools-update-smart-drivedb.patch [email protected] -- Support download from smartmontools migrated to github (cummulative patch). +Patch1: smartmontools-update-smart-drivedb.patch # PATCH-FEATURE-OPENSUSE smartmontools-suse-default.patch [email protected] -- Define smart SUSE defaults. Patch4: smartmontools-suse-default.patch # PATCH-FIX-OPENSUSE smartmontools-var-lock-subsys.patch [email protected] -- Do not use unsupported /var/lock/subsys. @@ -75,10 +77,10 @@ %autosetup -p1 cp -a %{SOURCE2} %{SOURCE5} . # Following line is handled by smartmontools-drivedb_h-update.sh. -#cp -a %{SOURCE7} drivedb.h.new +cp -a %{SOURCE7} drivedb.h.new # # PATCH-FEATURE-OPENSUSE (sed on smartd.service.in) [email protected] -- Use generated smartd_opts (from SUSE sysconfig file). Systemd smartd.service cannot be smart enough to parse SUSE sysconfig file and generate smartd_opts on fly. And we do not want to launch shell just for it in every boot. -sed "s:/usr/local/etc/sysconfig/smartmontools:%{_localstatedir}/lib/smartmontools/smartd_opts:" <smartd.service.in >smartd.service.in.new +sed "s:/usr/local/etc/sysconfig/smartmontools:%{_sharedstatedir}/smartmontools/smartd_opts:" <smartd.service.in >smartd.service.in.new if cmp -s smartd.service.in smartd.service.in.new ; then echo "Failed to modify smartd.service.in" exit 1 @@ -88,10 +90,20 @@ # Check whether drivedb.h from the tarball is older than drivedb.h.new # If yes, replace it. If not, fail. # PACKAGERS: Don't delete this section. It prevents packaging of outdated smartmontools-drivedb.h. +get_db_release() +{ + local v + v=`sed -n '/^[ {]*"VERSION: .*"/{ + s,^[ {]*"VERSION: [1-9][.0-9]*\/\([1-9][0-9]*\)[ "].*$,\1,p + q + }' "$1"` || return 1 + if test -z "$v" ; then v=0 ; fi + echo "$v" +} if test -f drivedb.h.new ; then - UPD_TIME=$(date -d "$(sed -n 's/^.*$Id: drivedb.h [0-9][0-9]* \([^ ]* [^ ]*\) .*$/\1/p' <drivedb.h.new)" +%s) - PCK_TIME=$(date -d "$(sed -n 's/^.*$Id: drivedb.h [0-9][0-9]* \([^ ]* [^ ]*\) .*$/\1/p' <drivedb.h)" +%s) - if test $UPD_TIME -lt $PCK_TIME ; then + UPD_RELEASE=$(get_db_release drivedb.h.new) + PCK_RELEASE=$(get_db_release drivedb.h) + if test $UPD_RELEASE -lt $PCK_RELEASE ; then echo >&2 "Packaging error: Attached smartmontools-drivedb.h is older than the one from the release. Please call \"bash ./smartmontools-drivedb_h-update.sh\" to fix it." exit 1 @@ -108,6 +120,7 @@ --with-selinux\ --with-libsystemd\ --with-systemdsystemunitdir=%{_unitdir}\ + --with-drivedbinstdir\ --with-savestates \ --with-attributelog \ --with-nvme-devicescan @@ -121,8 +134,8 @@ mkdir -p %{buildroot}%{_prefix}/lib/smartmontools mkdir -p %{buildroot}%{_fillupdir} cp smartmontools.sysconfig %{buildroot}%{_fillupdir}/sysconfig.smartmontools -mkdir -p %{buildroot}%{_localstatedir}/lib/smartmontools -touch %{buildroot}%{_localstatedir}/lib/smartmontools/smartd_opts +mkdir -p %{buildroot}%{_sharedstatedir}/smartmontools +touch %{buildroot}%{_sharedstatedir}/smartmontools/smartd_opts install generate_smartd_opts %{buildroot}%{_prefix}/lib/smartmontools/ cat >%{buildroot}%{_sysconfdir}/smart_drivedb.h <<EOF /* smart_drivedb.h: Custom drive database. See also %{_datadir}/smartmontools/drivedb.h. */ @@ -133,7 +146,7 @@ # INSTALL file is intended only for packagers. rm %{buildroot}%{_defaultdocdir}/%{name}/INSTALL # Create empty ghost files for files created by update-smart-drivedb. -touch %{buildroot}%{_datadir}/smartmontools/drivedb.h.{error,lastcheck,old} +touch %{buildroot}%{_sharedstatedir}/smartmontools/drivedb.h{,.{asc,error,error.raw,error.raw.asc,lastcheck,old,old.raw,old.raw.asc,raw,raw.asc}} # 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 @@ -141,8 +154,8 @@ 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)" +# Check that drivedb.h has well formed VERSION. We will need it for the intelligent update. +DRIVEDB_H_RELEASE_CHECK="$(sed -n 's/^.*VERSION: [0-9][0-9.]*\/\([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 # Fail if there is no default_branch= in update-smart-drivedb @@ -150,22 +163,24 @@ %pre %service_add_pre smartd.service smartd_generate_opts.path smartd_generate_opts.service +# These files were generated by update-smart-drivedb before introduction of +# transactional updates, but not all were listed in spec as %%ghost. +# (16.1 and older updated to 7.5) +for EXT in asc error error.raw error.raw.asc lastcheck old old.raw old.raw.asc raw raw.asc ; do + rm -f %{_datadir}/smartmontools/drivedb.h.$EXT +done # Intelligent drivedb.h update, part 1. # Extract drivedb.h branch for installed version. We will need it in %%post. -if test -f %{_sbindir}/update-smart-drivedb ; then +if test -f %{_sharedstatedir}/smartmontools/drivedb.h -a -f %{_sbindir}/update-smart-drivedb ; then BRANCH= - eval $(grep "^BRANCH=\"[^\"]*\"$" %{_sbindir}/update-smart-drivedb) - if test -n "$BRANCH" ; then - echo -n "$BRANCH" >%{_datadir}/smartmontools/drivedb.h.branch.rpmtemp + default_branch= + # BRANCH is old variable name up to 7.2. Starting by 7.3, it is default_branch. + eval $(grep "^\(BRANCH\|default_branch\)=\"[^\"]*\"$" %{_sbindir}/update-smart-drivedb) + if test -n "$default_branch$BRANCH" ; then + mkdir -p %{_sharedstatedir}/smartmontools + echo -n "$default_branch$BRANCH" >%{_sharedstatedir}/smartmontools/drivedb.h.branch.rpmtemp fi fi -# 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. @@ -173,45 +188,48 @@ # Up to Leap 42.3 and SLE 15 SP3 Maintenance Update there was a "Command" meta comment in the sysconfig file. # It is not needed any more, but fillup does not delete it. Do it explicitly. (bsc#1195785, bsc#1196103) sed -i '\@^##[[:space:]]*Command:[[:space:]]*%{_prefix}/lib/smartmontools/generate_smartd_opts$@d' %{_sysconfdir}/sysconfig/smartmontools -# Then generate initial %%{_localstatedir}/lib/smartmontools/smartd_opts needed by smartd.service. +# Then generate initial %%{_sharedstatedir}/smartmontools/smartd_opts needed by smartd.service. SMARTD_SKIP_INIT=1 %{_prefix}/lib/smartmontools/generate_smartd_opts # No start by default here.. belongs to -presets packages %service_add_post smartd.service smartd_generate_opts.path smartd_generate_opts.service +# This file may be kept from <= 7.4 or pre-GitHub 7.5. Drop it, as it is probably incompatible. +rm -f %{_datadir}/smartmontools/drivedb.h.rpmsave # Intelligent drivedb.h update, part 2. -# Now we have the old system drivedb.h.rpmsave and the new packaged drivedb.h. -if test -f %{_datadir}/smartmontools/drivedb.h.rpmsave ; then +smartdb_purge() { + rm -f %{_sharedstatedir}/smartmontools/drivedb.h + for EXT in asc error error.raw error.raw.asc lastcheck old old.raw old.raw.asc raw raw.asc ; do + rm -f %{_sharedstatedir}/smartmontools/drivedb.h.$EXT + done +} +get_db_release() +{ + local v + v=`sed -n '/^[ {]*"VERSION: .*"/{ + s,^[ {]*"VERSION: [1-9][.0-9]*\/\([1-9][0-9]*\)[ "].*$,\1,p + q + }' "$1"` || return 1 + if test -z "$v" ; then v=0 ; fi + echo "$v" +} +if test -f %{_sharedstatedir}/smartmontools/drivedb.h.branch.rpmtemp ; then +# Extract drivedb.h branch for installed version. + default_branch= + eval $(grep "default_branch=\"[^\"]*\"$" %{_sbindir}/update-smart-drivedb) + if test -n "$default_branch" ; then + if test "$default_branch" != "$(cat %{_sharedstatedir}/smartmontools/drivedb.h.branch.rpmtemp)" ; then + # incompatible branches + smartdb_purge + else # 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)" - # Note: The SAVED release number may be broken. The test syntax must cover it and replace old file. - if test "$DRIVEDB_H_RELEASE_RPM" -lt "${DRIVEDB_H_RELEASE_SAVED:-0}" ; then - # If it is an update to the new branch, always replace the database. - # Extract drivedb.h branch for the new version to default_branch. - eval $(grep "^default_branch=\"[^\"]*\"$" %{_sbindir}/update-smart-drivedb) - OLD_BRANCH= - if test -f %{_datadir}/smartmontools/drivedb.h.branch.rpmtemp ; then - OLD_BRANCH=$(<%{_datadir}/smartmontools/drivedb.h.branch.rpmtemp) + DRIVEDB_H_RELEASE_RPM="$(get_db_release %{_datadir}/smartmontools/drivedb.h)" + DRIVEDB_H_RELEASE_UPD="$(get_db_release %{_sharedstatedir}/smartmontools/drivedb.h)" + if test "${DRIVEDB_H_RELEASE_RPM:-0}" -ge "${DRIVEDB_H_RELEASE_UPD:-0}" ; then + smartdb_purge fi - if test "$default_branch" = "$OLD_BRANCH" ; then - # It is safe to keep later version of installed database. - mv %{_datadir}/smartmontools/drivedb.h.rpmsave %{_datadir}/smartmontools/drivedb.h - else - # Saved file needs to be replaced. - 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.{error,lastcheck,old} - echo >&2 "%{name} updated to a version that requires new branch of drivedb.h" - echo >&2 "Replacing your custom drivedb.h." - echo >&2 "You may need to call update-smart-drivedb." fi - 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.{error,lastcheck,old} fi fi -rm -f %{_datadir}/smartmontools/drivedb.h.branch.rpmtemp +rm -f %{_sharedstatedir}/smartmontools/drivedb.h.branch.rpmtemp # Before Leap 15 / SLE 15, there was a incorrect configuration of self tests (bsc#1073918). # Perform a fix of this nonsense, even if the noreplace configuration file was edited. if grep -q -F -- '-s S/../.././03 -s L/../(01|02|03|04|05|06|07)/7/01' %{_sysconfdir}/smartd.conf ; then @@ -225,19 +243,27 @@ %service_del_postun smartd.service smartd_generate_opts.path smartd_generate_opts.service # Clean all attrlogs and state files. if test "$1" = 0 ; then - rm -rf %{_localstatedir}/lib/smartmontools + rm -rf %{_sharedstatedir}/smartmontools fi %files %doc %{_docdir}/%{name} %dir %{_datadir}/smartmontools %verify(not md5 size mtime) %{_datadir}/smartmontools/drivedb.h -%ghost %{_datadir}/smartmontools/drivedb.h.error -%ghost %{_datadir}/smartmontools/drivedb.h.lastcheck -%ghost %{_datadir}/smartmontools/drivedb.h.old %{_mandir}/man*/* -%dir %{_localstatedir}/lib/smartmontools -%ghost %{_localstatedir}/lib/smartmontools/smartd_opts +%dir %{_sharedstatedir}/smartmontools +%ghost %{_sharedstatedir}/smartmontools/smartd_opts +%ghost %{_sharedstatedir}/smartmontools/drivedb.h +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.asc +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.error +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.error.raw +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.error.raw.asc +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.lastcheck +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.old +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.old.raw +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.old.raw.asc +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.raw +%ghost %{_sharedstatedir}/smartmontools/drivedb.h.raw.asc %{_prefix}/lib/smartmontools %{_unitdir}/* %{_sbindir}/* ++++++ smartmontools-drivedb.h ++++++ ++++ 7058 lines (skipped) ++++++ smartmontools-drivedb_h-update.sh ++++++ --- /var/tmp/diff_new_pack.gpaudz/_old 2025-12-02 13:19:54.418225296 +0100 +++ /var/tmp/diff_new_pack.gpaudz/_new 2025-12-02 13:19:54.430225799 +0100 @@ -9,6 +9,19 @@ set -o errexit +# get_db_version DRIVEDB > VERSION +get_db_version() +{ + local v + v=`sed -n '/^[ {]*"VERSION: .*"/{ + s,^[ {]*"VERSION: \([1-9][./0-9]*\)[ "].*$,\1,p + q + }' "$1"` || return 1 + test -n "$v" || return 0 + test "${v%/*}" != "$v" || v="$v/?" + echo "$v" +} + VERSION=`sed -n 's/^Version:[[:space:]]*//p' <smartmontools.spec` WORKDIR="smartmontools-drivedb_h-update.tmp" @@ -17,7 +30,7 @@ mkdir "$WORKDIR" cd "$WORKDIR" -tar -zxf ../smartmontools-$VERSION.tar.gz smartmontools-$VERSION/update-smart-drivedb.in smartmontools-$VERSION/configure smartmontools-$VERSION/drivedb.h +tar --wildcards -zxf ../smartmontools-$VERSION.tar.gz "smartmontools-$VERSION/update-smart-drivedb.*" "smartmontools-$VERSION/configure*" smartmontools-$VERSION/drivedb.h # There can be script update. # TODO: This patch can be generated automatically. if test -f ../smartmontools-update-smart-drivedb.patch ; then @@ -26,7 +39,7 @@ # Extract expression that derives DRIVEDB_BRANCH from the version string # (from configure, to not include autoconf square brackets): -eval "$(sed -n -e '/^[^ ]*drivedb_version=/p; /^DRIVEDB_BRANCH=/,/`/p' <smartmontools-$VERSION/configure)" +eval "$(sed -n -e '/^[^ ]*drivedb_version=/p; /^DRIVEDB_BRANCH=/,/^$/p' <smartmontools-$VERSION/configure)" if test -z "$DRIVEDB_BRANCH"; then echo "Unable to derive DRIVEDB_BRANCH from VERSION=$VERSION." cd - >/dev/null @@ -35,7 +48,14 @@ fi BRANCHNAME=$DRIVEDB_BRANCH -PCK_TIME=$(date -d "$(sed -n 's/^.*$Id: drivedb.h [0-9][0-9]* \([^ ]* [^ ]*\) .*$/\1/p' <smartmontools-$VERSION/drivedb.h)" +%s) +DEF_VERSION=$(get_db_version smartmontools-$VERSION/drivedb.h) +if test -f ../smartmontools-drivedb.h ; then + PCK_VERSION=$(get_db_version ../smartmontools-drivedb.h) + PCK_DRIVEDB=../smartmontools-drivedb.h +else + PCK_VERSION=$DEF_VERSION + PCK_DRIVEDB=smartmontools-$VERSION/drivedb.h +fi echo "Updating drivedb.h for branch $DRIVEDB_BRANCH." @@ -55,15 +75,19 @@ chmod +x update-smart-drivedb-wd # Verification of the downloaded drivedb.h has to be done by the packaged smartctl. # Skip it on the host system, and run it as part of %build stage. -./update-smart-drivedb-wd -u trac -s - +./update-smart-drivedb-wd -u github -s - +if test -f drivedb.h ; then + mv drivedb.h smartmontools-drivedb.h +fi rm -f "$DEST.lastcheck" rm -f "$DEST.old" # Compare time (file in the drivedb branch can be older) and compare # files without Id (files can be equal but committed in two commits). -UPD_TIME=$(date -d "$(sed -n 's/^.*$Id: drivedb.h [0-9][0-9]* \([^ ]* [^ ]*\) .*$/\1/p' <../smartmontools-drivedb.h)" +%s) -sed '/^.*$Id:/d' <smartmontools-$VERSION/drivedb.h >drivedb-noid.h -sed '/^.*$Id:/d' <../smartmontools-drivedb.h >smartmontools-drivedb-noid.h + +UPD_VERSION=$(get_db_version smartmontools-drivedb.h) +sed '/"VERSION: /d' <smartmontools-$VERSION/drivedb.h >drivedb-noid.h +sed '/"VERSION: /d' <smartmontools-drivedb.h >smartmontools-drivedb-noid.h if cmp -s drivedb-noid.h smartmontools-drivedb-noid.h ; then EQUAL=true else @@ -73,7 +97,17 @@ # Return to the OSC repository and perform needed changes. cd - >/dev/null -if test $EQUAL = true -o \( $UPD_TIME -le $PCK_TIME \) ; then +DEF_VER=${DEF_VERSION#*/} +if test "$DEF_VER" = "?" ; then + DEF_VER=0 +fi +PCK_VER=${PCK_VERSION#*/} +if test "$PCK_VER" = "?" ; then + PCK_VER=0 +fi + +UPD_VER=${UPD_VERSION#*/} +if test $EQUAL = true -o \( $UPD_VER -le $DEF_VER \) ; then echo "No drivedb.h update available." if test -f smartmontools-drivedb.h ; then osc rm --force smartmontools-drivedb.h ++++++ smartmontools-update-smart-drivedb.patch ++++++ ++++ 861 lines (skipped)
