tags 688736 patch
thanks

Hi,

 I've created patch for this bug, piuparts clean one.
 It seems to be good for me, please check it.
 Thanks.


-- 
Regards,

 Hideki Yamane     henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane
diff -Nru w3c-linkchecker-4.81/debian/changelog w3c-linkchecker-4.81/debian/changelog
--- w3c-linkchecker-4.81/debian/changelog	2012-02-11 02:50:53.000000000 +0900
+++ w3c-linkchecker-4.81/debian/changelog	2012-09-26 07:24:37.000000000 +0900
@@ -1,3 +1,19 @@
+w3c-linkchecker (4.81-4.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/{postinst,w3c-linkchecker.install}
+    - Not use linkchecker.conf as conffile but template file and use ucf
+      for conffile. It prevents modifing conffiles (violate policy 10.7.3)
+      (Closes: #688736)
+  * debian/control
+    - "Depends: ucf"
+  * debian/postrm
+    - remove /etc/w3c/checklink.conf and temprary files when purging package. 
+  * debian/config
+    - fix some cosmetic things
+
+ -- Hideki Yamane <henr...@debian.org>  Wed, 26 Sep 2012 07:24:33 +0900
+
 w3c-linkchecker (4.81-4) unstable; urgency=low
 
   * Updated Czech translation (Closes: #658398)
diff -Nru w3c-linkchecker-4.81/debian/config w3c-linkchecker-4.81/debian/config
--- w3c-linkchecker-4.81/debian/config	2012-02-03 19:07:10.000000000 +0900
+++ w3c-linkchecker-4.81/debian/config	2012-09-26 04:51:33.000000000 +0900
@@ -1,11 +1,13 @@
-#!/bin/sh -e
+#!/bin/sh
 
 set -e
 
 # Source debconf library.
 . /usr/share/debconf/confmodule
+db_version 2.0
 
 db_input low w3c-linkchecker/hostname || true
 db_input low w3c-linkchecker/private_ips || true
 db_go
 
+exit 0
diff -Nru w3c-linkchecker-4.81/debian/control w3c-linkchecker-4.81/debian/control
--- w3c-linkchecker-4.81/debian/control	2012-02-05 04:13:56.000000000 +0900
+++ w3c-linkchecker-4.81/debian/control	2012-09-26 06:48:04.000000000 +0900
@@ -16,7 +16,7 @@
 Depends: ${misc:Depends}, ${perl:Depends}, libcss-dom-perl,
  libhtml-parser-perl, libwww-perl (>= 5.833), liburi-perl (>= 1.53),
  libconfig-general-perl, libnet-ip-perl, libterm-readkey-perl,
- libencode-locale-perl
+ libencode-locale-perl, ucf
 Recommends: w3c-markup-validator, apache2 | httpd-cgi
 Description: tool to verify the links in a web page are still valid
  This manual page documents briefly the checklink command, a.k.a. the W3C®
diff -Nru w3c-linkchecker-4.81/debian/postinst w3c-linkchecker-4.81/debian/postinst
--- w3c-linkchecker-4.81/debian/postinst	2012-02-03 19:07:10.000000000 +0900
+++ w3c-linkchecker-4.81/debian/postinst	2012-09-26 07:13:40.000000000 +0900
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh 
 # postinst script for w3c-linkchecker
 #
 # see: dh_installdeb(1)
@@ -6,6 +6,7 @@
 set -e
 
 . /usr/share/debconf/confmodule
+db_version 2.0
 
 # summary of how this script can be called:
 #        * <postinst> `configure' <most-recently-configured-version>
@@ -23,12 +24,15 @@
 case "$1" in
     configure)
 
+        CFG_TEMPLATE=/usr/share/w3c-linkchecker/checklink.conf
+        CFG_TMP=/etc/w3c/checklink.conf.tmp
         CFG_FILE=/etc/w3c/checklink.conf
 
         db_get w3c-linkchecker/hostname
         if [ "$RET" ]
         then
-            sed -i -e "s|^Doc_URI = http://[a-z0-9.]\+/|Doc_URI = http://$RET/|" $CFG_FILE
+            sed -e "s|^Doc_URI = http://[a-z0-9.]\+/|Doc_URI = http://$RET/|" \
+              < $CFG_TEMPLATE > $CFG_TMP
         fi
 
         db_get w3c-linkchecker/private_ips
@@ -39,9 +43,14 @@
             then
                 VALUE=0
             fi
-            sed -i -e "s|^\(# \)\?Allow_Private_IPs = [01]$|Allow_Private_IPs = $VALUE|" $CFG_FILE
+            sed -e "s|^\(# \)\?Allow_Private_IPs = [01]$|Allow_Private_IPs = $VALUE|" \
+              < $CFG_TEMPLATE > $CFG_TMP
         fi
 
+        ucf --debconf-ok $CFG_TMP $CFG_FILE && rm -f $CFG_TMP
+        db_stop
+
+
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
diff -Nru w3c-linkchecker-4.81/debian/postrm w3c-linkchecker-4.81/debian/postrm
--- w3c-linkchecker-4.81/debian/postrm	1970-01-01 09:00:00.000000000 +0900
+++ w3c-linkchecker-4.81/debian/postrm	2012-09-26 07:11:37.000000000 +0900
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+set -e
+
+CFG_FILE=/etc/w3c/checklink.conf
+
+case "$1" in
+    purge)
+
+    if which ucf >/dev/null 2>&1; then
+        ucf --purge $CFG_FILE
+    else
+        rm -f $CFG_FILE
+    fi
+
+    for ext in .bak .tmp .dpkg-tmp .dkpg-new .dpkg-old .ucf-new .ucf-old .ucf-dist
+    do
+       rm -f $CFG_FILE$ext
+    done
+
+    ;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff -Nru w3c-linkchecker-4.81/debian/w3c-linkchecker.install w3c-linkchecker-4.81/debian/w3c-linkchecker.install
--- w3c-linkchecker-4.81/debian/w3c-linkchecker.install	2012-02-03 19:07:10.000000000 +0900
+++ w3c-linkchecker-4.81/debian/w3c-linkchecker.install	2012-09-26 06:27:01.000000000 +0900
@@ -1,5 +1,5 @@
 bin/checklink usr/bin
-etc/checklink.conf etc/w3c/
+etc/checklink.conf usr/share/w3c-linkchecker/
 docs/* usr/share/w3c-linkchecker/docs/
 images/* usr/share/w3c-linkchecker/images/
 debian/apache2-linkchecker.conf etc/w3c/

Reply via email to