Auto Config'n

3 views
Skip to first unread message

Benjamin Kuhns

unread,
Jun 27, 2010, 4:47:05 PM6/27/10
to eucl...@googlegroups.com
install_conf:
@if [ ${XDG_CONFIG_HOME} ]; then install -b -m600 euclid-wm.conf.sample ${XDG_CONFIG_HOME}/euclid-wm.conf; else install -b -m600 euclid-wm.conf.sample ${HOME}/.config/euclid-wm.conf; fi

looks good except it doesn't take into account users who have already modified their *.conf file since the last installation. Like if I wanted to change the terminal to urxvt, then that change would be erased by the next update.

Maybe adding a question before updating the config file, like when you pacman -Syu and they are updating klibc to coreutils or some such thing and they ask you about it before hand. Or similarly when they are installing/updating something like slim and they ask you if you want to overwrite your slim.conf file.

Simple echo command with a trash variable for the [Y/N] response would suffice. No need to error handle people who can't understand two choices, right?

BKL

William Diem

unread,
Jun 27, 2010, 5:33:59 PM6/27/10
to eucl...@googlegroups.com
On 27 June 2010 20:47, Benjamin Kuhns <benjami...@gmail.com> wrote:
> install_conf:
> @if [ ${XDG_CONFIG_HOME} ]; then install -b -m600 euclid-wm.conf.sample
> ${XDG_CONFIG_HOME}/euclid-wm.conf; else install -b -m600
> euclid-wm.conf.sample ${HOME}/.config/euclid-wm.conf; fi
> looks good except it doesn't take into account users who have already
> modified their *.conf file since the last installation. Like if I wanted to
> change the terminal to urxvt, then that change would be erased by the next
> update.

Well, install_conf is a separate target that needs to be run
explicitly for reasons mentioned here:
http://groups.google.com/group/euclid-wm/browse_thread/thread/5c02ea8cc5c83147

Point being, for this to get run the user has already decided to
install the config file specifically, so asking if he wants to install
the config file doesn't seem necessary.

And the -b switch should make a backup of any original (just in case
the user had already modified the file).

I do not like the install_conf workaround, specifically because it
requires an extra, non-standard step. I suppose the best I can do at
the moment would be to add an echo "Run make install_conf as a user to
install configuration files for that user" at the end of install:.

What I like better though, is putting the sample/default config in
/usr/share/euclid-wm then if it doesn't exist at startup, having
euclid copy it to the user's home directory.

Best,
Will

Reply all
Reply to author
Forward
0 new messages