From 0e28f0975e72e72b4e937a7eed45aa7890d00c90 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Sat, 27 Aug 2005 17:38:57 +0000 Subject: [PATCH] - python does not export variables beginning with underscore - util-vserver-vars also specifies some values by reference, dereference these before converting to python --- python/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/python/Makefile b/python/Makefile index dc4d593..7ae69d7 100644 --- a/python/Makefile +++ b/python/Makefile @@ -9,11 +9,14 @@ # Mark Huang # Copyright (C) 2005 The Trustees of Princeton University # -# $Id$ +# $Id: Makefile,v 1.7 2005/08/26 04:00:44 mlhuang Exp $ # ALL := vserverimpl.so vduimpl.so util_vserver_vars.py +# need command substitution +SHELL := /bin/bash + pythonlibdir := @libdir@/python@PYTHON_VERSION@/site-packages all: $(ALL) @@ -29,7 +32,11 @@ vserverimpl.so vduimpl.so: %.so: %.o ../libtool --tag=CC --mode=link $(CC) -shared -o $@ $< ../lib/libvserver.la util_vserver_vars.py: ../scripts/util-vserver-vars - install -m 644 $< $@ + # python does not export variables beginning with underscore + (. $< ; \ + while read var ; do eval echo $$var=\$${$$var} ; done < \ + <(sed -ne "s/\([^=]*\)=.*/\1/p" $<) \ + | sed -e "s/^_*//" -e "s/\([^=]*\)=\(.*\)/\1='\2'/") > $@ install: $(ALL) # install relinked libraries and byte-compiled scripts -- 2.47.0