FAQ | This is a LIVE service | Changelog

Commit 08d12c3c authored by Dr Adam Thorn's avatar Dr Adam Thorn
Browse files

fix logic for generating DEBIAN/conffiles

Two errors fixed here..

1. where we had an extant DEBIAN/conffiles, we performed a 'find' and attempted
   to grep out line already in that file. However, the grep was non-anchored
   so risked having false hits from substrings in a larger string

2. conffiles should "be listed as absolute pathnames", but we were omitting
   the leading slash.

Rather than try to grep, let's just generate our list of conffiles and
make sure it's been through "sort -u".

I've checked that switching from a list of conffiles without leading
slashes to having them be present does not cause problems when upgrading. For
example, unattended-upgrades says..

found pkg: chem-zfs-backup-server
conffile line: /etc/init.d/zfs-backup 3dabfa1996c2405aae81b4468f6cfb6f
current md5: 3dabfa1996c2405aae81b4468f6cfb6f

and proceeds unimpeded. And, an interactive "apt-get install" does not
lead to any conffile-related prompts.
parent 86d6182c
......@@ -58,11 +58,8 @@ build:
@if [ -f $(BUILDDIR)/DEBIAN/postrm ] ; then chmod 755 $(BUILDDIR)/DEBIAN/postrm ; fi
@if [ -f $(BUILDDIR)/DEBIAN/config ] ; then chmod 755 $(BUILDDIR)/DEBIAN/config ; fi
@if [ -f $(BUILDDIR)/DEBIAN/templates ] ; then chmod 755 $(BUILDDIR)/DEBIAN/templates ; fi
@if [ -f $(BUILDDIR)/DEBIAN/conffiles ] ; then \
(cd $(BUILDDIR) ; [ -d etc ] && find etc -type f -exec grep -v -q {} DEBIAN/conffiles \; -exec echo {} >> DEBIAN/conffiles \; || true) ; \
else \
(cd $(BUILDDIR) ; [ -d etc ] && find etc -type f -exec echo {} >> DEBIAN/conffiles \; || true) ; \
fi
@(cd $(BUILDDIR) ; [ -d etc ] && find etc -type f -exec echo /{} >> DEBIAN/conffiles \; || true)
@(cd $(BUILDDIR) ; [ -f DEBIAN/conffiles ] && sort -u -o DEBIAN/conffiles DEBIAN/conffiles || true)
@(cd $(BUILDDIR) ; find -path ./DEBIAN -prune -o -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums )
@if [ -d DOC ] ; then mkdir $(BUILDDIR)/usr/share/doc/$(PKG) -p ; (cd DOC && tar --dereference -cf - .) | (cd $(BUILDDIR)/usr/share/doc/$(PKG) && tar -xvf -) ; fi
@chmod -R g-s $(BUILDDIR)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment