See the tracker bug. if [[ ${REPLACING_VERSIONS} < 1.3.0 ]]; then This doesn't account for empty RV or having >1 value.
Plus using < lexicographical string comparison on versions.
Created attachment 469302 [details, diff] Fixed the issue with REPLACING_VERSIONS regarding the >1.3.0 or none
Comment on attachment 469302 [details, diff] Fixed the issue with REPLACING_VERSIONS regarding the >1.3.0 or none --- origi 2017-04-06 01:57:58.036602203 +0300 +++ if-rv-fix 2017-04-06 01:57:49.115602024 +0300 @@ -1,3 +1,4 @@ + # Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 @@ -159,16 +160,24 @@ cp -pPR "${f}" "${EROOT}"/var/lib/nfs/ done - if systemd_is_booted; then - if [[ ${REPLACING_VERSIONS} < 1.3.0 ]]; then + if [[ ${REPLACING_VERSIONS} < 1.3.0 ]]; then + if systemd_is_booted; then ewarn "We have switched to upstream systemd unit files. Since" ewarn "they got renamed, you should probably enable the new ones." ewarn "You can run 'equery files nfs-utils | grep systemd'" ewarn "to know what services you need to enable now." + else + ewarn "If you use OpenRC, the nfsmount service has been replaced with nfsclient." + ewarn "If you were using nfsmount, please add nfsclient and netmount to the" + ewarn "same runlevel as nfsmount." fi - else - ewarn "If you use OpenRC, the nfsmount service has been replaced with nfsclient." - ewarn "If you were using nfsmount, please add nfsclient and netmount to the" - ewarn "same runlevel as nfsmount." fi }
Created attachment 469306 [details, diff] UPDATED:Fixed the issue with REPLACING_VERSIONS This one works.
Comment on attachment 469306 [details, diff] UPDATED:Fixed the issue with REPLACING_VERSIONS This does not solve the issue in question, and please do not hijack bugs with your own issues.
(In reply to Michał Górny from comment #6) > Comment on attachment 469306 [details, diff] [details, diff] > UPDATED:Fixed the issue with REPLACING_VERSIONS > > This does not solve the issue in question, and please do not hijack bugs > with your own issues. Sorry, I did read it wrong. My Intention was to help. Best wishes
(In reply to Michał Górny from comment #0) > See the tracker bug. > > if [[ ${REPLACING_VERSIONS} < 1.3.0 ]]; then > > This doesn't account for empty RV or having >1 value. Hello, I have written the following code, as an attempt to fix the issue here. First I tried to fix it by including get_major_version, get_version_component_range but the code was becoming unnecessary complicated. For that, a solution was to use version_is_at_least, which is more unstable ( by it's description), but gives answer to the problem with fewer lines. The ! version_is_at_least was inspired from a solution you've given to a bug page with related content. In addition to that, I've used ${parameter:-default} to shield the code from not-set / null cases. # Fixes for ( not set/null or >1 ) REPLACING_VERSIONS # local var=version local version if systemd_is_booted; then # Do at least one check {var:-X} in case of not set / null for version in ${REPLACING_VERSIONS:-1}; do if ! version_is_at_least 1.3.0 ${version:-1.3.0}; then # Prints the following for version <= 1.3.0 or for not set / null case ewarn "We have switched to upstream systemd unit files. Since" ewarn "they got renamed, you should probably enable the new ones." ewarn "You can run 'equery files nfs-utils | grep systemd'" ewarn "to know what services you need to enable now." else # Print print information for >1 version case ewarn "We have switched to upstream systemd unit files." fi done else ewarn "If you use OpenRC, the nfsmount service has been replaced with..." ewarn "If you were using nfsmount, please add nfsclient and netmount to the" ewarn "same runlevel as nfsmount." fi
Created attachment 469576 [details, diff] nfs-utils-1.3.1-r5.ebuild.patch
Created attachment 469578 [details, diff] nfs-utils-1.3.1-r5.ebuild.patch
Created attachment 469584 [details, diff] nfs-utils-2.1.1.ebuild.patch This patch applies to all versions.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f9dc630bef434841f8b8a6f9ba6f263a0d1cd70 commit 8f9dc630bef434841f8b8a6f9ba6f263a0d1cd70 Author: Matt Turner <mattst88@gentoo.org> AuthorDate: 2019-09-02 05:42:22 +0000 Commit: Matt Turner <mattst88@gentoo.org> CommitDate: 2019-09-02 07:08:13 +0000 net-fs/nfs-utils: Don't assume REPLACING_VERSIONS is singular Closes: https://bugs.gentoo.org/589488 Signed-off-by: Matt Turner <mattst88@gentoo.org> net-fs/nfs-utils/nfs-utils-2.3.3.ebuild | 14 ++++++++------ net-fs/nfs-utils/nfs-utils-2.3.4.ebuild | 14 ++++++++------ net-fs/nfs-utils/nfs-utils-2.4.1.ebuild | 14 ++++++++------ 3 files changed, 24 insertions(+), 18 deletions(-)