Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Apr 2019 10:01:48 -0600
From:      Adam Weinberger <adamw@adamw.org>
To:        Matthias Fechner <idefix@fechner.net>
Cc:        ports@freebsd.org
Subject:   Re: How to use @preexec to test for installed packages
Message-ID:  <CAP7rwciFjNT3TqMZTw3JWemeMxUBM8Zo-LMGVonP_bqocP676Q@mail.gmail.com>
In-Reply-To: <16553fab-03af-9942-93e2-7ebb116487a9@fechner.net>
References:  <16553fab-03af-9942-93e2-7ebb116487a9@fechner.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 6, 2019 at 7:59 AM Matthias Fechner <idefix@fechner.net> wrote:
>
> Dear all,
>
> as pkg cannot handle CONFLICTS_INSTALL I tried now to implement this as
> a preinstall command using @preexec in pkg-plist.
>
> The command should check if a package is installed and stop the
> installation or continue if the package is not installed.
>
> I tried it with the following command:
> @preexec `/usr/sbin/pkg -N info -e gogs`; if [ $? -eq 0 ]; then echo
> "Gitlab cannot be installed together with gogs as both of them modify
> .ssh/authorized_keys" && exit 1; else echo "Gogs not installed,
> continue."; fi
>
> But it does not work.
> Now matter if gogs is installed or not.
> If I execute the same line in a shell script, it works fine.
>
> Anyone an idea?

What you're describing is
Makefile:
  CONFLICTS_INSTALL= gogs



-- 
Adam Weinberger
adamw@adamw.org
https://www.adamw.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAP7rwciFjNT3TqMZTw3JWemeMxUBM8Zo-LMGVonP_bqocP676Q>