On 8 January 2014 05:59, Ben Pfaff <b...@cs.stanford.edu> wrote: > I think that the following change to Gnulib would clarify. I > have not actually tested the shell code it suggests, although I > probably should. Will you take a look at it? > > diff --git a/doc/relocatable-maint.texi b/doc/relocatable-maint.texi > index 58160cf..86d1438 100644 > --- a/doc/relocatable-maint.texi > +++ b/doc/relocatable-maint.texi > @@ -122,12 +122,20 @@ if test "@@RELOCATABLE@@" = yes; then > orig_installdir="$bindir" # see Makefile.am's *_SCRIPTS variables > func_find_curr_installdir # determine curr_installdir > func_find_prefixes > - # Relocate the directory variables that we use. > - gettext_dir=` > - echo "$gettext_dir/" \ > + relocate () { > + echo "$1/" \ > | sed -e "s%^$@{orig_installprefix@}/%$@{curr_installprefix@}/%" \ > - | sed -e 's,/$,,'` > + | sed -e 's,/$,,' > + } > +else > + relocate () { > + echo "$1" > + } > fi > + > +# Get some relocated directory names. > +sysconfdir=`relocate "@@sysconfdir@@"` > +some_datadir=`relocate "@@datadir@@/something"` > @end example > > You must adapt the definition of @code{orig_installdir}, depending on >
This looks good to me. I don't currently have a shell use via which to test it, but I will implement the same idea in my Perl version. -- http://rrt.sc3d.org