net-firewall/shorewall: Fix REPLACING_VERSIONS usage
authorThomas Deutschmann <whissi@whissi.de>
Tue, 2 Aug 2016 12:59:43 +0000 (14:59 +0200)
committerPatrice Clement <monsieurp@gentoo.org>
Wed, 3 Aug 2016 08:01:25 +0000 (10:01 +0200)
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@gentoo.org>
net-firewall/shorewall/shorewall-5.0.10.ebuild
net-firewall/shorewall/shorewall-5.0.4.ebuild
net-firewall/shorewall/shorewall-5.0.7.2.ebuild
net-firewall/shorewall/shorewall-5.0.9.2.ebuild

index f87c043d2af8a32fce3747153f7c748394af6612..011c75dde90e0757105961cd4abd4fde3154efc7 100644 (file)
@@ -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 ""
index 0c749b300094b8b7c8d251eeacb26db6eb9e7f8d..56004893d4af787394e4fa630da15a17d28771b7 100644 (file)
@@ -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 ""
index 879e1b54a943a2ccd7826d6c86d3046666e4445c..112aa2077c1f2eaf7a208b0bb840014b6e70aa45 100644 (file)
@@ -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 ""
index f87c043d2af8a32fce3747153f7c748394af6612..011c75dde90e0757105961cd4abd4fde3154efc7 100644 (file)
@@ -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 ""