diff options
| author | Tatsuya Kinoshita <tats@vega.ocn.ne.jp> | 2011-05-04 07:18:58 +0000 | 
|---|---|---|
| committer | Tatsuya Kinoshita <tats@vega.ocn.ne.jp> | 2011-05-04 07:18:58 +0000 | 
| commit | e96bb77ee5da15a17880860b5b203f03f67777e5 (patch) | |
| tree | f9f9838584509c992a51635b56d361efee4e6b17 /debian/postinst | |
| parent | Releasing debian version 0.5.1-1 (diff) | |
| download | w3m-e96bb77ee5da15a17880860b5b203f03f67777e5.tar.gz w3m-e96bb77ee5da15a17880860b5b203f03f67777e5.zip | |
Releasing debian version 0.5.1-3debian/0.5.1-3
Diffstat (limited to 'debian/postinst')
| -rw-r--r-- | debian/postinst | 27 | 
1 files changed, 21 insertions, 6 deletions
| diff --git a/debian/postinst b/debian/postinst index 74caddf..1ba8910 100644 --- a/debian/postinst +++ b/debian/postinst @@ -11,12 +11,27 @@ case "$1" in             /usr/bin/w3m 25 \  	   --slave /usr/share/man/man1/www-browser.1.gz www-browser.1.gz \  	   /usr/share/man/man1/w3m.1.gz -	# Remove the conffile with the wrong location (the binary never used -	# it) that may be present from an older version. -	# (In our preinst, we've already ensured the sysadmin had a chance -	# of preserving any configuration made in it) -	rm -f /etc/w3m/w3mconfig -	;; +       # upgrade old config file to new config file +       if test -e /etc/w3m/w3mconfig; then +	   mv -f /etc/w3m/w3mconfig /etc/w3m/w3mconfig.dpkg-tmp +	   tmp=$(tempfile -p w3m.subst.) +	   trap "rm -f $tmp" 0 1 2 15 +	   while read opt val +	   do +	      val0=$(sed -ne 's/^'$opt'[[:space:]]*//p' /etc/w3m/w3mconfig.dpkg-tmp) +	      if [ "$val0" != "" ] && [ "$val" != "$val0" ]; then +		  echo 's/^'$opt'[[:space:]]*.*/'$opt' '$val0'/' >> $tmp +	      fi +	   done < /etc/w3m/config +	   if test -s $tmp; then +	       mv -f /etc/w3m/config /etc/w3m/config.dpkg-tmp +	       sed -f $tmp /etc/w3m/config.dpkg-tmp > /etc/w3m/config +	       rm -f $tmp +	       rm -f /etc/w3m/config.dpkg-tmp +	   fi +	   rm -f /etc/w3m/w3mconfig /etc/w3m/w3mconfig.dpkg-tmp +       fi +       ;;    *)  esac | 
