From: Luigi Rizzo Date: Mon, 5 Nov 2007 19:22:56 +0000 (+0000) Subject: Cleanup the installation of samples, avoiding repetitions. X-Git-Tag: 1.6.0-beta1~3^2~1002 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6ee4667da22ba08a0aeda18d176bf56e8900fc3;p=thirdparty%2Fasterisk.git Cleanup the installation of samples, avoiding repetitions. I am preserving the behaviour on *.adsi files, i.e. overwrite anything there without making a backup. However I am not sure that this is the intended behaviour. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88675 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/Makefile b/Makefile index 41aa3d2811..8b9ebd6a0c 100644 --- a/Makefile +++ b/Makefile @@ -539,32 +539,42 @@ install: datafiles bininstall $(SUBDIRS_INSTALL) upgrade: bininstall +# XXX why *.adsi is installed first ? adsi: - mkdir -p $(DESTDIR)$(ASTETCDIR) - for x in configs/*.adsi; do \ - if [ ! -f $(DESTDIR)$(ASTETCDIR)/$$x ]; then \ - $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \ + @echo Installing adsi config files... + @mkdir -p $(DESTDIR)$(ASTETCDIR) + @for x in configs/*.adsi; do \ + dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \ + if [ -f $${dst} ] ; then \ + echo "Overwriting $$x" ; \ + else \ + echo "Installing $$x" ; \ fi ; \ + $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \ done samples: adsi - mkdir -p $(DESTDIR)$(ASTETCDIR) - for x in configs/*.sample; do \ - if [ -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \ + @echo Installing other config files... + @mkdir -p $(DESTDIR)$(ASTETCDIR) + @for x in configs/*.sample; do \ + dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ; \ + if [ -f $${dst} ]; then \ if [ "$(OVERWRITE)" = "y" ]; then \ - if cmp -s $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $$x ; then \ + if cmp -s $${dst} $$x ; then \ echo "Config file $$x is unchanged"; \ continue; \ fi ; \ - mv -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`.old ; \ + mv -f $${dst} $${dst}.old ; \ else \ echo "Skipping config file $$x"; \ continue; \ fi ;\ fi ; \ - $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ;\ + echo "Installing file $$x"; \ + $(INSTALL) -m 644 $$x $${dst} ;\ done - if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \ + @if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \ + echo "Creating asterisk.conf"; \ ( \ echo "[directories]" ; \ echo "astetcdir => $(ASTETCDIR)" ; \