diff options
author | Shaun McCance <shaunm@gnome.org> | 2011-05-27 12:09:10 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2011-05-27 12:09:10 -0400 |
commit | 00a8df54545a66aa70c20ceecb19709ca0b811a7 (patch) | |
tree | a50a284952d9cb31076773db7cf99f3e5138c0ed | |
parent | abd3afc9bd7066658d295de3a39c5c0b287d0644 (diff) | |
download | itstool-00a8df54545a66aa70c20ceecb19709ca0b811a7.tar.gz |
Include installation dir in search path if XDG_DATA_DIRS not set
-rw-r--r-- | configure.ac | 9 | ||||
-rwxr-xr-x | itstool.in | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 5eed58e..8618395 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,15 @@ AC_INIT([itstool], [1.0.1], []) AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-bzip2]) +DATADIR=`( + case $prefix in + NONE) prefix=$ac_default_prefix ;; + *) ;; + esac + eval echo $(eval echo $datadir) +)` +AC_SUBST([DATADIR]) + AC_CONFIG_FILES([ Makefile itstool @@ -1,6 +1,7 @@ #!/usr/bin/env python VERSION="@VERSION@" +DATADIR="@DATADIR@" import gettext import hashlib @@ -386,7 +387,9 @@ class Document (object): dirs.append(ddir) ddir = os.getenv('XDG_DATA_DIRS', '') if ddir == '': - ddir = '/usr/local/share:/usr/share' + if DATADIR not in ('/usr/local/share', '/usr/share'): + ddir += DATADIR + ':' + ddir += '/usr/local/share:/usr/share' dirs.extend(ddir.split(':')) ddone = {} for ddir in dirs: |