commit:     8bf890eba651c222a76f06d2fd3bfdb076cc811e
Author:     James Broadhead <jamesbroadhead <AT> gmail <DOT> com>
AuthorDate: Fri Jan 27 20:11:04 2017 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Jan 27 22:12:19 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bf890eb

sys-apps/smartmontools: fix update warning

- update warning about updating the drivedb, so that it notices the
    useflag
- fix description so that it's short enough (adapted from the
    smartmontools website) -- repoman
- quote some variables -- shellcheck
- update the copy of the warning

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=587372
(cherry picked from commit 890093680d63a1b50d02e6408b55d4d748fcdbdb)
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Fixes: https://github.com/gentoo/gentoo/pull/3114

 sys-apps/smartmontools/smartmontools-6.4-r1.ebuild | 12 ++++++------
 sys-apps/smartmontools/smartmontools-6.4.ebuild    |  4 ++--
 sys-apps/smartmontools/smartmontools-6.5.ebuild    | 21 +++++++++++++--------
 sys-apps/smartmontools/smartmontools-9999.ebuild   | 21 +++++++++++++--------
 4 files changed, 34 insertions(+), 24 deletions(-)

diff --git a/sys-apps/smartmontools/smartmontools-6.4-r1.ebuild 
b/sys-apps/smartmontools/smartmontools-6.4-r1.ebuild
index 3746b94..a5f54df 100644
--- a/sys-apps/smartmontools/smartmontools-6.4-r1.ebuild
+++ b/sys-apps/smartmontools/smartmontools-6.4-r1.ebuild
@@ -14,7 +14,7 @@ else
        KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 
~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux 
~x64-macos"
 fi
 
-DESCRIPTION="Self-Monitoring, Analysis and Reporting Technology System 
(S.M.A.R.T.) monitoring tools"
+DESCRIPTION="Tools to monitor storage systems to provide advanced warning of 
disk degradation"
 HOMEPAGE="https://www.smartmontools.org";
 
 LICENSE="GPL-2"
