Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37513060
en ru br
ALT Linux repos
5.0: 4.64L-alt5.1
4.1: 4.64L-alt5
4.0: 4.64L-alt4.1
3.0: 4.58L-alt4
+backports:4.64L-alt0.M30.4

Group :: Networking/Mail
RPM: pine

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/usr/local/bin/perl
#
# elm-to-pine: Convert elm aliases file to pine address book
# Author: Klaus Wacker (wacker@Physik.Uni-Dortmund.DE)
#
# Usage e.g.
# elm-to-pine ~/.elm/aliases.text >~/.addressbook
#
# Option:
# -s Create a single address for multiple nicknames by making
# additional nicknames point back to the first one.
#
require 'getopt.pl';

# get a line, combining continuation lines
# that start with whitespace
# (taken from the perl man page and modified)
sub get_line {
return 0 if $eof;
$thisline = $lookahead;
$eof=1;
line: while ($lookahead = <>) {
if ($lookahead =~ /^[ \t]/) {
$thisline .= $lookahead;
}
else {
$eof=0;
last line;
}
}
$thisline;
}

do Getopt('');

$eof=!($lookahead = <>); # get first line
while ($_ = do get_line()) {
next if /^\#/; # Skip comments
chop;
s/\t/ /g; # Lets not get confused by tabs in the file
($nicks,$name,$address)=split(/ *= */,$_,3);
@nick=split(/ *, */,$nicks);
($fullname,$remark)=split(/ *, */,$name,2);
$fullname =~ s/;/,/; # Lastname[;,] Firstname
if ($address =~ /,/ ) { # Its a list
$address="(".$address.")";
}
foreach $nicki (@nick) { # Pine doesn't allow multiple nicknames
printf "%s\t%s\t%s\t\t%s\n",
$nicki, $fullname, $address, $remark;
$address = $nick[0] if $opt_s; # Let additional nicks point to the first one
}
}
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin