]> git.donarmstrong.com Git - neurodebian.git/blobdiff - debian/neurodebian-popularity-contest.postinst
Fixing bashism in popcon post-scripts -- no "+=" operator
[neurodebian.git] / debian / neurodebian-popularity-contest.postinst
index 4ab508134124b2e5bdea35f2f532dd3678e97ec8..3bb1437090d96622a741aa615d0fc40ca9a0f283 100755 (executable)
@@ -3,9 +3,16 @@
 popcon_conf=/etc/popularity-contest.conf
 if [ "$1" = "configure" -o "$1" = "abort-upgrade" ]; then
        # Adjust popularity-contest.conf
-       if [ -e "$popcon_conf" ] && ! grep -q 'SUBMITURLS.*neuro.debian.net' "$popcon_conf"; then
-               echo "Adding NeuroDebian url for Popularity Contest submissions."
-               echo -e 'SUBMITURLS+=" http://neuro.debian.net/cgi-bin/popcon-submit.cgi"' >> "$popcon_conf"
+       if [ -e "$popcon_conf" ]; then
+               # Fix dashism missing += operator
+               if grep -q 'SUBMITURLS+="' "$popcon_conf"; then
+                       echo "Adjusting addition of new entries in $popcon_conf for dash."
+                       sed -i -e 's,SUBMITURLS+=",SUBMITURLS="$SUBMITURLS,g' "$popcon_conf"
+               fi
+               if ! grep -q 'SUBMITURLS.*neuro.debian.net' "$popcon_conf"; then
+                       echo "Adding NeuroDebian url for Popularity Contest submissions."
+                       echo -e 'SUBMITURLS="$SUBMITURLS http://neuro.debian.net/cgi-bin/popcon-submit.cgi"' >> "$popcon_conf"
+               fi
        fi
 fi