package apt-cacher tag 688890 pending thanks On Wed, Sep 26, 2012 at 06:51:25PM +0200, Andreas Beckmann wrote: > Package: apt-cacher > Version: 1.7.5 > Severity: serious > User: debian...@lists.debian.org > Usertags: piuparts > > Hi, > > during a test with piuparts I noticed your package modifies conffiles. > This is forbidden by the policy, see > http://www.debian.org/doc/debian-policy/ch-files.html#s-config-files
Thanks. I think the following patch addresses this issue. I have queued it for the next upload (1.7.6). DO let me know if you have any comments. Mark diff --git a/config/apt-cacher.default b/config/apt-cacher.default new file mode 100644 index 0000000..fbca293 --- /dev/null +++ b/config/apt-cacher.default @@ -0,0 +1,10 @@ +# apt-cacher daemon startup configuration file + +# Set to 1 to run apt-cacher as a standalone daemon, set to 0 if you are going +# to run apt-cacher from /etc/inetd or in CGI mode (deprecated). Alternatively, +# invoking "dpkg-reconfigure apt-cacher" should do the work for you. +# +AUTOSTART=0 + +# extra settings to override the ones in apt-cacher.conf +# EXTRAOPT=" daemon_port=3142 limit=30 " diff --git a/config/apt-cacher.default.md5sum b/config/apt-cacher.default.md5sum new file mode 100644 index 0000000..b420a60 --- /dev/null +++ b/config/apt-cacher.default.md5sum @@ -0,0 +1,4 @@ +afc7a4b065275465c1eeb5a09c985bde AUTOSTART=0 +f269a1c735ae47d7068db3ba5641a08b AUTOSTART=1 +1207bbf54d26ab191dbac80fe336dc48 pre 1.7: AUTOSTART=0 +046661f9e728b783ea90738769219d71 pre 1.7: AUTOSTART=1 diff --git a/debian/apt-cacher.default b/debian/apt-cacher.default deleted file mode 100644 index fbca293..0000000 --- a/debian/apt-cacher.default +++ /dev/null @@ -1,10 +0,0 @@ -# apt-cacher daemon startup configuration file - -# Set to 1 to run apt-cacher as a standalone daemon, set to 0 if you are going -# to run apt-cacher from /etc/inetd or in CGI mode (deprecated). Alternatively, -# invoking "dpkg-reconfigure apt-cacher" should do the work for you. -# -AUTOSTART=0 - -# extra settings to override the ones in apt-cacher.conf -# EXTRAOPT=" daemon_port=3142 limit=30 " diff --git a/debian/control b/debian/control index d34751e..78597fc 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Standards-Version: 3.9.3 Package: apt-cacher Architecture: all Pre-Depends: ${misc:Pre-Depends} -Depends: ${perl:Depends}, ${misc:Depends}, libwww-curl-perl (>=4.00), libwww-perl, libfreezethaw-perl, ed, libio-interface-perl, libfilesys-df-perl, libnetaddr-ip-perl, lsb-base (>= 3.2-14), update-inetd, libsys-syscall-perl +Depends: ${perl:Depends}, ${misc:Depends}, libwww-curl-perl (>=4.00), libwww-perl, libfreezethaw-perl, ed, libio-interface-perl, libfilesys-df-perl, libnetaddr-ip-perl, lsb-base (>= 3.2-14), update-inetd, libsys-syscall-perl, ucf (>= 0.28) Recommends: libberkeleydb-perl (>=0.34) Suggests: libio-socket-inet6-perl Description: Caching proxy for Debian package and source files diff --git a/debian/dirs b/debian/dirs index 6163473..beb34b3 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,5 +1,6 @@ usr/sbin usr/share/apt-cacher +usr/share/apt-cacher/default usr/share/apt-cacher/lib usr/share/apt-cacher/lib/Linux etc/apt-cacher diff --git a/debian/postinst b/debian/postinst index 45c7d3b..c53adf2 100755 --- a/debian/postinst +++ b/debian/postinst @@ -56,22 +56,27 @@ case "$1" in echo "Running apt-cacher's install script..." /usr/share/apt-cacher/install.pl + defaultfile='/etc/default/apt-cacher' + + ucf --debconf-ok /usr/share/apt-cacher/default/apt-cacher $defaultfile + ucfr apt-cacher $defaultfile + db_get apt-cacher/mode case "$RET" in daemon) echo "Setup apt-cacher running as standalone daemon." - sed -i 's/^[#[:space:]]*AUTOSTART=.*$/AUTOSTART=1/' /etc/default/apt-cacher # POSIX.2 RE update-inetd --remove "3142\s.+/usr/sbin/apt-cacher" # PCRE + sed -i 's/^[#[:space:]]*AUTOSTART=.*$/AUTOSTART=1/' $defaultfile # POSIX.2 RE ;; inetd) echo "Setup apt-cacher running from /etc/inetd.conf." - sed -i 's/^[#[:space:]]*AUTOSTART=.*$/AUTOSTART=0/' /etc/default/apt-cacher # POSIX.2 RE update-inetd --add "3142\tstream\ttcp\tnowait\twww-data\t/usr/sbin/apt-cacher\tapt-cacher\t-i" + sed -i 's/^[#[:space:]]*AUTOSTART=.*$/AUTOSTART=0/' $defaultfile # POSIX.2 RE ;; manual) # Disable inetd and daemon - sed -i 's/^[#[:space:]]*AUTOSTART=.*$/AUTOSTART=0/' /etc/default/apt-cacher # POSIX.2 RE update-inetd --remove "3142\s.+/usr/sbin/apt-cacher" # PCRE + sed -i 's/^[#[:space:]]*AUTOSTART=.*$/AUTOSTART=0/' $defaultfile # POSIX.2 RE cat <<EOF Manual configuration of apt-cacher startup selected. No changes made. @@ -86,6 +91,7 @@ To change your choice, run EOF ;; esac + ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/postrm b/debian/postrm index 5570376..a8831d7 100755 --- a/debian/postrm +++ b/debian/postrm @@ -4,6 +4,22 @@ set -e case "$1" in purge) + defaultfile='/etc/default/apt-cacher' + # we mimic dpkg as closely as possible, so we remove configuration + # files with dpkg and ucf backup extensions too: + ### Some of the following is from Tore Anderson: + for ext in '~' '%' .bak .dpkg-tmp .dpkg-new .dpkg-old .dpkg-dist .ucf-new .ucf-old .ucf-dist ''; do + rm -f $defaultfile$ext + done + + # and finally clear it out from the ucf database + if which ucf >/dev/null; then + ucf --purge $defaultfile + fi + if which ucfr >/dev/null; then + ucfr --purge apt-cacher $defaultfile + fi + rm -rf /var/cache/apt-cacher /var/log/apt-cacher ;; diff --git a/debian/rules b/debian/rules index 2f45fe8..e71a64b 100755 --- a/debian/rules +++ b/debian/rules @@ -46,6 +46,8 @@ install: build install -m644 config/apt-cacher.conf debian/apt-cacher/etc/apt-cacher/ install -m644 config/apache.conf debian/apt-cacher/etc/apt-cacher/ + install -m644 config/apt-cacher.default debian/apt-cacher/usr/share/apt-cacher/default/apt-cacher + install -m644 config/apt-cacher.default.md5sum debian/apt-cacher/usr/share/apt-cacher/default/apt-cacher.md5sum install -m755 apt-cacher-cgi.pl debian/apt-cacher/usr/share/apt-cacher/ install -m755 apt-cacher debian/apt-cacher/usr/share/apt-cacher/ install -m755 apt-proxy-to-apt-cacher debian/apt-cacher/usr/share/apt-cacher/ -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org