]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Provide an AFSDIR_DATA_DIR path for architecture-independent data
authorRuss Allbery <rra@stanford.edu>
Wed, 15 Jul 2009 06:22:00 +0000 (23:22 -0700)
committerDerrick Brashear <shadow@dementia.org>
Thu, 16 Jul 2009 17:06:28 +0000 (11:06 -0600)
Add AFSDIR_DATA_DIR to dirpath.h, defined to be the location for
installing and finding architecture-independent data files.  Add a
corresponding AFSDIR_CLIENT_DATA_DIRPATH macro that retrieves the
possibly-prefixed version of this path.  This will be ${datadir}/openafs
with normal UNIX installation paths and /usr/vice/etc for Transarc
paths.  Since there is no apparent need for this path on Windows, it
is not defined in Windows builds.

The only intended use for this path for right now is the message
catalog for fstrace.

Reviewed-on: http://gerrit.openafs.org/91
Verified-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
acinclude.m4
src/config/Makefile.config.in
src/util/Makefile.in
src/util/dirpath.c
src/util/dirpath.hin

index 0c2d8eeeb3f07d730e8a8eb55a604052323708d3..8aafc1615a771b5173d2feaf7da50afa07ddf80d 100644 (file)
@@ -1642,6 +1642,7 @@ if test "x$enable_transarc_paths" = "xyes"  ; then
     afslocaldir=${afslocaldir=/usr/afs/local}
     afsbackupdir=${afsbackupdir=/usr/afs/backup}
     afsbosconfigdir=${afsbosconfigdir=/usr/afs/local}
+    afsdatadir=${afsdatadir=/usr/vice/etc}
 else 
     afsconfdir=${afsconfdir='${sysconfdir}/openafs/server'}
     viceetcdir=${viceetcdir='${sysconfdir}/openafs'}
@@ -1654,6 +1655,7 @@ else
     afslocaldir=${afslocaldir='${localstatedir}/openafs'}
     afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'}
     afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'}
+    afsdatadir=${afsdatadir='${datadir}/openafs'}
 fi
 AC_SUBST(afsconfdir)
 AC_SUBST(viceetcdir)
@@ -1666,6 +1668,7 @@ AC_SUBST(afslogsdir)
 AC_SUBST(afslocaldir)
 AC_SUBST(afsbackupdir)
 AC_SUBST(afsbosconfigdir)
+AC_SUBST(afsdatadir)
 
 if test "x$enable_kernel_module" = "xyes"; then
 ENABLE_KERNEL_MODULE=libafs
index a12a9d7ceaef1c4c93a477b7277ea8ffe7470de1..792ea4481e37ef159a6fc21db5dec858b24d6339 100644 (file)
@@ -11,9 +11,11 @@ afssrvbindir=@afssrvbindir@
 afskerneldir=@afskerneldir@
 afssrvlibexecdir=@afssrvlibexecdir@
 afssrvsbindir=@afssrvsbindir@
+afsdatadir=@afsdatadir@
 bindir=@bindir@
 exec_prefix=@exec_prefix@
 datarootdir=@datarootdir@
+datadir=@datadir@
 includedir=@includedir@
 libdir=@libdir@
 libexecdir=@libexecdir@
index 86869e9d707ab810a8a6aa582829cf5334c670d7..c39998fd61d3bde3a6c0d5cfe12342bf881b5bdb 100644 (file)
@@ -117,6 +117,7 @@ dirpath.h: ${srcdir}/dirpath.hin Makefile
                -e 's"@afslocaldir"${afslocaldir}"' \
                -e 's"@afsbackupdir"${afsbackupdir}"' \
                -e 's"@afsbosconfigdir"${afsbosconfigdir}"' \
+               -e 's"@afsdatadir"${afsdatadir}"' \
                ${srcdir}/dirpath.hin >dirpath.h.tmp && \
                if cmp dirpath.h.tmp dirpath.h >/dev/null ; then : ; else \
                mv dirpath.h.tmp dirpath.h ; fi)
index dbc69fe8ea6e0974b414750806d511b9a664663d..ca116b1c752df84a1d679c86e5bb0146a1b0bcf7 100644 (file)
@@ -239,6 +239,11 @@ initDirPathArray(void)
        AFSDIR_CLIENT_DIRPATH(pathp, AFSDIR_CLIENT_ETC_DIR);
 #endif /* AFS_NT40_ENV */
 
+#ifndef AFS_NT40_ENV
+    pathp = dirPathArray[AFSDIR_CLIENT_DATA_DIRPATH_ID];
+    AFSDIR_CLIENT_DIRPATH(pathp, AFSDIR_DATA_DIR);
+#endif
+
     /* server file paths */
     pathp = dirPathArray[AFSDIR_SERVER_THISCELL_FILEPATH_ID];
     AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_SERVER_ETC_DIR,
index ae1c46a78ec44b394f22c3cdd046fe12782c6191..db1dd8a4e6a4c561edf5382de10301c932b30638 100644 (file)
@@ -114,6 +114,7 @@ ConstructLocalLogPath(const char *cpath,
 #define AFSDIR_BIN_FILE_DIR  "@afslocaldir/migrate/bin_files"
 #define AFSDIR_BOSCONFIG_DIR "@afsbosconfigdir"
 #define AFSDIR_BOSSERVER_DIR "@afssrvsbindir"
+#define AFSDIR_DATA_DIR      "@afsdatadir"
 
 /* file names */ 
 #define AFSDIR_THISCELL_FILE    "ThisCell"
@@ -227,6 +228,7 @@ typedef enum afsdir_id {
       AFSDIR_SERVER_BACKUP_DIRPATH_ID,
       AFSDIR_CLIENT_VICE_DIRPATH_ID,
       AFSDIR_CLIENT_ETC_DIRPATH_ID,
+      AFSDIR_CLIENT_DATA_DIRPATH_ID,
       AFSDIR_SERVER_THISCELL_FILEPATH_ID,
       AFSDIR_SERVER_CELLSERVDB_FILEPATH_ID,
       AFSDIR_SERVER_NOAUTH_FILEPATH_ID,
@@ -302,6 +304,7 @@ const char *getDirPath(afsdir_id_t string_id);
 /* client subdir paths */
 #define AFSDIR_CLIENT_VICE_DIRPATH getDirPath(AFSDIR_CLIENT_VICE_DIRPATH_ID)
 #define AFSDIR_CLIENT_ETC_DIRPATH getDirPath(AFSDIR_CLIENT_ETC_DIRPATH_ID)
+#define AFSDIR_CLIENT_DATA_DIRPATH getDirPath(AFSDIR_CLIENT_DATA_DIRPATH_ID)
 #define AFSDIR_SERVER_BIN_FILE_DIRPATH getDirPath(AFSDIR_SERVER_BIN_FILE_DIRPATH_ID)
 
 /* server file paths */