aboutsummaryrefslogtreecommitdiff
path: root/share/pgpkeys/keyring.pl
diff options
context:
space:
mode:
Diffstat (limited to 'share/pgpkeys/keyring.pl')
-rw-r--r--share/pgpkeys/keyring.pl82
1 files changed, 0 insertions, 82 deletions
diff --git a/share/pgpkeys/keyring.pl b/share/pgpkeys/keyring.pl
deleted file mode 100644
index 870e0cc109..0000000000
--- a/share/pgpkeys/keyring.pl
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/perl -w
-#
-# $FreeBSD$
-#
-
-use strict;
-use Fcntl;
-use Getopt::Std;
-use vars qw(%KEYS);
-
-sub add_file($);
-sub add_dir($);
-
-sub add_dir($) {
- my $dn = shift;
-
- local *DIR;
- my $ent;
-
- $dn =~ s|/+|/|g;
- $dn =~ s|^(.+)/$|$1|;
- opendir(DIR, $dn)
- or die("$dn: opendir(): $!\n");
- while ($ent = readdir(DIR)) {
- next if ($ent eq "." || $ent eq "..");
- add_file("$dn/$ent");
- }
- closedir(DIR);
-}
-
-sub add_file($) {
- my $fn = shift;
-
- local *FILE;
- my $line;
- my $key;
-
- if (-d $fn) {
- return add_dir($fn);
- }
-
- sysopen(FILE, $fn, O_RDONLY)
- or die("$fn: open(): $!\n");
- while (<FILE>) {
- if (m'-----BEGIN PGP PUBLIC KEY BLOCK-----$') {
- $key = $_;
- } elsif (m'^-----END PGP PUBLIC KEY BLOCK-----') {
- $key .= $_;
- chomp($key);
- $KEYS{$key}++
- if defined($key);
- $key = undef;
- } elsif (defined($key)) {
- $key .= $_;
- }
- }
-}
-
-sub usage() {
-
- print(STDERR "Usage: keyring [-o outfile] [dir|file] ...\n");
-}
-
-MAIN:{
- my %opts;
-
- getopts('o:', \%opts)
- or usage();
-
- if ($opts{'o'}) {
- sysopen(STDOUT, $opts{'o'}, O_RDWR|O_CREAT|O_TRUNC)
- or die("$opts{'o'}: open(): $!\n");
- }
- if (!@ARGV) {
- add_dir(".");
- } else {
- while (@ARGV) {
- add_file(shift(@ARGV));
- }
- }
- print(join("\n", sort(keys(%KEYS))));
-}