X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=debian%2Fneurodebian-popularity-contest.postinst;fp=debian%2Fneurodebian-popularity-contest.postinst;h=fb003d5226173167bc58a3de22a2789ceeeb9739;hb=6c6fa9cd3bd627a60f165682f96af3cc06d9ccc9;hp=3bb1437090d96622a741aa615d0fc40ca9a0f283;hpb=15d0a7f8a363c9fe2b286ddcb99acc41c9c91681;p=neurodebian.git diff --git a/debian/neurodebian-popularity-contest.postinst b/debian/neurodebian-popularity-contest.postinst index 3bb1437..fb003d5 100755 --- a/debian/neurodebian-popularity-contest.postinst +++ b/debian/neurodebian-popularity-contest.postinst @@ -1,8 +1,25 @@ #!/bin/bash -e +# following to be duplicated within postrm as well, but may be with +# "Removing" message popcon_conf=/etc/popularity-contest.conf -if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then +nd_popcon_conf=/etc/popularity-contest.d/neurodebian.conf +remove_neurodebian_popcon_pre161() { # Adjust popularity-contest.conf + if [ -e "$popcon_conf" ] \ + && grep -q "http://neuro.debian.net/cgi-bin/popcon-submit.cgi" $popcon_conf; then + #echo "Removing NeuroDebian url for Popularity Contest submissions." + # First remove any explicit mentioning and then empty additions + sed -i -e 's,http://neuro.debian.net/cgi-bin/popcon-submit.cgi,,g' \ + -e '/SUBMITURLS+=" *"/d' \ + -e '/SUBMITURLS="$SUBMITURLS *"/d' \ + "$popcon_conf" + fi +} + +add_neurodebian_popcon_pre161() { + # Adjust main popularity-contest configuration file. Should be + # used only with older versions of the popularity contest. if [ -e "$popcon_conf" ]; then # Fix dashism missing += operator if grep -q 'SUBMITURLS+="' "$popcon_conf"; then @@ -14,6 +31,26 @@ if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then echo -e 'SUBMITURLS="$SUBMITURLS http://neuro.debian.net/cgi-bin/popcon-submit.cgi"' >> "$popcon_conf" fi fi +} + +add_neurodebian_popcon_161() { + # 1.60 introduced encryption and a way to provide multiple keys to + # encrypt submissions to multiple servers. + + # "Installation" is taken care of through installing files under + # /etc/popularity-contest.d, so no additional actions necessary here + : +} + +popcon_version=$(dpkg -l popularity-contest | tail -n 1 | awk '{print $3;}') + +if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then + if dpkg --compare-versions $popcon_version lt 1.61; then + add_neurodebian_popcon_pre161 + else + # Assure that we have no "old" settings for submission + remove_neurodebian_popcon_pre161 || : + fi fi #DEBHELPER#