Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-14 Thread Othman, Ossama
Hi Kristian, On Tue, May 14, 2013 at 1:57 PM, Kristian Høgsberg wrote: > On Tue, May 14, 2013 at 09:55:19AM -0700, Othman, Ossama wrote: > > I've attached the patch since the patch I sent through git send-mail was > > sent through an e-mail account that isn't subscribed to this list > (waiting >

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-14 Thread Kristian Høgsberg
On Tue, May 14, 2013 at 09:55:19AM -0700, Othman, Ossama wrote: > Hi Kristian, > > I've attached the patch since the patch I sent through git send-mail was > sent through an e-mail account that isn't subscribed to this list (waiting > for moderator approval), and to make sure the spacing isn't mun

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-14 Thread Othman, Ossama
Hi Kristian, I've attached the patch since the patch I sent through git send-mail was sent through an e-mail account that isn't subscribed to this list (waiting for moderator approval), and to make sure the spacing isn't munged again. This patch was generated against weston master as of this morn

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-14 Thread Kristian Høgsberg
On Mon, May 13, 2013 at 11:41 PM, Othman, Ossama wrote: > Hi Kristian, > >> I think it's good to go - however, inlining the patch messed up the >> whitespace. Ideally, send patches using git send-email, which can be >> configured to use smtp servers, and you can pass --annotate if you >> want to

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-13 Thread Othman, Ossama
Hi Kristian, I think it's good to go - however, inlining the patch messed up the > whitespace. Ideally, send patches using git send-email, which can be > configured to use smtp servers, and you can pass --annotate if you > want to add a message or comment to the patch (put it after the --- > that

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-13 Thread Kristian Høgsberg
On Mon, May 13, 2013 at 04:31:06PM -0700, Othman, Ossama wrote: > Hi Kristian, > > Here's another revision of the patch that attempts to implement your > suggested simplification, as well as address the TOCTOU race in previous > revisions of the patch. The module entry point signature changed sli

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-13 Thread Kristian Høgsberg
On Mon, May 13, 2013 at 10:37 AM, Daniel Stone wrote: > Hi, > > On 12 May 2013 16:54, Kristian Høgsberg wrote: >> I think we can change the interface to int open_config_file(const char >> *), which looks up and opens the config file and returns the fd. We >> can keep that in weston_compositor in

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-13 Thread Kristian Høgsberg
On Sun, May 12, 2013 at 07:33:44PM -0700, Othman, Ossama wrote: > Hi Kristian, > > On Sun, May 12, 2013 at 8:54 AM, Kristian Høgsberg wrote: > > > > I think we can change the interface to int open_config_file(const char > > *), which looks up and opens the config file and returns the fd. We > > c

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-13 Thread Daniel Stone
Hi, On 12 May 2013 16:54, Kristian Høgsberg wrote: > I think we can change the interface to int open_config_file(const char > *), which looks up and opens the config file and returns the fd. We > can keep that in weston_compositor instead of the config_file path. > The parse function can then fs

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-12 Thread Othman, Ossama
Hi Kristian, On Sun, May 12, 2013 at 8:54 AM, Kristian Høgsberg wrote: > > I think we can change the interface to int open_config_file(const char > *), which looks up and opens the config file and returns the fd. We > can keep that in weston_compositor instead of the config_file path. > The parse

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-12 Thread Kristian Høgsberg
On Sun, May 12, 2013 at 11:54 AM, Kristian Høgsberg wrote: > Hi Ossama, > > I think we can change the interface to int open_config_file(const char > *), which looks up and opens the config file and returns the fd. We > can keep that in weston_compositor instead of the config_file path. > The pars

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-12 Thread Kristian Høgsberg
Hi Ossama, I think we can change the interface to int open_config_file(const char *), which looks up and opens the config file and returns the fd. We can keep that in weston_compositor instead of the config_file path. The parse function can then fseek on the fd to reset to the beginning of the fi

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-11 Thread Othman, Ossama
I've revised the patch to build a list of possible filenames as Bill suggested. This time around I've included a patch for the man page, as well. Thanks! -Ossama --- Search for a given config file in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in $XDG_CONFIG_HOME or ~/.config.

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-11 Thread Othman, Ossama
Hi Bill, That's a great suggestion. I'll rework the patch. Thanks! -Ossama On Fri, May 10, 2013 at 5:32 PM, Bill Spitzak wrote: > > > Othman, Ossama wrote: > >> Hi, >> >> Minor correction to my previous patch. This revision corrects a small >> leak in config_file_path_xdg_config_**dirs(). >

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-10 Thread Bill Spitzak
Othman, Ossama wrote: Hi, Minor correction to my previous patch. This revision corrects a small leak in config_file_path_xdg_config_dirs(). Rather than have all these functions try to open the file, why not just build a list of all the possible filenames and then try to open them in orde

Re: [PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-10 Thread Othman, Ossama
Hi, Minor correction to my previous patch. This revision corrects a small leak in config_file_path_xdg_config_dirs(). Thanks! -Ossama --- Search for a given config file in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in $XDG_CONFIG_HOME or ~/.config. This allows packages to i

[PATCH] config-parser: Honor the XDG_CONFIG_DIRS environment variable

2013-05-10 Thread Othman, Ossama
Search for a given config file in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in $XDG_CONFIG_HOME or ~/.config. This allows packages to install custom config files in /etc/xdg/weston, for example, thus allowing them to avoid dealing with home directories. Signed-off-by: Ossama Ot