commit:     54f3752b3fb9ded157bdc634cc40998750bca525
Author:     Thomas Deutschmann <whissi <AT> whissi <DOT> de>
AuthorDate: Tue Aug  2 12:59:43 2016 +0000
Commit:     Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Wed Aug  3 08:01:25 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54f3752b

net-firewall/shorewall: Fix REPLACING_VERSIONS usage

Gentoo-Bug: https://bugs.gentoo.org/589482

Package-Manager: portage-2.3.0
Closes: https://github.com/gentoo/gentoo/pull/2000

Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>

 net-firewall/shorewall/shorewall-5.0.10.ebuild  | 40 ++++++++++++++-----------
 net-firewall/shorewall/shorewall-5.0.4.ebuild   | 40 ++++++++++++++-----------
 net-firewall/shorewall/shorewall-5.0.7.2.ebuild | 40 ++++++++++++++-----------
 net-firewall/shorewall/shorewall-5.0.9.2.ebuild | 40 ++++++++++++++-----------
 4 files changed, 92 insertions(+), 68 deletions(-)

diff --git a/net-firewall/shorewall/shorewall-5.0.10.ebuild 
b/net-firewall/shorewall/shorewall-5.0.10.ebuild
index f87c043..011c75d 100644
--- a/net-firewall/shorewall/shorewall-5.0.10.ebuild
+++ b/net-firewall/shorewall/shorewall-5.0.10.ebuild
@@ -400,29 +400,35 @@ pkg_postinst() {
 
        fi
 
-       if [[ -n "${REPLACING_VERSIONS}" && ${REPLACING_VERSIONS} < 
${MY_MAJOR_RELEASE_NUMBER} ]]; then
-               # This is an upgrade
+       local v
+       for v in ${REPLACING_VERSIONS}; do
+               if ! version_is_at_least ${MY_MAJOR_RELEASE_NUMBER} ${v}; then
+                       # This is an upgrade
 
-               elog "You are upgrading from a previous major version. It is 
highly recommended that you read"
-               elog ""
-               elog "  - /usr/share/doc/shorewall*/releasenotes.tx*"
-               elog "  - http://shorewall.net/upgrade_issues.htm#idp8704902640";
-
-               if use ipv4; then
-                       elog ""
-                       elog "You can auto-migrate your configuration using"
+                       elog "You are upgrading from a previous major version. 
It is highly recommended that you read"
                        elog ""
-                       elog "  # shorewall update -A"
+                       elog "  - /usr/share/doc/shorewall*/releasenotes.tx*"
+                       elog "  - 
http://shorewall.net/Shorewall-5.html#idp51151872";
 
-                       if use ipv6; then
-                               elog "  # shorewall6 update -A"
+                       if use ipv4; then
+                               elog ""
+                               elog "You can auto-migrate your configuration 
using"
+                               elog ""
+                               elog "  # shorewall update -A"
+
+                               if use ipv6; then
+                                       elog "  # shorewall6 update -A"
+                               fi
+
+                               elog ""
+                               elog "But if you are not familiar with the 
\"shorewall[6] update\" command,"
+                               elog "please read the shorewall[6] man page 
first."
                        fi
 
-                       elog ""
-                       elog "But if you are not familiar with the 
\"shorewall[6] update\" command,"
-                       elog "please read the shorewall[6] man page first."
+                       # Show this elog only once
+                       break
                fi
-       fi
+       done
 
        if ! use init; then
                elog ""

diff --git a/net-firewall/shorewall/shorewall-5.0.4.ebuild 
b/net-firewall/shorewall/shorewall-5.0.4.ebuild
index 0c749b3..5600489 100644
--- a/net-firewall/shorewall/shorewall-5.0.4.ebuild
+++ b/net-firewall/shorewall/shorewall-5.0.4.ebuild
@@ -400,29 +400,35 @@ pkg_postinst() {
 
        fi
 
-       if [[ -n "${REPLACING_VERSIONS}" && ${REPLACING_VERSIONS} < 
${MY_MAJOR_RELEASE_NUMBER} ]]; then
-               # This is an upgrade
+       local v
+       for v in ${REPLACING_VERSIONS}; do
+               if ! version_is_at_least ${MY_MAJOR_RELEASE_NUMBER} ${v}; then
+                       # This is an upgrade
 
-               elog "You are upgrading from a previous major version. It is 
highly recommended that you read"
-               elog ""
-               elog "  - /usr/share/doc/shorewall*/releasenotes.tx*"
-               elog "  - http://shorewall.net/upgrade_issues.htm#idp8704902640";
-
-               if use ipv4; then
-                       elog ""
-                       elog "You can auto-migrate your configuration using"
+                       elog "You are upgrading from a previous major version. 
It is highly recommended that you read"
                        elog ""
-                       elog "  # shorewall update -A"
+                       elog "  - /usr/share/doc/shorewall*/releasenotes.tx*"
+                       elog "  - 
http://shorewall.net/Shorewall-5.html#idp51151872";
 
-                       if use ipv6; then
-                               elog "  # shorewall6 update -A"
+                       if use ipv4; then
+                               elog ""
+                               elog "You can auto-migrate your configuration 
using"
+                               elog ""
+                               elog "  # shorewall update -A"
+
+                               if use ipv6; then
+                                       elog "  # shorewall6 update -A"
+                               fi
+
+                               elog ""
+                               elog "But if you are not familiar with the 
\"shorewall[6] update\" command,"
+                               elog "please read the shorewall[6] man page 
first."
                        fi
 
-                       elog ""
-                       elog "But if you are not familiar with the 
\"shorewall[6] update\" command,"
-                       elog "please read the shorewall[6] man page first."
+                       # Show this elog only once
+                       break
                fi
-       fi
+       done
 
        if ! use init; then
                elog ""

diff --git a/net-firewall/shorewall/shorewall-5.0.7.2.ebuild 
b/net-firewall/shorewall/shorewall-5.0.7.2.ebuild
index 879e1b5..112aa20 100644
--- a/net-firewall/shorewall/shorewall-5.0.7.2.ebuild
+++ b/net-firewall/shorewall/shorewall-5.0.7.2.ebuild
@@ -400,29 +400,35 @@ pkg_postinst() {
 
        fi
 
-       if [[ -n "${REPLACING_VERSIONS}" && ${REPLACING_VERSIONS} < 
${MY_MAJOR_RELEASE_NUMBER} ]]; then
-               # This is an upgrade
+       local v
+       for v in ${REPLACING_VERSIONS}; do
+               if ! version_is_at_least ${MY_MAJOR_RELEASE_NUMBER} ${v}; then
+                       # This is an upgrade
 
-               elog "You are upgrading from a previous major version. It is 
highly recommended that you read"
-               elog ""
-               elog "  - /usr/share/doc/shorewall*/releasenotes.tx*"
-               elog "  - http://shorewall.net/upgrade_issues.htm#idp8704902640";
-
-               if use ipv4; then
-                       elog ""
-                       elog "You can auto-migrate your configuration using"
+                       elog "You are upgrading from a previous major version. 
It is highly recommended that you read"
                        elog ""
-                       elog "  # shorewall update -A"
+                       elog "  - /usr/share/doc/shorewall*/releasenotes.tx*"
+                       elog "  - 
http://shorewall.net/Shorewall-5.html#idp51151872";
 
-                       if use ipv6; then
-                               elog "  # shorewall6 update -A"
+                       if use ipv4; then
+                               elog ""
+                               elog "You can auto-migrate your configuration 
using"
+                               elog ""
+                               elog "  # shorewall update -A"
+
+                               if use ipv6; then
+                                       elog "  # shorewall6 update -A"
+                               fi
+
+                               elog ""
+                               elog "But if you are not familiar with the 
\"shorewall[6] update\" command,"
+                               elog "please read the shorewall[6] man page 
first."
                        fi
 
-                       elog ""
-                       elog "But if you are not familiar with the 
\"shorewall[6] update\" command,"
-                       elog "please read the shorewall[6] man page first."
+                       # Show this elog only once
+                       break
                fi
-       fi
+       done
 
        if ! use init; then
                elog ""

diff --git a/net-firewall/shorewall/shorewall-5.0.9.2.ebuild 
b/net-firewall/shorewall/shorewall-5.0.9.2.ebuild
index f87c043..011c75d 100644
--- a/net-firewall/shorewall/shorewall-5.0.9.2.ebuild
+++ b/net-firewall/shorewall/shorewall-5.0.9.2.ebuild
@@ -400,29 +400,35 @@ pkg_postinst() {
 
        fi
 
-       if [[ -n "${REPLACING_VERSIONS}" && ${REPLACING_VERSIONS} < 
${MY_MAJOR_RELEASE_NUMBER} ]]; then
-               # This is an upgrade
+       local v
+       for v in ${REPLACING_VERSIONS}; do
+               if ! version_is_at_least ${MY_MAJOR_RELEASE_NUMBER} ${v}; then
+                       # This is an upgrade
 
-               elog "You are upgrading from a previous major version. It is 
highly recommended that you read"
-               elog ""
-               elog "  - /usr/share/doc/shorewall*/releasenotes.tx*"
-               elog "  - http://shorewall.net/upgrade_issues.htm#idp8704902640";
-
-               if use ipv4; then
-                       elog ""
-                       elog "You can auto-migrate your configuration using"
+                       elog "You are upgrading from a previous major version. 
It is highly recommended that you read"
                        elog ""
-                       elog "  # shorewall update -A"
+                       elog "  - /usr/share/doc/shorewall*/releasenotes.tx*"
+                       elog "  - 
http://shorewall.net/Shorewall-5.html#idp51151872";
 
-                       if use ipv6; then
-                               elog "  # shorewall6 update -A"
+                       if use ipv4; then
+                               elog ""
+                               elog "You can auto-migrate your configuration 
using"
+                               elog ""
+                               elog "  # shorewall update -A"
+
+                               if use ipv6; then
+                                       elog "  # shorewall6 update -A"
+                               fi
+
+                               elog ""
+                               elog "But if you are not familiar with the 
\"shorewall[6] update\" command,"
+                               elog "please read the shorewall[6] man page 
first."
                        fi
 
-                       elog ""
-                       elog "But if you are not familiar with the 
\"shorewall[6] update\" command,"
-                       elog "please read the shorewall[6] man page first."
+                       # Show this elog only once
+                       break
                fi
-       fi
+       done
 
        if ! use init; then
                elog ""

Reply via email to