@@ -72,8 +72,8 @@ src_install() {
                newconfd "${FILESDIR}"/smartd.confd smartd
 
                # Move drivedb.h file out of PM's sight (bug #575292)
-               mv "${ED}"${db_path}/drivedb.h "${T}" || die
-               keepdir ${db_path}
+               mv "${ED}${db_path}/drivedb.h" "${T}" || die
+               keepdir "${db_path}"
 
                exeinto /etc/cron.monthly
                doexe "${FILESDIR}"/${PN}-update-drivedb
@@ -85,14 +85,14 @@ pkg_postinst() {
                local db_path="/var/db/${PN}"
 
                if [[ -f "${db_path}/drivedb.h" ]] ; then
-                       ewarn "WARNING! The drive database file has been 
replaced with the version that"
-                       ewarn "got shipped with this release of ${PN}. You may 
want to update the"
+                       ewarn "WARNING! The existing copy of the drive database 
has been replaced with the version that"
+                       ewarn "was shipped with this release of ${PN}. You may 
want to update the"
                        ewarn "database by running the following command as 
root:"
                        ewarn ""
                        ewarn "/usr/sbin/update-smart-drivedb"
                fi
 
                # Move drivedb.h to /var/db/${PN} (bug #575292)
-               mv "${T}"/drivedb.h ${db_path} || die
+               mv "${T}"/drivedb.h "${db_path}" || die
        fi
 }

diff --git a/sys-apps/smartmontools/smartmontools-6.4.ebuild 
b/sys-apps/smartmontools/smartmontools-6.4.ebuild
index ca0d4ff..49a2c8c 100644
--- a/sys-apps/smartmontools/smartmontools-6.4.ebuild
+++ b/sys-apps/smartmontools/smartmontools-6.4.ebuild
@@ -14,8 +14,8 @@ else
        KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd 
~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~x64-macos"
 fi
 
-DESCRIPTION="Self-Monitoring, Analysis and Reporting Technology System 
(S.M.A.R.T.) monitoring tools"
-HOMEPAGE="http://smartmontools.sourceforge.net/";
+DESCRIPTION="Tools to monitor storage systems to provide advanced warning of 
disk degradation"
+HOMEPAGE="https://www.smartmontools.org";
 
 LICENSE="GPL-2"
 SLOT="0"

diff --git a/sys-apps/smartmontools/smartmontools-6.5.ebuild 
b/sys-apps/smartmontools/smartmontools-6.5.ebuild
index 5d33f5c..ff73205 100644
--- a/sys-apps/smartmontools/smartmontools-6.5.ebuild
+++ b/sys-apps/smartmontools/smartmontools-6.5.ebuild
@@ -14,7 +14,7 @@ else
        KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 
~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux 
~x64-macos"
 fi
 
-DESCRIPTION="Self-Monitoring, Analysis and Reporting Technology System 
(S.M.A.R.T.) monitoring tools"
+DESCRIPTION="Tools to monitor storage systems to provide advanced warning of 
disk degradation"
 HOMEPAGE="https://www.smartmontools.org";
 
 LICENSE="GPL-2"
@@ -68,13 +68,13 @@ src_install() {
                newinitd "${FILESDIR}"/smartd-r1.rc smartd
                newconfd "${FILESDIR}"/smartd.confd smartd
 
-               keepdir ${db_path}
+               keepdir "${db_path}"
                if use update_drivedb ; then
                        # Move drivedb.h file out of PM's sight (bug #575292)
-                       mv "${ED}"${db_path}/drivedb.h "${T}" || die
+                       mv "${ED}${db_path}/drivedb.h" "${T}" || die
 
                        exeinto /etc/cron.monthly
-                       doexe "${FILESDIR}"/${PN}-update-drivedb
+                       doexe "${FILESDIR}/${PN}-update-drivedb"
                fi
        fi
 }
@@ -84,16 +84,21 @@ pkg_postinst() {
                local db_path="/var/db/${PN}"
 
                if [[ -f "${db_path}/drivedb.h" ]] ; then
-                       ewarn "WARNING! The drive database file has been 
replaced with the version that"
-                       ewarn "got shipped with this release of ${PN}. You may 
want to update the"
-                       ewarn "database by running the following command as 
root:"
+                       ewarn "WARNING! The existing copy of the drive database 
has been replaced with the version that"
+                       ewarn "was shipped with this release of ${PN}. You may 
want to update the"
+                       ewarn "database by: "
+
+                       if ! use update_drivedb ; then
+                               ewarn "re-merging ${PN} with 
USE='update_drivedb', then"
+                       fi
+                       ewarn "running the following command as root:"
                        ewarn ""
                        ewarn "/usr/sbin/update-smart-drivedb"
                fi
 
                if use update_drivedb ; then
                        # Move drivedb.h to /var/db/${PN} (bug #575292)
-                       mv "${T}"/drivedb.h ${db_path} || die
+                       mv "${T}"/drivedb.h "${db_path}" || die
                fi
        fi
 }

diff --git a/sys-apps/smartmontools/smartmontools-9999.ebuild 
b/sys-apps/smartmontools/smartmontools-9999.ebuild
index 5d33f5c..ff73205 100644
--- a/sys-apps/smartmontools/smartmontools-9999.ebuild
+++ b/sys-apps/smartmontools/smartmontools-9999.ebuild
@@ -14,7 +14,7 @@ else
        KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 
~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux 
~x64-macos"
 fi
 
-DESCRIPTION="Self-Monitoring, Analysis and Reporting Technology System 
(S.M.A.R.T.) monitoring tools"
+DESCRIPTION="Tools to monitor storage systems to provide advanced warning of 
disk degradation"
 HOMEPAGE="https://www.smartmontools.org";
 
 LICENSE="GPL-2"
@@ -68,13 +68,13 @@ src_install() {
                newinitd "${FILESDIR}"/smartd-r1.rc smartd
                newconfd "${FILESDIR}"/smartd.confd smartd
 
-               keepdir ${db_path}
+               keepdir "${db_path}"
                if use update_drivedb ; then
                        # Move drivedb.h file out of PM's sight (bug #575292)
-                       mv "${ED}"${db_path}/drivedb.h "${T}" || die
+                       mv "${ED}${db_path}/drivedb.h" "${T}" || die
 
                        exeinto /etc/cron.monthly
-                       doexe "${FILESDIR}"/${PN}-update-drivedb
+                       doexe "${FILESDIR}/${PN}-update-drivedb"
                fi
        fi
 }
@@ -84,16 +84,21 @@ pkg_postinst() {
                local db_path="/var/db/${PN}"
 
                if [[ -f "${db_path}/drivedb.h" ]] ; then
-                       ewarn "WARNING! The drive database file has been 
replaced with the version that"
-                       ewarn "got shipped with this release of ${PN}. You may 
want to update the"
-                       ewarn "database by running the following command as 
root:"
+                       ewarn "WARNING! The existing copy of the drive database 
has been replaced with the version that"
+                       ewarn "was shipped with this release of ${PN}. You may 
want to update the"
+                       ewarn "database by: "
+
+                       if ! use update_drivedb ; then
+                               ewarn "re-merging ${PN} with 
USE='update_drivedb', then"
+                       fi
+                       ewarn "running the following command as root:"
                        ewarn ""
                        ewarn "/usr/sbin/update-smart-drivedb"
                fi
 
                if use update_drivedb ; then
                        # Move drivedb.h to /var/db/${PN} (bug #575292)
-                       mv "${T}"/drivedb.h ${db_path} || die
+                       mv "${T}"/drivedb.h "${db_path}" || die
                fi
        fi
 }

Reply via email to