From nobody Sun Oct 8 16:16:59 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S3S43094vz4wRWH; Sun, 8 Oct 2023 16:17:23 +0000 (UTC) (envelope-from dan@langille.org) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4S3S425J53z3R75; Sun, 8 Oct 2023 16:17:22 +0000 (UTC) (envelope-from dan@langille.org) Authentication-Results: mx1.freebsd.org; none Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 890C25C01BC; Sun, 8 Oct 2023 12:17:21 -0400 (EDT) Received: from imap47 ([10.202.2.97]) by compute7.internal (MEProxy); Sun, 08 Oct 2023 12:17:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=langille.org; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1696781841; x=1696868241; bh=nG gK08UdwFXMVycLIKxU6T8TeRI9qRV5QzvZ9A005wk=; b=misQNYUj0tuLUpGQ9f MVTBotG3IMDzVCmYDIJzZiY/A4zbVHtKR1+X6s2K2IeOZYEibqYOoJ51OWDAU6FY 0r5Ef637uIuMGE/u+CJB3Hr+nUsW4JDhO5eKBvllRZRSRtvegVJLb7IoQReFx4ri TauPvpA9UzO2TxL+0hH3HEn8/M78oIgIunXTOZzQ8Vmz2cbuxgKrZo0Ka0myzgsz dGwHiDXUwpE4ClFozst8DbF94qzhOs7xdV3jC0iRaQJyBUbNcrSoP8oVrqlJgN3O bKcCWkEacISbRQcSTRiEMAmUCeUYtTUxGgvL5+XnUkbM/K1or3xQiqIiFBl5rzcb cN0A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1696781841; x=1696868241; bh=nGgK08UdwFXMV ycLIKxU6T8TeRI9qRV5QzvZ9A005wk=; b=MEGejAKpHsoQ+QTlZwBFMS5M1j77c 2iWJMd8WbXtFGGSHkz02S0Z5eWzY1ifChW8lMr8+i9Q1hS3T/5d3sV5PgTXERqUs GlfEUTNr7bYIS9789zZWV77OY5d7Zx3OAwvAYuIMrVSREfdCPTeZna1QyPd5JE+9 BVYvSpbEG2wWCnWDO9VVhbPWmJKvloh8/5727kblEjPdFAYUu49/6Xvs8GNEYJZ9 ZqLciTmH86zG6w5bhzIGIcl3bVB5XWcYJ+8P0vGS3tMOkyZab1GBt2I7BHK21UJN YmMIMfEQCAF0xQBP9OTiSlyiXNCEh+RgsMtlgHA7ze4IYig57ZhN6oGrA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrhedugddutddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedfffgr nhcunfgrnhhgihhllhgvfdcuoegurghnsehlrghnghhilhhlvgdrohhrgheqnecuggftrf grthhtvghrnhepheegvdetieeitddviedvhfdvleettdfhhfdujefgjefhleeuleeuhfeg ieeiffdtnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepuggrnheslhgrnhhgihhllhgvrdho rhhg X-ME-Proxy: Feedback-ID: ifbf9424e:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3B975A60077; Sun, 8 Oct 2023 12:17:21 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-958-g1b1b911df8-fm-20230927.002-g1b1b911d List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Message-Id: In-Reply-To: References: <202310071152.397BqxAf037182@gitrepo.freebsd.org> Date: Sun, 08 Oct 2023 12:16:59 -0400 From: "Dan Langille" To: "Sergey A. Osokin" , dvl Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Subject: Re: git: 73922d6b363a - main - net-mgmt/librenms: Fix start on FreeBSD 14/nginx Content-Type: text/plain X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:19151, ipnet:66.111.4.0/24, country:US] X-Rspamd-Queue-Id: 4S3S425J53z3R75 On Sun, Oct 8, 2023, at 10:54 AM, Sergey A. Osokin wrote: > Hi Dan, > > On Sat, Oct 07, 2023 at 11:52:59AM +0000, Dan Langille wrote: >> The branch main has been updated by dvl: >> >> URL: https://cgit.FreeBSD.org/ports/commit/?id=73922d6b363a6902a05721d9102386ce657b03d4 >> >> commit 73922d6b363a6902a05721d9102386ce657b03d4 >> Author: Dan Langille >> AuthorDate: 2023-10-07 11:49:41 +0000 >> Commit: Dan Langille >> CommitDate: 2023-10-07 11:49:41 +0000 >> >> net-mgmt/librenms: Fix start on FreeBSD 14/nginx >> >> This may be a path issue or a shell issue, but nginx on FreeBSD 14 >> is not finding /usr/local/bin/php. The fix: use /usr/local/bin/php >> as we have done with other patches. >> >> +- base = ("/usr/bin/env", "php") >> ++ base = ("/usr/local/bin/php",) > > Would that be better to use %%PREFIX%% in a patch and substitute > that with a value of the ${LOCALBASE} variable in a post-patch > phase? This is a great idea. I know the port is already doing this for other locations in the code. There are other patches which need this adjustment as well. This is my planned (and hand pasted patch, don't trust it): [16:15 pkg01 dan ~/ports/head/net-mgmt/librenms] % git diff diff --git a/net-mgmt/librenms/Makefile b/net-mgmt/librenms/Makefile index 1b64004a9593..f9a2dd2caa0b 100644 --- a/net-mgmt/librenms/Makefile +++ b/net-mgmt/librenms/Makefile @@ -1,6 +1,6 @@ PORTNAME= librenms PORTVERSION= 23.9.1 -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= net-mgmt MASTER_SITES= LOCAL/dvl:vendor @@ -151,6 +151,8 @@ _OTHER_DIRS= database/seeders/config html/plugins html/js/lang \ post-patch: ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/LibreNMS/Validations/Php.php + ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/LibreNMS/__init__.py + ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/LibreNMS/wrapper.py ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/LibreNMS/Util/Version.php ${REINPLACE_CMD} 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/LibreNMS/Util/Version.php ${REINPLACE_CMD} 's|%%RELEASE_TIMESTAMP%%|${_RELEASE_TIMESTAMP}|g' ${WRKSRC}/LibreNMS/Util/Version.php @@ -158,6 +160,7 @@ post-patch: ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/includes/html/output/capture.inc.php ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/config.php.default ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/poller-wrapper.py + ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/snmp-scan.py ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/dist/librenms-scheduler.cron ${REINPLACE_CMD} 's|%%WWWDIR%%|${WWWDIR}|g' ${WRKSRC}/dist/librenms-scheduler.cron ${REINPLACE_CMD} 's|%%USER%%|${WWWOWN}|g' ${WRKSRC}/dist/librenms-scheduler.cron diff --git a/net-mgmt/librenms/files/patch-LibreNMS_Validations_System.php b/net-mgmt/librenms/files/patch-LibreNMS_Validations_System.php index 744b3533df01..961ebfbeaaac 100644 --- a/net-mgmt/librenms/files/patch-LibreNMS_Validations_System.php +++ b/net-mgmt/librenms/files/patch-LibreNMS_Validations_System.php @@ -5,7 +5,7 @@ $install_dir = $validator->getBaseDir(); - $lnms = str_replace('lnms:', '', rtrim(`whereis -b lnms 2>/dev/null`)); -+ $lnms = rtrim(`/usr/bin/find /usr/local/bin -name lnms`); ++ $lnms = rtrim(`/usr/bin/find %%LOCALBASE%%/bin -name lnms`); $path = rtrim(`echo "\$PATH"`); // if couldn't find lnms and we have PATH diff --git a/net-mgmt/librenms/files/patch-LibreNMS_____init____.py b/net-mgmt/librenms/files/patch-LibreNMS_____init____.py index a5a301d57649..a648688daae8 100644 --- a/net-mgmt/librenms/files/patch-LibreNMS_____init____.py +++ b/net-mgmt/librenms/files/patch-LibreNMS_____init____.py @@ -14,7 +14,7 @@ if script.endswith(".php"): # save calling the sh process - base = ("/usr/bin/env", "php") -+ base = ("/usr/local/bin/php",) ++ base = ("%%LOCALBASE%%/bin/php",) else: base = () diff --git a/net-mgmt/librenms/files/patch-LibreNMS_wrapper.py b/net-mgmt/librenms/files/patch-LibreNMS_wrapper.py index d0f9187b21cf..d37958f3ac0a 100644 --- a/net-mgmt/librenms/files/patch-LibreNMS_wrapper.py +++ b/net-mgmt/librenms/files/patch-LibreNMS_wrapper.py @@ -5,7 +5,7 @@ wrappers[wrapper_type]["executable"], ) - command = "/usr/bin/env php {} -h {}".format(executable, device_id) -+ command = "/usr/local/bin/php php {} -h {}".format(executable, device_id) ++ command = "%%LOCALBASE%%/bin/php php {} -h {}".format(executable, device_id) if modules is not None and len(str(modules).strip()): module_str = re.sub("\s", "", str(modules).strip()) command = command + " -m {}".format(module_str) diff --git a/net-mgmt/librenms/files/patch-snmp-scan.py b/net-mgmt/librenms/files/patch-snmp-scan.py index 8c8ad9ddfc03..35f95c508731 100644 --- a/net-mgmt/librenms/files/patch-snmp-scan.py +++ b/net-mgmt/librenms/files/patch-snmp-scan.py @@ -6,7 +6,7 @@ arguments = [ - "/usr/bin/env", - "lnms", -+ "/usr/local/bin/lnms", ++ "%%LOCALBASE%%/bin/lnms", "device:add", "-g", POLLER_GROUP, @@ -15,7 +15,7 @@ try: CONFIG = json.loads( - check_output(["/usr/bin/env", "php", "config_to_json.php"]).decode() -+ check_output(["/usr/local/bin/php", "config_to_json.php"]).decode() ++ check_output(["%%LOCALBASE%%/bin/php", "config_to_json.php"]).decode() ) except CalledProcessError as e: parser.error( [16:16 pkg01 dan ~/ports/head/net-mgmt/librenms] % -- Dan Langille dan@langille.org