3 # following to be duplicated within postrm as well, but may be with
5 popcon_conf=/etc/popularity-contest.conf
6 nd_popcon_conf=/etc/popularity-contest.d/neurodebian.conf
7 remove_neurodebian_popcon_pre161() {
8 # Adjust popularity-contest.conf
9 if [ -e "$popcon_conf" ] \
10 && grep -q "http://neuro.debian.net/cgi-bin/popcon-submit.cgi" $popcon_conf; then
11 #echo "Removing NeuroDebian url for Popularity Contest submissions."
12 # First remove any explicit mentioning and then empty additions
13 sed -i -e 's,http://neuro.debian.net/cgi-bin/popcon-submit.cgi,,g' \
14 -e '/SUBMITURLS+=" *"/d' \
15 -e '/SUBMITURLS="$SUBMITURLS *"/d' \
20 add_neurodebian_popcon_pre161() {
21 # Adjust main popularity-contest configuration file. Should be
22 # used only with older versions of the popularity contest.
23 if [ -e "$popcon_conf" ]; then
24 # Fix dashism missing += operator
25 if grep -q 'SUBMITURLS+="' "$popcon_conf"; then
26 echo "Adjusting addition of new entries in $popcon_conf for dash."
27 sed -i -e 's,SUBMITURLS+=",SUBMITURLS="$SUBMITURLS,g' "$popcon_conf"
29 if ! grep -q 'SUBMITURLS.*neuro.debian.net' "$popcon_conf"; then
30 echo "Adding NeuroDebian url for Popularity Contest submissions."
31 echo -e 'SUBMITURLS="$SUBMITURLS http://neuro.debian.net/cgi-bin/popcon-submit.cgi"' >> "$popcon_conf"
36 add_neurodebian_popcon_161() {
37 # 1.60 introduced encryption and a way to provide multiple keys to
38 # encrypt submissions to multiple servers.
40 # "Installation" is taken care of through installing files under
41 # /etc/popularity-contest.d, so no additional actions necessary here
45 popcon_version=$(dpkg -l popularity-contest | tail -n 1 | awk '{print $3;}')
47 if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
48 if dpkg --compare-versions $popcon_version lt 1.61; then
49 add_neurodebian_popcon_pre161
51 # Assure that we have no "old" settings for submission
52 remove_neurodebian_popcon_pre161 || :