Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37787512
en ru br
ALT Linux repositórios
S:0.8.61-alt1
5.0: 0.7-alt1
4.1: 0.5.1-alt1.M41.1
4.0: 0.4.10-alt1
3.0: 0.3.8-alt4
+updates:0.3.8-alt5

Group :: Sistema/Configurações/Pacotes
RPM: alt-gpgkeys

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

#!/bin/sh -efu

. shell-error

keyfile="$1"; shift
uid_pattern='.*[[:space:]]+<[^@]+(@| at )altlinux(\.| dot )(com|net|org|ru)>$'

tempdir=
cleanup_handler()
{
trap - EXIT
[ -z "$tempdir" ] || rm -rf "$tempdir"
exit "$@"
}

exit_handler()
{
cleanup_handler $?
}

signal_handler()
{
cleanup_handler 143
}

print_uidlist()
{
gpg --list-keys --with-colons| egrep '^(pub|uid):'|cut -f10 -d:
}

trap exit_handler EXIT
trap signal_handler HUP PIPE INT QUIT TERM
tempdir="$(mktemp -td alt-gpgkeys.XXXXXX)"

export LANG=C
export GNUPGHOME="$tempdir"

gpg --import "$keyfile" 2>/dev/null ||
fatal "$keyfile: Invalid gpg key file"

n="$(gpg --list-keys --with-colons 2>/dev/null |grep -c '^pub:')" ||
fatal "$keyfile: No public keys found"
[ "$n" = 1 ] ||
fatal "$keyfile: Too many ($n) keys found"

echo "Available UID:"
print_uidlist

print_uidlist|egrep -qs "$uid_pattern" ||
fatal "$keyfile: No valid altlinux uid was found"

print_uidlist|egrep -vqs "$uid_pattern" &&
fatal "$keyfile: Non altlinux uid detected"

gpg --list-keys --with-colons|grep '^sub:'|cut -f12 -d:|grep -vqs 's' &&
fatal "$keyfile: Subkey detected"

exit 0
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009