Re: [Linuxwacom-devel] [PATCH libwacom 3/7] tools: try the system-installed database if the local one fails

2012-04-26 Thread Bastien Nocera
On Thu, 2012-04-26 at 15:24 +1000, Peter Hutterer wrote:
> On Tue, Apr 24, 2012 at 03:48:17PM +0100, Bastien Nocera wrote:
> > On Tue, 2012-04-24 at 15:02 +1000, Peter Hutterer wrote:
> > > Signed-off-by: Peter Hutterer 
> > 
> > Is this wise? The tool isn't supposed to be installed, or is it? If it
> > is, then we shouldn't be starting with trying to read the DB from the
> > local source tree.
> 
> The tool is installed as libwacom-list-local-devices. I know the approach
> isn't ideal, but this is the closest I found to having both the local
> database work as well as the installed one.
> 
> The database searchpath is defined through TOPSRCDIR and unless we can
> somehow change this on install, we'd otherwise have to go for either always
> using the system database or always the local one.

The best would be to have 2 compilations of the program then, with
different defines. Otherwise the details of the build tree would be
leaked out (or it needs to find another way to detect that it's in the
source tree).


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 3/7] tools: try the system-installed database if the local one fails

2012-04-25 Thread Peter Hutterer
On Tue, Apr 24, 2012 at 03:48:17PM +0100, Bastien Nocera wrote:
> On Tue, 2012-04-24 at 15:02 +1000, Peter Hutterer wrote:
> > Signed-off-by: Peter Hutterer 
> 
> Is this wise? The tool isn't supposed to be installed, or is it? If it
> is, then we shouldn't be starting with trying to read the DB from the
> local source tree.

The tool is installed as libwacom-list-local-devices. I know the approach
isn't ideal, but this is the closest I found to having both the local
database work as well as the installed one.

The database searchpath is defined through TOPSRCDIR and unless we can
somehow change this on install, we'd otherwise have to go for either always
using the system database or always the local one.

Cheers,
  Peter

> 
> > ---
> >  tools/list-local-devices.c |2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c
> > index 3dbba3d..1702790 100644
> > --- a/tools/list-local-devices.c
> > +++ b/tools/list-local-devices.c
> > @@ -47,6 +47,8 @@ int main(int argc, char **argv)
> > struct dirent **namelist = NULL;
> >  
> > db = libwacom_database_new_for_path(TOPSRCDIR"/data");
> > +   if (!db)
> > +   db = libwacom_database_new();
> > if (!db) {
> > fprintf(stderr, "Failed to initialize device database\n");
> > return 1;
> 
> 

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 3/7] tools: try the system-installed database if the local one fails

2012-04-24 Thread Bastien Nocera
On Tue, 2012-04-24 at 15:02 +1000, Peter Hutterer wrote:
> Signed-off-by: Peter Hutterer 

Is this wise? The tool isn't supposed to be installed, or is it? If it
is, then we shouldn't be starting with trying to read the DB from the
local source tree.

> ---
>  tools/list-local-devices.c |2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c
> index 3dbba3d..1702790 100644
> --- a/tools/list-local-devices.c
> +++ b/tools/list-local-devices.c
> @@ -47,6 +47,8 @@ int main(int argc, char **argv)
>   struct dirent **namelist = NULL;
>  
>   db = libwacom_database_new_for_path(TOPSRCDIR"/data");
> + if (!db)
> + db = libwacom_database_new();
>   if (!db) {
>   fprintf(stderr, "Failed to initialize device database\n");
>   return 1;



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH libwacom 3/7] tools: try the system-installed database if the local one fails

2012-04-23 Thread Peter Hutterer
Signed-off-by: Peter Hutterer 
---
 tools/list-local-devices.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c
index 3dbba3d..1702790 100644
--- a/tools/list-local-devices.c
+++ b/tools/list-local-devices.c
@@ -47,6 +47,8 @@ int main(int argc, char **argv)
struct dirent **namelist = NULL;
 
db = libwacom_database_new_for_path(TOPSRCDIR"/data");
+   if (!db)
+   db = libwacom_database_new();
if (!db) {
fprintf(stderr, "Failed to initialize device database\n");
return 1;
-- 
1.7.10


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel