Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Jun 2023 20:14:33 GMT
From:      Oleksii Samorukov <samm@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: bcfaccea10e8 - main - sysutils/smartmontools: fix update-drive-db and hanlde nda(4) devices
Message-ID:  <202306052014.355KEXML000712@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by samm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bcfaccea10e8c273ae693a051a75b53c3a4147ee

commit bcfaccea10e8c273ae693a051a75b53c3a4147ee
Author:     Oleksii Samorukov <samm@FreeBSD.org>
AuthorDate: 2023-06-05 20:12:23 +0000
Commit:     Oleksii Samorukov <samm@FreeBSD.org>
CommitDate: 2023-06-05 20:14:24 +0000

    sysutils/smartmontools: fix update-drive-db and hanlde nda(4) devices
    
    PR: 269535, 266185
---
 sysutils/smartmontools/Makefile                    |  1 +
 .../files/patch-update-smart-drivedb.in            | 56 ++++++++++++++++++++++
 sysutils/smartmontools/files/smart.in              |  2 +-
 3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/sysutils/smartmontools/Makefile b/sysutils/smartmontools/Makefile
index 8b53ce8c25ca..b9a3b337a767 100644
--- a/sysutils/smartmontools/Makefile
+++ b/sysutils/smartmontools/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	smartmontools
 DISTVERSION=	7.3
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	SF
 
diff --git a/sysutils/smartmontools/files/patch-update-smart-drivedb.in b/sysutils/smartmontools/files/patch-update-smart-drivedb.in
new file mode 100644
index 000000000000..786236c5c01a
--- /dev/null
+++ b/sysutils/smartmontools/files/patch-update-smart-drivedb.in
@@ -0,0 +1,56 @@
+--- update-smart-drivedb.in.orig	2022-02-23 21:47:28 UTC
++++ update-smart-drivedb.in
+@@ -8,7 +8,7 @@
+ #
+ # SPDX-License-Identifier: GPL-2.0-or-later
+ #
+-# $Id: update-smart-drivedb.in 5332 2022-02-23 21:47:28Z chrfranke $
++# $Id$
+ #
+ 
+ set -e
+@@ -527,7 +527,7 @@ gpg_verify()
+   # Remove temp home dir, retry on failure
+   i=0
+   while ! out=`rm -f -r "$gnupgtmp" 2>&1`; do
+-    let ++i
++    i=$((i+1))
+     if [ $i -ge 10 ]; then
+       echo "$out" >&2; break
+     fi
+@@ -542,12 +542,14 @@ gpg_verify()
+ get_db_version()
+ {
+   local r v x
+-  x=$(sed -n '/^[ {]*"VERSION: *[^"]*"/{s,^[ {]*"VERSION: \([1-9][./0-9]* [^"]*\)".*$,\1,p;q}' "$1") \
+-  || return 1
++  x=`sed -n '/^[ {]*"VERSION: *[^"]*"/{
++       s,^[ {]*"VERSION: \([1-9][./0-9]* [^"]*\)".*$,\1,p
++       q
++     }' "$1"` || return 1
+   v=${x%% *}
+   test -n "$v" || return 0
+   if [ "${v%/*}" = "$v" ]; then # trunk: get rev from expanded SVN-Id
+-    r=$(echo "$x" | sed -n 's,^[^$]*\$''Id: drivedb\.h \([1-9][0-9]*\) .*$,\1,p')
++    r=`echo "$x" | sed -n 's,^[^$]*\$''Id: drivedb\.h \([1-9][0-9]*\) .*$,\1,p'`
+     test -n "$r" || r="?"
+     v="$v/$r"
+   fi
+@@ -860,7 +862,7 @@ if [ -z "$no_verify" ]; then
+ fi
+ 
+ # Get version
+-newver=$(get_db_version "$drivedb.new")
++newver=`get_db_version "$drivedb.new"`
+ if [ -z "$newver" ]; then
+   if [ -z "$force" ]; then
+     mv_all "$drivedb" ".new" ".error"
+@@ -905,7 +907,7 @@ if [ -n "$equal" ]; then
+ fi
+ 
+ # Check branch and file version
+-oldver=$(get_db_version "$drivedb")
++oldver=`get_db_version "$drivedb"`
+ test -n "$oldver" || oldver="?/?"
+ if    [ "${newver##*/}" = "?" ] \
+    || [ "${oldver##*/}" = "?" ] \
diff --git a/sysutils/smartmontools/files/smart.in b/sysutils/smartmontools/files/smart.in
index f9ceea2bfad1..8460df0f231a 100644
--- a/sysutils/smartmontools/files/smart.in
+++ b/sysutils/smartmontools/files/smart.in
@@ -13,7 +13,7 @@ smartctl=%%PREFIX%%/sbin/smartctl
 case "${daily_status_smart_devices}" in
 	# XXX AUTO mode selects only regular ad/da disks 
 	[Aa][Uu][Tt][Oo])
-		daily_status_smart_devices="$(sysctl -n kern.disks | sed -E 's/[[:<:]](cd|ar|vtbd)[0-9]+//g; s/nvd/nvme/g')"
+		daily_status_smart_devices="$(sysctl -n kern.disks | sed -E 's/[[:<:]](cd|ar|vtbd)[0-9]+//g; s/n(da|vd)/nvme/g')"
 		;;
 	*)	;;
 esac



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306052014.355KEXML000712>