weechat-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Weechat-support] Prevent WeeChat from overwriting its own configura


From: Jérémie Roquet
Subject: Re: [Weechat-support] Prevent WeeChat from overwriting its own configuration files
Date: Sun, 3 Apr 2016 01:07:48 +0200

Dear Nils,

Thank you for your kind answer.

2016-04-02 22:27 GMT+02:00 Nils G <address@hidden>:
> i read your comments in #weechat. The behaviour is not normal and
> people told you to not edit config files by hand, if you don't know what you
> are doing!

That must have been someone else. I've never been on #weechat yet.

> Config files will not be overwritten on startup!

Actually, I've made some additional tests and here's what happens:

 1) Configuration files that I've deleted are re-created on startup.
Here's for example what happens for sec.conf I've deleted before
(using strace):

access("/home/arkanosis/.weechat/sec.conf", F_OK) = -1 ENOENT (No such
file or directory)
lstat("/home/arkanosis/Arkonf/weechat/.weechat/sec.conf",
0x7ffe37cb6590) = -1 ENOENT (No such file or directory)
open("/home/arkanosis/.weechat/sec.conf.weechattmp",
O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
write(4, "#\n# weechat -- sec.conf\n#\n\n[cryp"..., 109) = 109
chmod("/home/arkanosis/.weechat/sec.conf.weechattmp", 0600) = 0
rename("/home/arkanosis/.weechat/sec.conf.weechattmp",
"/home/arkanosis/.weechat/sec.conf") = 0
open("/home/arkanosis/.weechat/sec.conf", O_RDONLY) = 4
read(4, "#\n# weechat -- sec.conf\n#\n\n[cryp"..., 4096) = 109

Note that weechat is still running and I haven't pressed any key yet.
And the same happens for every configuration file.

 2) Configuration files I've not deleted are overwritten on /quit,
regardless of weechat.look.save_config_on_exit. Here's for example
what happens for irc.conf I've *not* deleted before (still using
strace):

access("/home/arkanosis/.weechat/irc.conf", F_OK) = 0
open("/home/arkanosis/.weechat/irc.conf", O_RDONLY) = 7

<at this point, I /quit weechat>

[pid   424] lstat("/home/arkanosis/Arkonf/weechat/.weechat/irc.conf",
{st_mode=S_IFREG|0664, st_size=490, ...}) = 0
[pid   424] open("/home/arkanosis/.weechat/irc.conf.weechattmp",
O_WRONLY|O_CREAT|O_TRUNC, 0666)
 = 17
[pid   424] write(17, "#\n# weechat -- irc.conf\n#\n\n[look"..., 4096) = 4096
[pid   424] chmod("/home/arkanosis/.weechat/irc.conf.weechattmp", 0600) = 0
[pid   424] rename("/home/arkanosis/.weechat/irc.conf.weechattmp",
"/home/arkanosis/Arkonf/weechat/.weechat/irc.conf") = 0

Note that my settings are preserved, but the file itself is
overwritten by settings I don't want in it (mostly because they are
the defaults, so I don't care, plus I hate having settings I don't
need or understand in my dotfiles). Also, formating and comments are
lost.

3) weechat.look.save_config_on_exit = off seems to preserve
weechat.conf and only weechat.conf (sorry, I missed that before
sending my first email).

I'm using the last version for Ubuntu 14.04 LTS, from the weechat deb
repository; that is version 1.4.

So, are these two bugs? Or is it by design that:
1) files are created on startup when I've deleted them;
2) files others than weechat.conf are overwritten on /quit even with
weechat.look.save_config_on_exit = off.

If these are bugs, then I'm willing to fix them. If these are not,
would new settings to change this behavior be welcome in the code
base?

Thanks again for you help and best regards,

-- 
Jérémie



reply via email to

[Prev in Thread] Current Thread [Next in Thread]