Hi,

while testing I noticed the following error:

>>>> Install shorewall-init-4.5.21_rc1 into 
>>>> /var/tmp/portage/net-firewall/shorewall-init-4.5.21_rc1/image/ category 
>>>> net-firewall
> Installing Gentoo-specific configuration...
> Installing Shorewall Init Version 4.5.21-RC1
> SysV init script init.gentoo.sh installed in 
> /var/tmp/portage/net-firewall/shorewall-init-4.5.21_rc1/image//etc/init.d/shorewall-init
> Service file gentoo.service installed as 
> /var/tmp/portage/net-firewall/shorewall-init-4.5.21_rc1/image//usr/lib/systemd/system/shorewall-init.service
> CLI installed as 
> /var/tmp/portage/net-firewall/shorewall-init-4.5.21_rc1/image//sbin/shorewall-init
> Logrotate file installed as 
> /var/tmp/portage/net-firewall/shorewall-init-4.5.21_rc1/image//etc/logrotate.d/shorewall-init
> ./install.sh: line 388: return: can only `return' from a function or sourced 
> script
> default.gentoo installed in 
> /var/tmp/portage/net-firewall/shorewall-init-4.5.21_rc1/image//etc/conf.d/shorewall-init
> shorewall Init Version 4.5.21-RC1 Installed
>>>> Completed installing shorewall-init-4.5.21_rc1 into 
>>>> /var/tmp/portage/net-firewall/shorewall-init-4.5.21_rc1/image/

That's an error introduced with my Gentoo support patch (commit
45242811630cac816dff70a65e79116cd4b28b37) and only affects install.sh on
Gentoo.

Please see the attached patch. Thanks!


-Thomas
From 14d016cfb3ba5a9132b3e4339be12605a8bdc2dc Mon Sep 17 00:00:00 2001
From: Thomas D <[email protected]>
Date: Mon, 30 Sep 2013 17:03:48 +0200
Subject: [PATCH] Use '/bin/true' instead of 'return' for empty if block

This patch fixes the following error I noticed while testing
Shorewall-4.5.21-RC1:

   ./install.sh: line 388: return: can only `return' from a function or sourced 
script

This was introduced with my commit 45242811630cac816dff70a65e79116cd4b28b37,
which added Gentoo support.

Using '/bin/true' instead of 'return' fixes the problem.
---
 Shorewall-init/install.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh
index 4b659df..6c221dd 100755
--- a/Shorewall-init/install.sh
+++ b/Shorewall-init/install.sh
@@ -385,7 +385,7 @@ else
                mkdir -p ${DESTDIR}${SYSCONFDIR}/network/if-down.d
            elif [ $HOST = gentoo ]; then
                # Gentoo does not support if-{up,down}.d
-               return
+               /bin/true
            else
                mkdir -p ${DESTDIR}/etc/NetworkManager/dispatcher.d
            fi
@@ -460,7 +460,7 @@ if [ -z "$DESTDIR" ]; then
        elif [ $HOST = gentoo ]; then
            # On Gentoo, a service must be enabled manually by the user,
            # not by the installer
-           return
+           /bin/true
        else
            if [ -n "$SYSTEMD" ]; then
                if systemctl enable shorewall-init.service; then
-- 
1.8.3.2

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to