svn path=/trunk/kdepim/; revision=327359wilder-work
parent
fb0c8d5496
commit
89e031cda5
4 changed files with 27 additions and 31 deletions
@ -0,0 +1,25 @@ |
||||
#!/usr/bin/perl -w |
||||
|
||||
use strict; |
||||
|
||||
# This script updates some configuration keys and adds a 'mailto:' to all |
||||
# mailing list posting addresses |
||||
|
||||
# read the whole config file |
||||
my $currentGroup = ""; |
||||
my %configFile; |
||||
while ( <> ) { |
||||
chomp; # eat the trailing '\n' |
||||
next if ( /^$/ ); # skip empty lines |
||||
next if ( /^\#/ ); # skip comments |
||||
if ( /^\[/ ) { # group begin |
||||
$currentGroup = $_; |
||||
next; |
||||
} elsif ( $currentGroup eq "" and /^pgpType/ ) { |
||||
my ($key,$value) = split /=/; |
||||
if ( $value != 0 ) { |
||||
my @newvalues = ("","Kpgp/gpg1","Kpgp/pgp v2","Kpgp/pgp v5","Kpgp/pgp v6",""); |
||||
print "OpenPGP=$newvalues[$value]\n"; |
||||
} |
||||
} |
||||
} |
||||
@ -1,29 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
function delete_this_key() { |
||||
echo "# DELETE [$GROUP]$KEY" |
||||
} |
||||
|
||||
while read; do |
||||
# Currently unused |
||||
if [ "${REPLY#\[}" != "$REPLY" ] ; then # group name |
||||
GROUP="${REPLY:1:${#REPLY}-2}" |
||||
continue; |
||||
fi |
||||
# normal key=value pair: |
||||
KEY="${REPLY%%=*}" |
||||
VALUE="${REPLY#*=}" |
||||
|
||||
case "$GROUP/$KEY" in |
||||
/pgpType) |
||||
# 0 is auto -> delete key, i.e. use the default |
||||
# 1-4 map to the kpgp ones |
||||
# 5 is off -> off; since there's no such backend it won't set one |
||||
if [ "$VALUE" -ne 0 ]; then |
||||
location=("" "Kpgp/gpg1" "Kpgp/pgp v2" "Kpgp/pgp v5" "Kpgp/pgp v6" "") |
||||
echo "OpenPGP=${location[$VALUE]}" |
||||
fi |
||||
continue; |
||||
;; |
||||
esac |
||||
done |
||||
Loading…
Reference in new issue