Page MenuHomeFreeBSD

D60995.1793683761.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D60995.1793683761.diff

diff --git a/tools/tools/git/Makefile b/tools/tools/git/Makefile
--- a/tools/tools/git/Makefile
+++ b/tools/tools/git/Makefile
@@ -1,5 +1,16 @@
SCRIPTS= git-arc.sh git-mfc
-BINDIR?= /usr/local/bin
+PREFIX?= /usr/local
+BINDIR?= ${PREFIX}/bin
MAN= git-arc.1 git-mfc.1
+.if ${.MAKE.OS} == "FreeBSD"
+# This matches the value set in `bsd.own.mk`.
+MANDIR?= ${PREFIX}/share/man/man
+.else
+# Work with vanilla bmake on alternate OSes, e.g., Linux, macOS, etc.
+MANDIR?= ${PREFIX}/share/man
+
+.include <scripts.mk>
+.endif
+
.include <bsd.prog.mk>
diff --git a/tools/tools/git/git-arc.sh b/tools/tools/git/git-arc.sh
--- a/tools/tools/git/git-arc.sh
+++ b/tools/tools/git/git-arc.sh
@@ -87,6 +87,8 @@
test "$(git config --bool --get $1 2>/dev/null || echo $2)" != "false"
}
+readonly PHORGE_PACKAGE="devel/phorgeit-arcanist-lib"
+
#
# Per-subcommand initialization, invoked only after that sub-command's getopts
# loop and arity check have succeeded. git-sh-setup treats leading -h as help
@@ -101,8 +103,8 @@
#
setup()
{
- [ -x "${ARC_CMD}" ] || err "arc is required, install devel/arcanist-lib"
- which jq >/dev/null 2>&1 || err "jq is required, install textproc/jq"
+ [ -x "${ARC_CMD}" ] || err "arc is required: install ${PHORGE_PACKAGE}"
+ which jq >/dev/null 2>&1 || err "jq is required: install textproc/jq"
if [ "$VERBOSE" ]; then
exec 3>&1
@@ -148,13 +150,20 @@
#
# Invoke the actual arc command. This allows us to only rely on the
-# devel/arcanist-lib port, which installs the actual script, rather than
-# the devel/arcanist-port, which installs a symlink in ${LOCALBASE}/bin
-# but conflicts with the archivers/arc port.
+# devel/*arcanist-lib port, which installs the actual script, rather than
+# devel/*arcanist, which installs a symlink in ${LOCALBASE}/bin but conflicts
+# with the archivers/arc port.
#
-: "${LOCALBASE:=$(sysctl -n user.localbase)}"
-: "${LOCALBASE:=/usr/local}"
-: "${ARC_CMD:=${LOCALBASE}/lib/php/arcanist/bin/arc}"
+if [ -z "${ARC_CMD}" ]; then
+ # FreeBSD
+ if PKG="$(command -v pkg)"; then
+ ARC_CMD="$("${PKG}" list "${PHORGE_PACKAGE}" | grep /bin/arc$)"
+ # Non-FreeBSD (Linux, macOS)
+ else
+ ARC_CMD="$(command -v arc)"
+ fi
+fi
+
arc()
{
${ARC_CMD} "$@"

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 3, 5:29 AM (13 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41310459
Default Alt Text
D60995.1793683761.diff (2 KB)

Event Timeline