osmith submitted this change.

View Change


Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified msuraev: Looks good to me, but someone else must approve osmith: Looks good to me, approved
build/Makefile.common.inc: unset OSMO_REPOSITORY

Don't have a default value for OSMO_REPOSITORY, as this leads to manuals
getting uploaded to the wrong directory (publish) target and installed
to the wrong directory (install, uninstall).

Add checks to ensure the variable is set before using it in install and
uninstall.

Related: OS#5902
Change-Id: Ie21d58dd57a893a83f566eea464ab3eec82b67a4
---
M build/Makefile.common.inc
M tests/Makefile.am
2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/build/Makefile.common.inc b/build/Makefile.common.inc
index a9a8ddf..2bbd324 100644
--- a/build/Makefile.common.inc
+++ b/build/Makefile.common.inc
@@ -11,7 +11,6 @@
SYMLINKS = common build
CLEAN_FILES += $(SYMLINKS)
PDF_FILES = $(patsubst %.adoc,%.pdf,$(ASCIIDOC)) $(patsubst %.xml,%.pdf,$(VTY_REFERENCE))
-OSMO_REPOSITORY ?= osmo-gsm-manuals
PUBLISH_REF ?= master
PUBLISH_TEMPDIR = _publish_tmpdir

@@ -49,6 +48,7 @@
# - installing manuals by default is fine, because Osmocom projects won't include
# the whole Makefile.common.inc unless --enable-manuals is passed to configure.
install: $(PDF_FILES)
+ [ -n "$(OSMO_REPOSITORY)" ] || exit 1
if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \
for i in $(PDF_FILES); do \
install -vDm644 "$$i" "$(DESTDIR)$(prefix)/share/doc/$(OSMO_REPOSITORY)-doc/$$i" || exit 1; \
@@ -56,6 +56,7 @@
fi

uninstall:
+ [ -n "$(OSMO_REPOSITORY)" ] || exit 1
if [ "$(OSMO_GSM_MANUALS_NO_INSTALL)" != "1" ]; then \
for i in $(PDF_FILES); do \
rm -v "$(DESTDIR)$(prefix)/share/doc/$(OSMO_REPOSITORY)-doc/$$i"; \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 784f61f..0761d48 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -34,6 +34,7 @@

VTY_REFERENCE = test-vty-reference.xml test2-vty-reference.xml
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
+OSMO_REPOSITORY = osmo-gsm-manuals
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc



To view, visit change 31726. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Change-Id: Ie21d58dd57a893a83f566eea464ab3eec82b67a4
Gerrit-Change-Number: 31726
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: msuraev <msuraev@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged