Commit 9db396d4 authored by Brian Cameron's avatar Brian Cameron Committed by Brian Cameron

Change --with-configdir to --with-defaults-conf and make it work so that

2006-02-13  Brian Cameron  <brian.cameron@sun.com>

        * acconfig.h, configure.ac, daemon/Makefile.am, daemon/gdmconfig.c,
          docs/C/gdm.xml: Change --with-configdir to --with-defaults-conf
          and make it work so that the gdm.conf and gdm.conf-custom file
          can be installed to different subdirectories.  Fixes bug
          #330905.  Patch provided by Ray Strode.
parent 8632e2a5
2006-02-13 Brian Cameron <brian.cameron@sun.com>
* acconfig.h, configure.ac, daemon/Makefile.am, daemon/gdmconfig.c,
docs/C/gdm.xml: Change --with-configdir to --with-defaults-conf
and make it work so that the gdm.conf and gdm.conf-custom file
can be installed to different subdirectories. Fixes bug
#330905. Patch provided by Ray Strode.
2006-02-13 Brian Cameron <brian.cameron@sun.com>
* config/Xsession.in: Fix calls to zenity so they work. Fixes
......
......@@ -86,7 +86,7 @@ The GDM configuration file /etc/gdm/gdm.conf may be replaced by
you distribution on upgrade, so if a user wants to ensure that
configuration changes persist on upgrade, edit the
/etc/gdm/gdm.conf-custom file. You can specify a different
location for the file via the "--with-configdir=/dir" option.
location for the file via the "--with-defaults-conf=/dir" option.
This can be useful if you want to put the default file on a
filesystem shared by multiple machines.
......
......@@ -2,7 +2,8 @@
#undef VERSION
#undef AT_BINDIR
#undef GETTEXT_PACKAGE
#undef GDM_CONFIGDIR
#undef GDM_DEFAULTS_CONF
#undef GDM_CUSTOM_CONF
#undef GDM_USER_PATH
#undef HALT_COMMAND
#undef REBOOT_COMMAND
......
pixmapdir = $(datadir)/pixmaps
confdir = $(sysconfdir)/gdm
gdmconfdir = $(GDM_CONFIGDIR)
crossconfdir = $(sysconfdir)/dm
localedir = $(sysconfdir)/gdm
bisessdir = $(datadir)/gdm/BuiltInSessions
......@@ -54,9 +53,9 @@ uninstall-hook:
$(DESTDIR)$(instsessdir)/default.desktop \
$(DESTDIR)$(instsessdir)/ssh.desktop \
$(DESTDIR)$(instsessdir)/CDE.desktop \
$(DESTDIR)$(gdmconfdir)/gdm.conf \
$(DESTDIR)$(gdmconfdir)/gdm.conf-custom \
$(DESTDIR)$(gdmconfdir)/factory-gdm.conf \
$(DESTDIR)$(GDM_DEFAULTS_CONF) \
$(DESTDIR)$(GDM_CUSTOM_CONF) \
`dirname $(DESTDIR)$(GDM_DEFAULTS_CONF)`/factory-`basename $(DESTDIR)$(GDM_DEFAULTS_CONF)` \
$(DESTDIR)$(confdir)/XKeepsCrashing \
$(DESTDIR)$(confdir)/Xsession \
$(DESTDIR)$(confdir)/gdmprefetchlist \
......@@ -75,26 +74,30 @@ install-data-hook: gdm.conf gdm.conf-custom Xsession Init PostSession PreSession
$(mkinstalldirs) $(DESTDIR)$(crossconfdir); \
chmod 755 $(DESTDIR)$(crossconfdir); \
fi
if test '!' -d $(DESTDIR)$(gdmconfdir); then \
$(mkinstalldirs) $(DESTDIR)$(gdmconfdir); \
chmod 755 $(DESTDIR)$(gdmconfdir); \
if test '!' -d `dirname $(DESTDIR)$(GDM_DEFAULTS_CONF)`; then \
$(mkinstalldirs) `dirname $(DESTDIR)$(GDM_DEFAULTS_CONF)`; \
chmod 755 `dirname $(DESTDIR)$(GDM_DEFAULTS_CONF)`; \
fi
if test -f $(DESTDIR)$(gdmconfdir)/gdm.conf; then \
if ! cmp -s $(DESTDIR)$(gdmconfdir)/gdm.conf $(DESTDIR)$(gdmconfdir)/factory-gdm.conf > /dev/null 2>&1 ; then \
if test '!' -f $(DESTDIR)$(gdmconfdir)/gdm.conf-custom; then \
cp -f $(DESTDIR)$(gdmconfdir)/gdm.conf $(DESTDIR)$(gdmconfdir)/gdm.conf-custom; \
if test '!' -d `dirname $(DESTDIR)$(GDM_CUSTOM_CONF)`; then \
$(mkinstalldirs) `dirname $(DESTDIR)$(GDM_CUSTOM_CONF)`; \
chmod 755 `dirname $(DESTDIR)$(GDM_CUSTOM_CONF)`; \
fi
if test -f $(DESTDIR)$(confdir)/gdm.conf; then \
if ! cmp -s $(DESTDIR)$(confdir)/gdm.conf $(DESTDIR)$(confdir)/factory-gdm.conf > /dev/null 2>&1 ; then \
if test '!' -f $(DESTDIR)$(GDM_CUSTOM_CONF); then \
cp -f $(DESTDIR)$(confdir)/gdm.conf $(DESTDIR)$(GDM_CUSTOM_CONF); \
else \
cp -f $(DESTDIR)$(gdmconfdir)/gdm.conf $(DESTDIR)$(gdmconfdir)/gdm.conf.org; \
cp -f $(DESTDIR)$(confdir)/gdm.conf $(DESTDIR)$(GDM_DEFAULTS_CONF).org; \
fi; \
fi; \
fi
$(INSTALL_DATA) gdm.conf $(DESTDIR)$(gdmconfdir)/gdm.conf
chmod 444 $(DESTDIR)$(gdmconfdir)/gdm.conf
if test '!' -f $(DESTDIR)$(gdmconfdir)/gdm.conf-custom; then \
$(INSTALL_DATA) $(srcdir)/gdm.conf-custom $(DESTDIR)$(gdmconfdir)/gdm.conf-custom; \
chmod 644 $(DESTDIR)$(gdmconfdir)/gdm.conf-custom; \
$(INSTALL_DATA) gdm.conf $(DESTDIR)$(GDM_DEFAULTS_CONF)
chmod 444 $(DESTDIR)$(GDM_DEFAULTS_CONF)
if test '!' -f $(DESTDIR)$(GDM_CUSTOM_CONF); then \
$(INSTALL_DATA) $(srcdir)/gdm.conf-custom $(DESTDIR)$(GDM_CUSTOM_CONF); \
chmod 644 $(DESTDIR)$(GDM_CUSTOM_CONF); \
fi
$(INSTALL_DATA) gdm.conf $(DESTDIR)$(gdmconfdir)/factory-gdm.conf
$(INSTALL_DATA) gdm.conf `dirname $(DESTDIR)$(GDM_DEFAULTS_CONF)`/factory-`basename $(DESTDIR)$(GDM_DEFAULTS_CONF)`
$(INSTALL_SCRIPT) $(srcdir)/XKeepsCrashing $(DESTDIR)$(confdir)/XKeepsCrashing
$(INSTALL_SCRIPT) Xsession $(DESTDIR)$(confdir)/Xsession
......
......@@ -849,17 +849,32 @@ AC_SUBST(AT_BINDIR)
AC_DEFINE_UNQUOTED(AT_BINDIR,"$AT_BINDIR")
withval=""
AC_ARG_WITH(configdir,
[ --with-configdir=<PATH> PATH to Install gdm.conf configuration file [default=sysconfdir/gdm]],)
AC_ARG_WITH(defaults_conf,
[ --with-defaults-conf=<FILENAME> FILENAME to give to defaults file [default=DATADIR/gdm/defaults.conf]],)
if test x$withval != x; then
GDM_CONFIGDIR="$withval"
GDM_DEFAULTS_CONF="$withval"
else
GDM_CONFIGDIR="$sysconfdir/gdm"
GDM_DEFAULTS_CONF="$datadir/gdm/defaults.conf"
fi
AC_SUBST(GDM_CONFIGDIR)
AC_DEFINE_UNQUOTED(GDM_CONFIGDIR,"$GDM_CONFIGDIR")
AC_SUBST(GDM_DEFAULTS_CONF)
AC_DEFINE_UNQUOTED(GDM_DEFAULTS_CONF,"$GDM_DEFAULTS_CONF")
withval=""
AC_ARG_WITH(custom_conf,
[ --with-custom-conf=<FILENAME> FILENAME to give to custom configuration file [default=SYSCONFDIR/gdm/custom.conf]],)
if test x$withval != x; then
GDM_CUSTOM_CONF="$withval"
else
GDM_CUSTOM_CONF="$sysconfdir/gdm/custom.conf"
fi
AC_SUBST(GDM_CUSTOM_CONF)
AC_DEFINE_UNQUOTED(GDM_CUSTOM_CONF,"$GDM_CUSTOM_CONF")
AC_ARG_WITH(prefetch,
[ --with-prefetch=[yes/no] Install GDM library prefetch utility [default=no]],,
......
## Process this file with automake to produce makefile.in
DEFS = @DEFS@ -DGDM_SYSCONFDIR_CONFIG_FILE=\"$(GDM_CONFIGDIR)/gdm.conf\"
# Note that we have cflags for just about everything even if
# we don't link to everything
......
......@@ -540,7 +540,7 @@ gdm_config_init (void)
* Get config file.
*/
static VeConfig *
gdm_get_config (struct stat *statbuf)
gdm_get_default_config (struct stat *statbuf)
{
int r;
......@@ -553,13 +553,13 @@ gdm_get_config (struct stat *statbuf)
return NULL;
}
} else {
VE_IGNORE_EINTR (r = g_stat (GDM_SYSCONFDIR_CONFIG_FILE, statbuf));
VE_IGNORE_EINTR (r = g_stat (GDM_DEFAULTS_CONF, statbuf));
if (r < 0) {
gdm_error (_("%s: No GDM configuration file: %s. Using defaults."),
"gdm_config_parse", GDM_SYSCONFDIR_CONFIG_FILE);
"gdm_config_parse", GDM_DEFAULTS_CONF);
return NULL;
} else {
config_file = GDM_SYSCONFDIR_CONFIG_FILE;
config_file = GDM_DEFAULTS_CONF;
}
}
......@@ -576,12 +576,11 @@ static VeConfig *
gdm_get_custom_config (struct stat *statbuf)
{
VeConfig *retval;
gchar *file = g_strdup_printf ("%s-custom", GDM_SYSCONFDIR_CONFIG_FILE);
int r;
VE_IGNORE_EINTR (r = g_stat (file, statbuf));
VE_IGNORE_EINTR (r = g_stat (GDM_CUSTOM_CONF, statbuf));
if (r >= 0) {
custom_config_file = file;
custom_config_file = g_strdup (GDM_CUSTOM_CONF);
return ve_config_new (custom_config_file);
} else {
return NULL;
......@@ -1723,7 +1722,7 @@ gdm_config_parse (void)
* main configuration file. If cfg is missing, then GDM will
* use the built-in defaults found in gdm.h.
*/
cfg = gdm_get_config (&statbuf);
cfg = gdm_get_default_config (&statbuf);
config_file_mtime = statbuf.st_mtime;
custom_cfg = gdm_get_custom_config (&statbuf);
custom_config_file_mtime = statbuf.st_mtime;
......
......@@ -1076,7 +1076,7 @@ Greeter=/usr/lib/gdmgreeter
<para>
GDM may be configured to support system-wide configuration if
built with the <command>--with-configdir</command> option. This
built with the <command>--with-defaults-conf</command> option. This
allows the gdm.conf file to be installed to a directory that can
be mounted across multiple-systems. The GDM --config option may
also be used to specify the configuration file location. The GDM2
......@@ -1348,7 +1348,7 @@ PostSession/
<para>
GDM may be configured to support system-wide configuration if
built with the <command>--with-configdir</command> option. This
built with the <command>--with-defaults-conf</command> option. This
allows the <filename>gdm.conf</filename> file to be installed to
a directory that can be mounted across multiple-systems. The
GDM --config option may instead be used to specify a configuration
......
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