From 9caa28600a47cc37031251eb77841861ca0c0eaa Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 4 Jun 2007 22:12:52 +0000 Subject: * Use dpkg-query to fetch conffile md5sums rather than parsing /var/lib/dpkg/status directly. --- debian/openssh-client.preinst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'debian/openssh-client.preinst') diff --git a/debian/openssh-client.preinst b/debian/openssh-client.preinst index 9cf29dfba..fd55a53bd 100644 --- a/debian/openssh-client.preinst +++ b/debian/openssh-client.preinst @@ -11,10 +11,11 @@ prepare_transfer_conffile () { CONFFILE="$1" TEXT="$2" MODE="$3" + [ "$CONFFILES" ] || return 0 [ -e "$CONFFILE" ] || return 0 md5sum="$(md5sum "$CONFFILE" |sed -e 's/ .*//')" - old_md5sum="$(sed -n -e "/^Conffiles:/,/^[^ ]/{\\' $CONFFILE'{s/^ [^ ]* //;s/ .*//;p}}" /var/lib/dpkg/status)" + old_md5sum="$(echo "$CONFFILES" | awk '$1 == "'"$CONFFILE"'" { print $2 }')" if [ "$md5sum" = "$old_md5sum" ]; then echo >&2 "Transferring ownership of conffile $CONFFILE ..." # We have to write out the desired new text of the conffile, @@ -36,6 +37,7 @@ prepare_transfer_conffile () { case $action in install|upgrade) if dpkg --compare-versions "$version" lt 0; then + CONFFILES="$(dpkg-query -W -f '${Conffiles}\n' ssh | sed 's/^ *//')" prepare_transfer_conffile /etc/ssh/moduli "$ETC_SSH_MODULI" 0644 prepare_transfer_conffile /etc/ssh/ssh_config "$ETC_SSH_SSH_CONFIG" 0644 fi -- cgit v1.2.3