summaryrefslogtreecommitdiff
path: root/debian/openssh-client.preinst
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2007-06-04 22:12:52 +0000
committerColin Watson <cjwatson@debian.org>2007-06-04 22:12:52 +0000
commit9caa28600a47cc37031251eb77841861ca0c0eaa (patch)
treebb2e53022aec14b9476b744b056d62138d12cb24 /debian/openssh-client.preinst
parentfd986eabedb1a25e3a90c9055d55801f681b3739 (diff)
* Use dpkg-query to fetch conffile md5sums rather than parsing
/var/lib/dpkg/status directly.
Diffstat (limited to 'debian/openssh-client.preinst')
-rw-r--r--debian/openssh-client.preinst4
1 files changed, 3 insertions, 1 deletions
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 () {
11 CONFFILE="$1" 11 CONFFILE="$1"
12 TEXT="$2" 12 TEXT="$2"
13 MODE="$3" 13 MODE="$3"
14 [ "$CONFFILES" ] || return 0
14 [ -e "$CONFFILE" ] || return 0 15 [ -e "$CONFFILE" ] || return 0
15 16
16 md5sum="$(md5sum "$CONFFILE" |sed -e 's/ .*//')" 17 md5sum="$(md5sum "$CONFFILE" |sed -e 's/ .*//')"
17 old_md5sum="$(sed -n -e "/^Conffiles:/,/^[^ ]/{\\' $CONFFILE'{s/^ [^ ]* //;s/ .*//;p}}" /var/lib/dpkg/status)" 18 old_md5sum="$(echo "$CONFFILES" | awk '$1 == "'"$CONFFILE"'" { print $2 }')"
18 if [ "$md5sum" = "$old_md5sum" ]; then 19 if [ "$md5sum" = "$old_md5sum" ]; then
19 echo >&2 "Transferring ownership of conffile $CONFFILE ..." 20 echo >&2 "Transferring ownership of conffile $CONFFILE ..."
20 # We have to write out the desired new text of the conffile, 21 # We have to write out the desired new text of the conffile,
@@ -36,6 +37,7 @@ prepare_transfer_conffile () {
36case $action in 37case $action in
37 install|upgrade) 38 install|upgrade)
38 if dpkg --compare-versions "$version" lt 0; then 39 if dpkg --compare-versions "$version" lt 0; then
40 CONFFILES="$(dpkg-query -W -f '${Conffiles}\n' ssh | sed 's/^ *//')"
39 prepare_transfer_conffile /etc/ssh/moduli "$ETC_SSH_MODULI" 0644 41 prepare_transfer_conffile /etc/ssh/moduli "$ETC_SSH_MODULI" 0644
40 prepare_transfer_conffile /etc/ssh/ssh_config "$ETC_SSH_SSH_CONFIG" 0644 42 prepare_transfer_conffile /etc/ssh/ssh_config "$ETC_SSH_SSH_CONFIG" 0644
41 fi 43 fi