From nobody Sun Oct 08 18:41:04 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 4S3WFs0G06z4wr5G; Sun, 8 Oct 2023 18:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S3WFr6xqYz4FP6; Sun, 8 Oct 2023 18:41:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696790465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ggd4GADM4G/sRx+dbLb9+smAaZsOahr4bgSZiYSV9Jc=; b=CzFOo7nsZYNEQ7paKPeXcqNrl9CiRHeHOyXIBXFoXgCqaAAbu+Eqm/kXymKwic8u66TK7X mHoMcJZk5JTXlKaayLD+seg589UXHmg2qxyH3YCP+FlyPQaDukE/GRwojshe24Bk69bpvk BJx/dexnSEd+8m2ZTeXTdZJ2/hPsQI5qRhGiaqW+wdOYN8iVozYbFt08IDbSDKCP2Ma6wR q+Bk7Tt2dqnbNyWi1Fna2aSlNbg0Qe+fDZ0i2t/bY+XLa1W/GD03skGaxuuYw/CIYH7+Hj DYEQqs6Sg4TzWe3XrAUify0SqV7E1v/NiQ3Yl8ZAsb0u8+sO/WXHg39dm6NxYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696790465; a=rsa-sha256; cv=none; b=TWagoa92Jy6NArKbJZgZJYBGPhVgSCvVO+bPecqY9f6AK6Eg2lNR25Ny3azzTrddDb1URH /4E2Yc/47VnMzNp8JLaI2kLuvnqjr8f10AIPUWNls5Ooo/+6z2CLRZ7E+hFCRKmijIGddB iqCqtBdrSgeK+Amgm23w2M/73kRMD19YFTOWErXBGV90tEOyYiEBLQ0HvJXr/8u5axBI5G 0Hc0WrJMAaAMugOfCreUu+O7i3YXB+TCROgwfH8uVcv7gkwQJEvr74NbSP5FChAo+EJIBm zVj6N1wyilfkLYXj/6T3BI6ObTAXG52uPsgQwWAq+YrrwaFR6RQ4SCOCsHRwxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696790465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ggd4GADM4G/sRx+dbLb9+smAaZsOahr4bgSZiYSV9Jc=; b=b7V02vgGAqVpGjvElsl0Am8QC+cjC6CxCEt//OxYCyw4z+aWlQv7pm90tblLig2qFREK9p lXaCbLLmYH/s2SnlVVEI8PLWRHjmpR4Zkciqa2e5Bwkjtba9ZTQujSEt8G/G9QPap71ksY q2tp8Ajp/ULv8+ducL0VBkfzHS/mB80CTPUBNZ/LEkSXsLAJoek6QImhGLdgAJoDo0sCCI KfxvvrrfmiUCYKhfXM1tvdoFez5bXibaPHn+nxwYmi6DoJCOEy6EkKNsu4crauVSXrlim0 d3OPbDYv09xhMv4Xyx6yMSlpmtR/rFFEBA2QNP1KnxfGjYHbESYSFW4ldyIYNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S3WFr62Xhz8cP; Sun, 8 Oct 2023 18:41:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 398If4E7016933; Sun, 8 Oct 2023 18:41:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 398If4WS016930; Sun, 8 Oct 2023 18:41:04 GMT (envelope-from git) Date: Sun, 8 Oct 2023 18:41:04 GMT Message-Id: <202310081841.398If4WS016930@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dan Langille Subject: git: 7d8ac44c9024 - main - net-mgmt/librenms: Improve patching 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dvl X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d8ac44c90242ecd1656ce0c5a5c68910afb712b Auto-Submitted: auto-generated The branch main has been updated by dvl: URL: https://cgit.FreeBSD.org/ports/commit/?id=7d8ac44c90242ecd1656ce0c5a5c68910afb712b commit 7d8ac44c90242ecd1656ce0c5a5c68910afb712b Author: Dan Langille AuthorDate: 2023-10-08 18:36:12 +0000 Commit: Dan Langille CommitDate: 2023-10-08 18:40:59 +0000 net-mgmt/librenms: Improve patching Instead of patching to /usr/local, patch to %%LOCALBASE%%, then use SED to patch to ${LOCALBASE} Reported by: osa --- net-mgmt/librenms/Makefile | 27 ++++++++++++---------- .../files/patch-LibreNMS_Validations_System.php | 2 +- .../librenms/files/patch-LibreNMS_____init____.py | 2 +- net-mgmt/librenms/files/patch-LibreNMS_wrapper.py | 2 +- net-mgmt/librenms/files/patch-snmp-scan.py | 4 ++-- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/net-mgmt/librenms/Makefile b/net-mgmt/librenms/Makefile index 1b64004a9593..00627645df7a 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 @@ -150,17 +150,20 @@ _OTHER_DIRS= database/seeders/config html/plugins html/js/lang \ vendor/symfony/string/Resources/bin post-patch: - ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/LibreNMS/Validations/Php.php - ${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 - ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/LibreNMS/Validations/System.php - ${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}/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 + ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/LibreNMS/__init__.py \ + ${WRKSRC}/LibreNMS/wrapper.py \ + ${WRKSRC}/LibreNMS/Util/Version.php \ + ${WRKSRC}/LibreNMS/Validations/Php.php \ + ${WRKSRC}/LibreNMS/Validations/System.php \ + ${WRKSRC}/config.php.default \ + ${WRKSRC}/includes/html/output/capture.inc.php \ + ${WRKSRC}/poller-wrapper.py \ + ${WRKSRC}/snmp-scan.py + ${REINPLACE_CMD} 's|%%PORTVERSION%%|${PORTVERSION}|g' ${WRKSRC}/LibreNMS/Util/Version.php + ${REINPLACE_CMD} 's|%%RELEASE_TIMESTAMP%%|${_RELEASE_TIMESTAMP}|g' ${WRKSRC}/LibreNMS/Util/Version.php + ${REINPLACE_CMD} 's|%%WWWDIR%%|${WWWDIR}|g' ${WRKSRC}/dist/librenms-scheduler.cron + ${REINPLACE_CMD} 's|%%USER%%|${WWWOWN}|g' ${WRKSRC}/dist/librenms-scheduler.cron ${RM} ${WRKSRC}/LibreNMS/Validations/Updates.php ${RM} -rf ${WRKSRC}/logs 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(