Permalink
Browse files

fix expansion of LXCPATH,LXCROOTFSMOUNT,LXCTEMPLATEDIR

These variables are not expanded correctly in doc/lxc-create.sgml.in
and a workaround is in place to ensure ${localstatedir}, and ${datadir}
are set in the various shell scripts that use it. There is no workaround
to ensure ${datadir} is set in src/lxc/lxc-create.in, nor is
${localstatedir} set in templates/lxc-altlinux.in so I think that these
are currently broken.

Using AS_AC_EXPAND instead of AC_SUBST fixes these problems and removes
the need for the workarounds. In addition the lxc-start-ephemeral.in
script can be autoconf'ed instead of sed'ed by the makefile.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
  • Loading branch information...
1 parent bcb8845 commit 8ab33e6e82cb57fdb94a45f40e5bc473b7f8565b Dwight Engen committed with stgraber Sep 11, 2012
Showing with 4 additions and 18 deletions.
  1. +4 −3 configure.ac
  2. +0 −4 src/lxc/Makefile.am
  3. +0 −1 src/lxc/lxc-clone.in
  4. +0 −2 src/lxc/lxc-create.in
  5. +0 −1 src/lxc/lxc-destroy.in
  6. +0 −1 src/lxc/lxc-ls.in
  7. +0 −3 src/lxc/lxc-setcap.in
  8. +0 −3 src/lxc/lxc-setuid.in
View
7 configure.ac
@@ -112,11 +112,11 @@ AC_ARG_WITH([rootfs-path],
)], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
+AS_AC_EXPAND(LXCPATH, "${with_config_path}")
+AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
+AS_AC_EXPAND(LXCTEMPLATEDIR, ['${datadir}/lxc/templates'])
-AC_SUBST(LXCPATH, "${with_config_path}")
-AC_SUBST(LXCROOTFSMOUNT, "${with_rootfs_path}")
AC_SUBST(LXCINITDIR, ['${libexecdir}'])
-AC_SUBST(LXCTEMPLATEDIR, ['${datadir}/lxc/templates'])
AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
[],
@@ -213,6 +213,7 @@ AC_CONFIG_FILES([
src/lxc/lxc-create
src/lxc/lxc-clone
src/lxc/lxc-shutdown
+ src/lxc/lxc-start-ephemeral
src/lxc/lxc-destroy
src/python-lxc/Makefile
View
4 src/lxc/Makefile.am
@@ -144,10 +144,6 @@ lxc_unshare_SOURCES = lxc_unshare.c
lxc_wait_SOURCES = lxc_wait.c
lxc_kill_SOURCES = lxc_kill.c
-lxc-start-ephemeral: lxc-start-ephemeral.in
- [ -f $@ ] && rm -f $@ || true
- $(SED) -e "s:[@]LXCPATH@:$(LXCPATH):" $< > $@
-
install-exec-local: install-soPROGRAMS
mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
/sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
View
1 src/lxc/lxc-clone.in
@@ -46,7 +46,6 @@ help() {
shortoptions='ho:n:sL:v:p:t:'
longoptions='help,orig:,name:,snapshot,fssize:,vgname:,lvprefix:,fstype:'
-localstatedir=@LOCALSTATEDIR@
lxc_path=@LXCPATH@
bindir=@BINDIR@
snapshot=no
View
2 src/lxc/lxc-create.in
@@ -64,10 +64,8 @@ help() {
shortoptions='hn:f:t:B:'
longoptions='help,name:,config:,template:,backingstore:,fstype:,dir:,lvname:,vgname:,fssize:'
-localstatedir=@LOCALSTATEDIR@
lxc_path=@LXCPATH@
bindir=@BINDIR@
-libdir=@LIBDIR@
templatedir=@LXCTEMPLATEDIR@
backingstore=_unset
fstype=ext4
View
1 src/lxc/lxc-destroy.in
@@ -41,7 +41,6 @@ help() {
shortoptions='hn:f'
longoptions='help,name:'
-localstatedir=@LOCALSTATEDIR@
lxc_path=@LXCPATH@
force=0
View
1 src/lxc/lxc-ls.in
@@ -17,7 +17,6 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-localstatedir=@LOCALSTATEDIR@
lxc_path=@LXCPATH@
usage()
View
3 src/lxc/lxc-setcap.in
@@ -83,9 +83,6 @@ lxc_dropcaps()
shortoptions='hd'
longoptions='help'
-libdir=@LIBDIR@
-libexecdir=@LIBEXECDIR@
-localstatedir=@LOCALSTATEDIR@
getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
if [ $? != 0 ]; then
View
3 src/lxc/lxc-setuid.in
@@ -80,9 +80,6 @@ lxc_dropuid()
shortoptions='hd'
longoptions='help'
-libdir=@LIBDIR@
-libexecdir=@LIBEXECDIR@
-localstatedir=@LOCALSTATEDIR@
getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
if [ $? != 0 ]; then

0 comments on commit 8ab33e6

Please sign in to comment.