Bug 169328 - net/avahi-app unconditionally overwrites modified configuration files
Summary: net/avahi-app unconditionally overwrites modified configuration files
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-22 17:00 UTC by Dan McGregor
Modified: 2013-01-01 19:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan McGregor 2012-06-22 17:00:09 UTC
This may well be an upstream bug, but when performing a make reinstall or make install of avahi-app the configuration files avahi-daemon and hosts are installed in $LOCALBASE/etc/avahi, even if the files already exist.

The relevant lines of the build log are:

test -z "/usr/local/etc/avahi" || .././install-sh -c -d "/usr/local/etc/avahi"
 install  -o root -g wheel -m 444 avahi-daemon.conf hosts '/usr/local/etc/avahi'
gmake[1] : on quitte le répertoire « /usr/obj/usr/ports/net/avahi-app/work/avahi-0.6.29/avahi-daemon »

Later on in the install it installs them conditionally (this is after the gmake install phase):

install  -o root -g wheel -m 444 /usr/obj/usr/ports/net/avahi-app/work/avahi-0.6.29/avahi-daemon/hosts  /usr/local/etc/avahi/hosts.dist
if [ ! -f /usr/local/etc/avahi/hosts ]; then  install  -o root -g wheel -m 444 /usr/obj/usr/ports/net/avahi-app/work/avahi-0.6.29/avahi-daemon/hosts  /usr/local/etc/avahi;  fi
install  -o root -g wheel -m 444 /usr/obj/usr/ports/net/avahi-app/work/avahi-0.6.29/avahi-daemon/avahi-daemon.conf  /usr/local/etc/avahi/avahi-daemon.conf.dist
if [ ! -f /usr/local/etc/avahi/avahi-daemon.conf ]; then  install  -o root -g wheel -m 444 /usr/obj/usr/ports/net/avahi-app/work/avahi-0.6.29/avahi-daemon/avahi-daemon.conf  /usr/local/etc/avahi;  fi

This makes upgrades awkward.

Fix: 

I suggest we disable installing config files in the gmake install phase and only perform the latter.  I don't know enough about autotools though to know how to do that.
How-To-Repeat: Install net/avahi-app
edit $LOCALBASE/etc/avahi/hosts or avahi-daemon.conf
upgrade net/avahi-app
cd $LOCALBASE/etc/avahi
diff hosts.dist hosts
diff avahi-daemon.conf.dist avahi-daemon.conf
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-06-22 17:00:30 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gnome

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-01-01 19:41:08 UTC
Author: mezz
Date: Tue Jan  1 19:41:00 2013
New Revision: 309780
URL: http://svnweb.freebsd.org/changeset/ports/309780

Log:
  Do not overwrite the configuration file at the each update or reinstall by
  disable its Makefile to install it as we already do it by manually. The patch
  was somehow lost in later version.
  
  PR:		ports/169328
  Reported by:	Dan McGregor <dan.mcgregor@usask.ca>

Modified:
  head/net/avahi-app/files/patch-avahi-daemon_Makefile.in   (contents, props changed)

Modified: head/net/avahi-app/files/patch-avahi-daemon_Makefile.in
==============================================================================
--- head/net/avahi-app/files/patch-avahi-daemon_Makefile.in	Tue Jan  1 19:38:28 2013	(r309779)
+++ head/net/avahi-app/files/patch-avahi-daemon_Makefile.in	Tue Jan  1 19:41:00 2013	(r309780)
@@ -1,6 +1,6 @@
---- avahi-daemon/Makefile.in.orig	2010-07-24 19:49:59.000000000 -0400
-+++ avahi-daemon/Makefile.in	2010-07-24 19:51:01.000000000 -0400
-@@ -69,7 +69,7 @@ host_triplet = @host@
+--- avahi-daemon/Makefile.in.orig	2013-01-01 13:29:10.000000000 -0600
++++ avahi-daemon/Makefile.in	2013-01-01 13:31:10.000000000 -0600
+@@ -69,7 +69,7 @@
  @ENABLE_CHROOT_TRUE@@HAVE_LIBDAEMON_TRUE@@HAVE_XML_TRUE@	caps.c caps.h
  
  @ENABLE_CHROOT_TRUE@@HAVE_LIBDAEMON_TRUE@@HAVE_XML_TRUE@am__append_3 = -lcap
@@ -9,7 +9,7 @@
  @HAVE_DBUS_TRUE@@HAVE_LIBDAEMON_TRUE@@HAVE_XML_TRUE@am__append_5 = \
  @HAVE_DBUS_TRUE@@HAVE_LIBDAEMON_TRUE@@HAVE_XML_TRUE@	dbus-protocol.c dbus-protocol.h \
  @HAVE_DBUS_TRUE@@HAVE_LIBDAEMON_TRUE@@HAVE_XML_TRUE@	dbus-util.c dbus-util.h \
-@@ -678,7 +678,7 @@ clean-sbinPROGRAMS:
+@@ -682,7 +682,7 @@
  	rm -f $$list
  avahi-daemon$(EXEEXT): $(avahi_daemon_OBJECTS) $(avahi_daemon_DEPENDENCIES) 
  	@rm -f avahi-daemon$(EXEEXT)
@@ -18,3 +18,32 @@
  ini-file-parser-test$(EXEEXT): $(ini_file_parser_test_OBJECTS) $(ini_file_parser_test_DEPENDENCIES) 
  	@rm -f ini-file-parser-test$(EXEEXT)
  	$(AM_V_CCLD)$(ini_file_parser_test_LINK) $(ini_file_parser_test_OBJECTS) $(ini_file_parser_test_LDADD) $(LIBS)
+@@ -1283,17 +1283,17 @@
+ 	echo " ( cd '$(DESTDIR)$(servicedir)' && rm -f" $$files ")"; \
+ 	cd "$(DESTDIR)$(servicedir)" && rm -f $$files
+ install-pkgsysconfDATA: $(pkgsysconf_DATA)
+-	@$(NORMAL_INSTALL)
+-	test -z "$(pkgsysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgsysconfdir)"
+-	@list='$(pkgsysconf_DATA)'; test -n "$(pkgsysconfdir)" || list=; \
+-	for p in $$list; do \
+-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+-	  echo "$$d$$p"; \
+-	done | $(am__base_list) | \
+-	while read files; do \
+-	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgsysconfdir)'"; \
+-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgsysconfdir)" || exit $$?; \
+-	done
++#	@$(NORMAL_INSTALL)
++#	test -z "$(pkgsysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgsysconfdir)"
++#	@list='$(pkgsysconf_DATA)'; test -n "$(pkgsysconfdir)" || list=; \
++#	for p in $$list; do \
++#	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
++#	  echo "$$d$$p"; \
++#	done | $(am__base_list) | \
++#	while read files; do \
++#	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgsysconfdir)'"; \
++#	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgsysconfdir)" || exit $$?; \
++#	done
+ 
+ uninstall-pkgsysconfDATA:
+ 	@$(NORMAL_UNINSTALL)
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Jeremy Messenger freebsd_committer freebsd_triage 2013-01-01 19:41:09 UTC
State Changed
From-To: open->closed

I have committed a fix. Thanks for report!