nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] some build stuff


From: Mike Frysinger
Subject: Re: [Nano-devel] some build stuff
Date: Mon, 16 Jun 2014 14:26:38 -0400
User-agent: KMail/4.13.1 (Linux/3.14.2; KDE/4.13.1; x86_64; ; )

On Mon 16 Jun 2014 16:54:34 Benno Schulenberg wrote:
> On Mon, Jun 16, 2014, at 9:03, Mike Frysinger wrote:
> > On Thu 05 Jun 2014 22:43:00 Benno Schulenberg wrote:
> > > In the man pages and in the info document there a few references to
> > > SYSCONFDIR/nanorc.  I find this ugly -- SYSCONFDIR is not something
> > > that the user should know.  Ideally it would get replaced at build
> > > time by /etc (or whatever $sysconfdir has been set to at that time).
> > > How to go about this?
> > 
> > well, here's the fun part ... those paths (by design) aren't known until
> > `make` time.  you can't sanely expand them at configure time.
> > 
> > your best bet probably would be to add an install hook that'd run sed on
> > the files and replace SYSCONFDIR with $(sysconfdir) (or whatever the
> > variable is named).
> 
> Oww... what a complication, having to do this separately for
> $(man1dir), $(man5dir), $(htmldir), $(infodir)...  Isn't there
> a way to tell install to filter each file before installation?
> 
> Hmmm...  It seems there is!  After adding these two lines to
> doc/man/Makefile.am:
> 
> INSTALL = install -s --strip-program=../sedscript
> export SISSICONF=$(sysconfdir)
> 
> and putting in a doc/sedscript file this:
> 
> #!/bin/sh
> sed -i "s:SYSCONFDIR:${SISSICONF}:" $1
> 
> doing an installation works beautifully.
> 
> Now the question... is this sane?  Portable?  Acceptable?

i think the easiest answer is to just rephrase the man pages and not try to 
hack the files at all.

otherwise, you'd add an install time hook that'd run that script on the 
installed files.
-mike

diff --git a/doc/man/nano.1 b/doc/man/nano.1
index 1854fc9..e5dfb59 100644
--- a/doc/man/nano.1
+++ b/doc/man/nano.1
@@ -78,7 +78,7 @@ Log search and replace strings to 
\fI~/.nano/search_history\fP, so they can be
 retrieved in later sessions (if \fInanorc\fP support has been compiled in).
 .TP
 .B \-I (\-\-ignorercfiles)
-Don't look at \fISYSCONFDIR/nanorc\fP or \fI~/.nanorc\fP
+Don't look at the system \fInanorc\fP or \fI~/.nanorc\fP
 (if \fInanorc\fP support has been compiled in).
 .TP
 .B \-K (\-\-rebindkeypad)
@@ -228,7 +228,7 @@ Ignored, for compatibility with Pico.
 
 .SH INITIALIZATION FILE
 \fBnano\fP will read initialization files in the following order:
-\fISYSCONFDIR/nanorc\fP, then \fI~/.nanorc\fP.  Please see
+system \fInanorc\fP, then \fI~/.nanorc\fP.  Please see
 \fBnanorc(5)\fP and the example file \fBnanorc.sample\fP, both of which
 should be provided with \fBnano\fP.
 
diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5
index 773f8af..2190a56 100644
--- a/doc/man/nanorc.5
+++ b/doc/man/nanorc.5
@@ -29,8 +29,8 @@ nanorc \- GNU nano's rcfile
 The \fInanorc\fP file contains the default settings for \fBnano\fP, a
 small and friendly editor.  The file should be in Unix format, not in
 DOS or Mac format.  During startup, \fBnano\fP will first read the
-system-wide settings, from \fBSYSCONFDIR/nanorc\fP, and then the
-user-specific settings, from \fB~/.nanorc\fP.
+system-wide settings, from \fB/etc/nanorc\fP (exact path might be different),
+and then the user-specific settings, from \fB~/.nanorc\fP.
 
 .SH OPTIONS
 The configuration file accepts a series of \fBset\fP and \fBunset\fP

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]