From owner-freebsd-ports@freebsd.org Sat Apr 6 16:02:07 2019 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AA851562E47 for ; Sat, 6 Apr 2019 16:02:07 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 6E94786D74 for ; Sat, 6 Apr 2019 16:02:06 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by mailman.ysv.freebsd.org (Postfix) id 2803D1562E46; Sat, 6 Apr 2019 16:02:06 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15BAA1562E45 for ; Sat, 6 Apr 2019 16:02:06 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DABC86D71 for ; Sat, 6 Apr 2019 16:02:05 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by mail-wr1-x42f.google.com with SMTP id y7so11377703wrn.11 for ; Sat, 06 Apr 2019 09:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adamw-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1BAMvv87MnfyFrZGw4cAgIAmXZxVXHDYgRIaV/OUEBY=; b=wIc0U4aoICBnwvTZ8Orb/P06rkGVe+GZ3CvIGeXZilTjoZ4INm4tMtoQlUKZ14OyPZ 96iYdOrjSwFYX0QbNsluMioZxph73r0MsKvp9XPwMlBRJNqMywd33wricweTjlUZTWE8 uQJYLiKhTFvf58r4AcgLI0pXsT0MlK+MAdVaGrjn9G6y3vFvN9en2CPriWHDJ3AsORDB XnJ7OkBPK4825IwdQcLwHEUMZSVRoPEI7+lioYNUDgUS2nE6eWW5/I7jL+OVvLu/BBqL 6Va15OdyQq9Trch94P4xE2k34IDFV/X/qero+AkzKuD9miAiZwYBTXd9llJFvl0kimyg x4+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1BAMvv87MnfyFrZGw4cAgIAmXZxVXHDYgRIaV/OUEBY=; b=bv8UPBBvemcNJVud+ny+ymJw3qQM3tl/BFp3WjX5WIM/1gdtUusNwS9Beb/YtRnbdI 6bLK3S/66x4W99J9JVKrZhU7RT2r+oj0snG9jKLkD3X53ejwDdqZk2bQAi9BJbHuYPHu oaqysHXs/vjzVf93pSJNAZPOqkSrcawxK7tQVyoVzQx5pZjjZOkCem0u19WPDAyjk5VI TNWEhzwB194vaYydUKPljx+RmTuvV9ixkD2Gcs9svrN7QM8VjUHfbP4rr767j2YbdG+i jHDj+PAg4lMxH9jvCPGsOi3XHIPbotS/s1h1/9/xZWCRDirZ/pZ8sHqJCQN3Rpfvfpbn TgWw== X-Gm-Message-State: APjAAAWgKRkFpPe3673kVtjkcIirAZgebtIigbvn8I9Hv4MIBx1qDTeX bjTiCCVejgev3BXKOGG+pZKIZ955u+QZNgdCh5DBP1E89sg= X-Google-Smtp-Source: APXvYqwhcPusT9BCyHscBVW3MrU+vR268yPSpeRlX1v9anjtLFM5m0gwj2eyey3XSatW0eEGC614p4AyyhhyEeLwHRQ= X-Received: by 2002:adf:de07:: with SMTP id b7mr12285215wrm.196.1554566524240; Sat, 06 Apr 2019 09:02:04 -0700 (PDT) MIME-Version: 1.0 References: <16553fab-03af-9942-93e2-7ebb116487a9@fechner.net> In-Reply-To: <16553fab-03af-9942-93e2-7ebb116487a9@fechner.net> From: Adam Weinberger Date: Sat, 6 Apr 2019 10:01:48 -0600 Message-ID: Subject: Re: How to use @preexec to test for installed packages To: Matthias Fechner Cc: ports@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 8DABC86D71 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Apr 2019 16:02:07 -0000 On Sat, Apr 6, 2019 at 7:59 AM Matthias Fechner 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