Converted from bash to perl, which makes it run in 0.01s instead of 0.01s :)

svn path=/trunk/kdepim/; revision=327359
wilder-work
David Faure 22 years ago
parent fb0c8d5496
commit 89e031cda5
  1. 2
      Makefile.am
  2. 25
      kmail-3.3-aegypten.pl
  3. 29
      kmail-3.3-aegypten.sh
  4. 2
      kmail.upd

@ -143,7 +143,7 @@ update_SCRIPTS = upgrade-transport.pl kmail-pgpidentity.pl \
kmail-3.2-misc.sh \
kmail-3.3-use-ID-for-accounts.pl \
kmail-3.3-move-identities.pl \
kmail-3.3-aegypten.sh \
kmail-3.3-aegypten.pl \
kmail-3.3-split-sign-encr-keys.sh \
kmail-3.3-misc.pl \
kmail-3.3b1-misc.pl

@ -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

@ -114,7 +114,7 @@ Key=showKeysForApproval,crypto-show-keys-for-approval
Id=3.3-aegypten-kpgprc-to-libkleopatrarc
File=kpgprc,libkleopatrarc
Group=,Backends
Script=kmail-3.3-aegypten.sh
Script=kmail-3.3-aegypten.pl,perl
Id=3.3-aegypten-emailidentities-split-sign-encr-keys
File=emailidentities

Loading…
Cancel
Save