Skip to content

Commit

Permalink
fix expansion of LXCPATH,LXCROOTFSMOUNT,LXCTEMPLATEDIR
Browse files Browse the repository at this point in the history
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
Dwight Engen authored and stgraber committed Sep 11, 2012
1 parent bcb8845 commit 8ab33e6
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 18 deletions.
7 changes: 4 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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],
[],
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/lxc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/lxc/lxc-clone.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/lxc/lxc-create.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/lxc/lxc-destroy.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ help() {

shortoptions='hn:f'
longoptions='help,name:'
localstatedir=@LOCALSTATEDIR@
lxc_path=@LXCPATH@
force=0

Expand Down
1 change: 0 additions & 1 deletion src/lxc/lxc-ls.in
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 0 additions & 3 deletions src/lxc/lxc-setcap.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/lxc/lxc-setuid.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ab33e6

Please sign in to comment.