]> git.donarmstrong.com Git - neurodebian.git/blob - debian/neurodebian-popularity-contest.postinst
3bb1437090d96622a741aa615d0fc40ca9a0f283
[neurodebian.git] / debian / neurodebian-popularity-contest.postinst
1 #!/bin/bash -e
2
3 popcon_conf=/etc/popularity-contest.conf
4 if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
5         # Adjust popularity-contest.conf
6         if [ -e "$popcon_conf" ]; then
7                 # Fix dashism missing += operator
8                 if grep -q 'SUBMITURLS+="' "$popcon_conf"; then
9                         echo "Adjusting addition of new entries in $popcon_conf for dash."
10                         sed -i -e 's,SUBMITURLS+=",SUBMITURLS="$SUBMITURLS,g' "$popcon_conf"
11                 fi
12                 if ! grep -q 'SUBMITURLS.*neuro.debian.net' "$popcon_conf"; then
13                         echo "Adding NeuroDebian url for Popularity Contest submissions."
14                         echo -e 'SUBMITURLS="$SUBMITURLS http://neuro.debian.net/cgi-bin/popcon-submit.cgi"' >> "$popcon_conf"
15                 fi
16         fi
17 fi
18
19 #DEBHELPER#