[pacman-dev] [PATCH 1/4] Use sysconfdir instead of hardcoded /etc

Nezmer git at nezmer.info
Mon Oct 11 15:57:46 EDT 2010


On Mon, Oct 11, 2010 at 02:52:01PM -0500, Dan McGee wrote:
> On Mon, Oct 11, 2010 at 2:16 PM, Nezmer <git at nezmer.info> wrote:
> >  "/etc" was hardcoded in some scripts and manpages. Change this to
> >  respect sysconfdir
> >
> > Signed-off-by: Nezmer <git at nezmer.info>
> > ---
> >  contrib/Makefile.am       |   10 ++++++++++
> >  contrib/bacman            |   12 ++++++------
> >  contrib/pacscripts        |    2 +-
> >  contrib/pactree           |    6 +++---
> >  contrib/wget-xdelta.sh    |    4 ++--
> >  contrib/zsh_completion    |    6 +++---
> >  doc/Makefile.am           |    8 ++++++++
> >  doc/makepkg.8.txt         |    2 +-
> >  doc/pacman.conf.5.txt     |    4 ++--
> >  scripts/rankmirrors.sh.in |    2 +-
> >  10 files changed, 37 insertions(+), 19 deletions(-)
> >
> > diff --git a/contrib/Makefile.am b/contrib/Makefile.am
> > index c6243b1..cb2ffc7 100644
> > --- a/contrib/Makefile.am
> > +++ b/contrib/Makefile.am
> > @@ -12,4 +12,14 @@ EXTRA_DIST = \
> >        zsh_completion \
> >        README
> >
> > +edit = sed -e 's|@sysconfdir[@]|$(sysconfdir)|g'
> > +
> > +# Use sysconfdir
> > +$(EXTRA_DIST): Makefile
> > +       cp -a $@ $@.tmp # To reserve permissions in tmp files
> > +       $(edit) $@ >$@.tmp || true
> > +       mv $@.tmp $@
> > +
> > +all-am: $(EXTRA_DIST)
> > +
> 
> Unfortunately, none of this works quite as expected unless I am
> missing something.
> 1) You will immediately mark files as dirty to git and
> 2) there is no more @sysconfdir@ once this runs once, making it not
> all that useful.
> 
> The first step to these patches will be to do to contrib/ what was
> done to scripts/ way back when, and move them to extensions such as
> .sh.in and then have the final result in a bare .sh file.
> 
> -Dan
> 

I know.

I wasn't sure you would accept renaming all files.


More information about the pacman-dev mailing list