Commit f1b816b7 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Fix several search path configure options



Fix several search path configure options to properly handle
separators.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 30a31713
...@@ -1794,15 +1794,15 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in | stamp-directories ...@@ -1794,15 +1794,15 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in | stamp-directories
-DSSH_LOGIN_USER="$(SSH_LOGIN_USER)" \ -DSSH_LOGIN_USER="$(SSH_LOGIN_USER)" \
-DSSH_CONSOLE_USER="$(SSH_CONSOLE_USER)" \ -DSSH_CONSOLE_USER="$(SSH_CONSOLE_USER)" \
-DEXPORT_DIR="$(EXPORT_DIR)" \ -DEXPORT_DIR="$(EXPORT_DIR)" \
-DOS_SEARCH_PATH="$(foreach i,$(OS_SEARCH_PATH),\"$(i)\":)" \ -DOS_SEARCH_PATH="\"$(OS_SEARCH_PATH)\"" \
-DES_SEARCH_PATH="$(foreach i,$(ES_SEARCH_PATH),\"$(i)\":)" \ -DES_SEARCH_PATH="\"$(ES_SEARCH_PATH)\"" \
-DXEN_BOOTLOADER="$(XEN_BOOTLOADER)" \ -DXEN_BOOTLOADER="$(XEN_BOOTLOADER)" \
-DXEN_CONFIG_DIR="$(XEN_CONFIG_DIR)" \ -DXEN_CONFIG_DIR="$(XEN_CONFIG_DIR)" \
-DXEN_KERNEL="$(XEN_KERNEL)" \ -DXEN_KERNEL="$(XEN_KERNEL)" \
-DXEN_INITRD="$(XEN_INITRD)" \ -DXEN_INITRD="$(XEN_INITRD)" \
-DKVM_KERNEL="$(KVM_KERNEL)" \ -DKVM_KERNEL="$(KVM_KERNEL)" \
-DSHARED_FILE_STORAGE_DIR="$(SHARED_FILE_STORAGE_DIR)" \ -DSHARED_FILE_STORAGE_DIR="$(SHARED_FILE_STORAGE_DIR)" \
-DIALLOCATOR_SEARCH_PATH="$(foreach i,$(IALLOCATOR_SEARCH_PATH),\"$(i)\":)" \ -DIALLOCATOR_SEARCH_PATH="\"$(IALLOCATOR_SEARCH_PATH)\"" \
-DKVM_PATH="$(KVM_PATH)" \ -DKVM_PATH="$(KVM_PATH)" \
-DIP_PATH="$(IP_PATH)" \ -DIP_PATH="$(IP_PATH)" \
-DSOCAT_PATH="$(SOCAT)" \ -DSOCAT_PATH="$(SOCAT)" \
......
...@@ -91,36 +91,33 @@ AC_ARG_WITH([xen-config-dir], ...@@ -91,36 +91,33 @@ AC_ARG_WITH([xen-config-dir],
AC_SUBST(XEN_CONFIG_DIR, $xen_config_dir) AC_SUBST(XEN_CONFIG_DIR, $xen_config_dir)
# --with-os-search-path=... # --with-os-search-path=...
# do a bit of black sed magic to for quoting of the strings in the list
AC_ARG_WITH([os-search-path], AC_ARG_WITH([os-search-path],
[AS_HELP_STRING([--with-os-search-path=LIST], [AS_HELP_STRING([--with-os-search-path=LIST],
[comma separated list of directories to] [comma separated list of directories to]
[ search for OS images (default is /srv/ganeti/os)] [ search for OS images (default is /srv/ganeti/os)]
)], )],
[os_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/\1/g"`], [os_search_path="$withval"],
[os_search_path="/srv/ganeti/os"]) [os_search_path="/srv/ganeti/os"])
AC_SUBST(OS_SEARCH_PATH, $os_search_path) AC_SUBST(OS_SEARCH_PATH, $os_search_path)
# --with-extstorage-search-path=... # --with-extstorage-search-path=...
# same black sed magic for quoting of the strings in the list
AC_ARG_WITH([extstorage-search-path], AC_ARG_WITH([extstorage-search-path],
[AS_HELP_STRING([--with-extstorage-search-path=LIST], [AS_HELP_STRING([--with-extstorage-search-path=LIST],
[comma separated list of directories to] [comma separated list of directories to]
[ search for External Storage Providers] [ search for External Storage Providers]
[ (default is /srv/ganeti/extstorage)] [ (default is /srv/ganeti/extstorage)]
)], )],
[es_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/\1/g"`], [es_search_path="$withval"],
[es_search_path="/srv/ganeti/extstorage"]) [es_search_path="/srv/ganeti/extstorage"])
AC_SUBST(ES_SEARCH_PATH, $es_search_path) AC_SUBST(ES_SEARCH_PATH, $es_search_path)
# --with-iallocator-search-path=... # --with-iallocator-search-path=...
# do a bit of black sed magic to for quoting of the strings in the list
AC_ARG_WITH([iallocator-search-path], AC_ARG_WITH([iallocator-search-path],
[AS_HELP_STRING([--with-iallocator-search-path=LIST], [AS_HELP_STRING([--with-iallocator-search-path=LIST],
[comma separated list of directories to] [comma separated list of directories to]
[ search for instance allocators (default is $libdir/ganeti/iallocators)] [ search for instance allocators (default is $libdir/ganeti/iallocators)]
)], )],
[iallocator_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/\1/g"`], [iallocator_search_path="$withval"],
[iallocator_search_path="$libdir/$PACKAGE_NAME/iallocators"]) [iallocator_search_path="$libdir/$PACKAGE_NAME/iallocators"])
AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path) AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path)
......
...@@ -28,6 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ...@@ -28,6 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
module AutoConf where module AutoConf where
split :: String -> [String]
split str =
case span (/= ',') str of
(x, []) -> [x]
(x, _:xs) -> x:split xs
packageVersion :: String packageVersion :: String
packageVersion = "PACKAGE_VERSION" packageVersion = "PACKAGE_VERSION"
...@@ -68,10 +74,10 @@ exportDir :: String ...@@ -68,10 +74,10 @@ exportDir :: String
exportDir = "EXPORT_DIR" exportDir = "EXPORT_DIR"
osSearchPath :: [String] osSearchPath :: [String]
osSearchPath = OS_SEARCH_PATH[] osSearchPath = split OS_SEARCH_PATH
esSearchPath :: [String] esSearchPath :: [String]
esSearchPath = ES_SEARCH_PATH[] esSearchPath = split ES_SEARCH_PATH
xenBootloader :: String xenBootloader :: String
xenBootloader = "XEN_BOOTLOADER" xenBootloader = "XEN_BOOTLOADER"
...@@ -92,7 +98,7 @@ sharedFileStorageDir :: String ...@@ -92,7 +98,7 @@ sharedFileStorageDir :: String
sharedFileStorageDir = "SHARED_FILE_STORAGE_DIR" sharedFileStorageDir = "SHARED_FILE_STORAGE_DIR"
iallocatorSearchPath :: [String] iallocatorSearchPath :: [String]
iallocatorSearchPath = IALLOCATOR_SEARCH_PATH[] iallocatorSearchPath = split IALLOCATOR_SEARCH_PATH
kvmPath :: String kvmPath :: String
kvmPath = "KVM_PATH" kvmPath = "KVM_PATH"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment