URL: https://github.com/freeipa/freeipa/pull/558
Author: HonzaCholasta
 Title: #558: ipapython: fix DEFAULT_PLUGINS in version.py
Action: opened

PR body:
"""
Replace the placeholder with the actual value during build.

This fixes the client incorrectly assuming that the default version of all
plugins is 1.

https://pagure.io/freeipa/issue/6597
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/558/head:pr558
git checkout pr558
From eb9f1bb58d3cf71c504e78fac69057c5cdc12917 Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Thu, 9 Mar 2017 08:54:10 +0000
Subject: [PATCH] ipapython: fix DEFAULT_PLUGINS in version.py

Replace the placeholder with the actual value during build.

This fixes the client incorrectly assuming that the default version of all
plugins is 1.

https://pagure.io/freeipa/issue/6597
---
 ipapython/Makefile.am   | 9 ++++++++-
 ipapython/version.py.in | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ipapython/Makefile.am b/ipapython/Makefile.am
index 1938868..7038e8b 100644
--- a/ipapython/Makefile.am
+++ b/ipapython/Makefile.am
@@ -1,5 +1,7 @@
 include $(top_srcdir)/Makefile.python.am
 
+MOSTLYCLEANFILES = .DEFAULT_PLUGINS
+
 EXTRA_DIST = version.py.in
 
 all-local: version.py
@@ -7,10 +9,15 @@ dist-hook: version.py
 install-exec-local: version.py
 bdist_wheel: version.py
 
-version.py: version.py.in $(top_builddir)/$(CONFIG_STATUS)
+.DEFAULT_PLUGINS: $(top_srcdir)/API.txt
+	$(AM_V_GEN)awk '$$1 == "default:" { print $$2 }' $< >$@
+
+version.py: version.py.in .DEFAULT_PLUGINS $(top_builddir)/$(CONFIG_STATUS)
 	$(AM_V_GEN)sed						\
 		-e 's|@API_VERSION[@]|$(API_VERSION)|g'		\
 		-e 's|@NUM_VERSION[@]|$(NUM_VERSION)|g'		\
 		-e 's|@VERSION[@]|$(VERSION)|g'			\
 		-e 's|@VENDOR_SUFFIX[@]|$(VENDOR_SUFFIX)|g'	\
+		-e '/@DEFAULT_PLUGINS[@]/r .DEFAULT_PLUGINS'	\
+		-e '/@DEFAULT_PLUGINS[@]/d'			\
 		$< > $@
diff --git a/ipapython/version.py.in b/ipapython/version.py.in
index 9dc9714..6624d9c 100644
--- a/ipapython/version.py.in
+++ b/ipapython/version.py.in
@@ -49,5 +49,5 @@ API_VERSION=u'@API_VERSION@'
 
 
 DEFAULT_PLUGINS = frozenset(l.strip() for l in """
-__DEFAULT_PLUGINS__
+@DEFAULT_PLUGINS@
 """.strip().splitlines())
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to