Change in osmo-e1-hardware[master]: doc/manuals: support OSMO_GSM_MANUALS_DIR

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Wed Jan 13 09:54:58 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/22125 )


Change subject: doc/manuals: support OSMO_GSM_MANUALS_DIR
......................................................................

doc/manuals: support OSMO_GSM_MANUALS_DIR

Instead of only relying on pkg-config, support the environment variable
and fallback path like in other Osmocom repositories too. The same
script is used in other Osmocom repositories where manuals are built
without autotools.

Related: OS#4912
Change-Id: Iecfbfc2a7588c316642aa37be637cf3c02f76ac4
---
M doc/manuals/Makefile
A doc/manuals/osmo-gsm-manuals-dir.sh
2 files changed, 27 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/25/22125/1

diff --git a/doc/manuals/Makefile b/doc/manuals/Makefile
index 1bd4b6e..d9a613d 100644
--- a/doc/manuals/Makefile
+++ b/doc/manuals/Makefile
@@ -1,4 +1,4 @@
-OSMO_GSM_MANUALS_DIR:=$(shell pkg-config osmo-gsm-manuals --variable=osmogsmmanualsdir)
+OSMO_GSM_MANUALS_DIR:=$(shell ./osmo-gsm-manuals-dir.sh)
 
 sdcdir = .
 
diff --git a/doc/manuals/osmo-gsm-manuals-dir.sh b/doc/manuals/osmo-gsm-manuals-dir.sh
new file mode 100755
index 0000000..f132eaa
--- /dev/null
+++ b/doc/manuals/osmo-gsm-manuals-dir.sh
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+# Find OSMO_GSM_MANUALS_DIR and print it to stdout. Print where it was taken from to stderr.
+
+# Find it in env, pkg-conf and ../../../osmo-gsm-manuals
+RET="$OSMO_GSM_MANUALS_DIR"
+if [ -n "$RET" ]; then
+	RET="$(realpath $RET)"
+	echo "OSMO_GSM_MANUALS_DIR: $RET (from env)" >&2
+else
+	RET="$(pkg-config osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null || true)"
+	if [ -n "$RET" ]; then
+		echo "OSMO_GSM_MANUALS_DIR: $RET (from pkg-conf)" >&2
+	else
+		RET="$(realpath $(realpath $(dirname $0))/../../../osmo-gsm-manuals)"
+		echo "OSMO_GSM_MANUALS_DIR: $RET (fallback)" >&2
+	fi
+fi
+
+# Print the result or error message
+if [ -d "$RET" ]; then
+	echo "$RET"
+else
+	echo "ERROR: OSMO_GSM_MANUALS_DIR does not exist!" >&2
+	echo "Install osmo-gsm-manuals or set OSMO_GSM_MANUALS_DIR." >&2
+	exit 1
+fi

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/22125
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: Iecfbfc2a7588c316642aa37be637cf3c02f76ac4
Gerrit-Change-Number: 22125
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210113/2d3277b8/attachment.htm>


More information about the gerrit-log mailing list