From f0f927adb0bb0b73b55a7da2f8f70018c97a56fd Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 6 Aug 2014 16:30:40 -0400 Subject: [PATCH] Support popularity-contest >= 1.61 encrypting submissions - provide GPG public key for encryption of submissions --- debian/changelog | 7 ++++ debian/neurodebian-popularity-contest.dirs | 2 + debian/neurodebian-popularity-contest.install | 2 + .../neurodebian-popularity-contest.postinst | 39 +++++++++++++++++- debian/neurodebian-popularity-contest.postrm | 12 ++++-- popcon/neurodebian-popcon.gpg | Bin 0 -> 2263 bytes popcon/neurodebian.conf | 3 ++ 7 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 debian/neurodebian-popularity-contest.dirs create mode 100644 debian/neurodebian-popularity-contest.install create mode 100644 popcon/neurodebian-popcon.gpg create mode 100644 popcon/neurodebian.conf diff --git a/debian/changelog b/debian/changelog index 2f339f6..7d7dd34 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +neurodebian (0.33~a1) UNRELEASED; urgency=medium + + * Support popularity-contest >= 1.61 encrypting submissions: + - provide GPG public key for encryption of submissions + + -- Yaroslav Halchenko Wed, 06 Aug 2014 16:21:04 -0400 + neurodebian (0.32) neurodebian; urgency=low [ Michael Hanke ] diff --git a/debian/neurodebian-popularity-contest.dirs b/debian/neurodebian-popularity-contest.dirs new file mode 100644 index 0000000..ff41a38 --- /dev/null +++ b/debian/neurodebian-popularity-contest.dirs @@ -0,0 +1,2 @@ +usr/share/popularity-contest +etc/popularity-contest.d diff --git a/debian/neurodebian-popularity-contest.install b/debian/neurodebian-popularity-contest.install new file mode 100644 index 0000000..88ddd33 --- /dev/null +++ b/debian/neurodebian-popularity-contest.install @@ -0,0 +1,2 @@ +popcon/neurodebian.conf /etc/popularity-contest.d +popcon/neurodebian-popcon.gpg /usr/share/popularity-contest 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# diff --git a/debian/neurodebian-popularity-contest.postrm b/debian/neurodebian-popularity-contest.postrm index 6615555..92bb35d 100755 --- a/debian/neurodebian-popularity-contest.postrm +++ b/debian/neurodebian-popularity-contest.postrm @@ -2,11 +2,12 @@ #DEBHELPER# -# If requested to be purged -- remove our entry popcon_conf=/etc/popularity-contest.conf -if [ "$1" = "purge" ]; then +nd_popcon_conf=/etc/popularity-contest.d/neurodebian.conf +remove_neurodebian_popcon_pre161() { # Adjust popularity-contest.conf - if [ -e "$popcon_conf" ]; then + 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' \ @@ -14,4 +15,9 @@ if [ "$1" = "purge" ]; then -e '/SUBMITURLS="$SUBMITURLS *"/d' \ "$popcon_conf" fi +} + +# If requested to be purged -- remove our entry +if [ "$1" = "purge" ]; then + remove_neurodebian_popcon_pre161 fi diff --git a/popcon/neurodebian-popcon.gpg b/popcon/neurodebian-popcon.gpg new file mode 100644 index 0000000000000000000000000000000000000000..d5e8c9bbf926d39dcc13902efea0896441202709 GIT binary patch literal 2263 zcmV;|2q^cN0u2OHclv}em*a@o;h}0~Yn4DxPF8sNJjA2H|!Nb)A>e0`EROW8A z0Pf2~$fyX~%zCtV4z90T#TGzs>3VzWK{ThP5Zc@x&V7H_V7IZ7jL8`32X;OE>+@~= z$GV=4%CG4&crSvGh>e3{v(%D?9xoM3=Q;;%ko{~ek?&nKK9;9S;Q^=~cL5pIo2slo z%l0;8l0Gyy3lUraBZ?G_tH_j^c>Y|YQqEou$C;fSbm>xXXwot8(0q5`>Z*_ZrRaqB z+!cATWWE*;mP)%`*h?Q@klJVr7dp=3*7_OUeW(P?LP{#{#|9do|D;W^{uV&onTuF!ep}4Bh@iQ!ZJOz5EU1z~Vs`JG1pC-a# zE~{PxEX$KOBdL3mn7$Hq$~wVJcsIk}At@7+vSGNB0ky4JgmJ+uSYr284Z|hJE@Y7H zU4x6cE*!lD^!Fn~$g#;1rLDMW9`6L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2%U6hhOmyJYurvFs+>c z5di=Ji2@%47y$wR2?YXEclyn2@q69Wy_05-W@us5Bmj#e3y?C4j>WKGF0Y$ z`6#1vs99*G!9Th(T$52+_+Ief?bpc%kcmA%MaDRa{3qt`c>;rrTL`^ds!<|KWzS^T z)YxC$GrFzHwa8r|d-dGn<#tQ*TXue=gNrzpM>1nVEKb#$ zaTJvegy`l$Cc5?axP+aV|1q2oVItlgD66g+VKWRw@|1M^s7=slS)j{FhfML9d%?)2 zf86H}Tp!$JT4O!)nK3J^LoaaO!Tols%xfVve6#=sdVTpa-WkS|7D2#M6C#L(1X$gx zU_%wGv64ftEyw6-firI$sVTW};bu60#IUC@iK}~kUapJ2j*4%M@ziIcTyZUb0c%uc z-WKd*Xpw9lD!IvX9g!?@G*~?)>t`srqb$Fl6b*C$c}j*qdiwSJ9e>T`0Fji8GZo}S zV8Xq$BxP|JwxXD-mFm7hb128@b=%3po0FnxW2XjzcefWszvI7T)#wX5PJg&+ z9Ppkg+gniJOzyY>yVYCFC?(r4a(8LdYhahzZq$Deg@%3=SGK|H=fvRPMKJ&;0X8iR lV&i;tkS@{Z*2T_OVRr`?@yQ@`^9Qu2WJNUO5nHeV00V53Mx_7% literal 0 HcmV?d00001 diff --git a/popcon/neurodebian.conf b/popcon/neurodebian.conf new file mode 100644 index 0000000..5d0ecee --- /dev/null +++ b/popcon/neurodebian.conf @@ -0,0 +1,3 @@ +KEYRING="$KEYRING --keyring /usr/share/popularity-contest/neurodebian-popcon.gpg" +POPCONKEY="$POPCONKEY -r 0x544665CB8B48DE1D" +SUBMITURLS="$SUBMITURLS http://neuro.debian.net/cgi-bin/popcon-submit.cgi" -- 2.39.2