#!/bin/bash # Copyright (C) 2005 Raphael Ouazana # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # GPL Licence : http://www.gnu.org/licenses/gpl.txt # # More contributions on http://www.linagora.org VERSION=1.0 usage() { echo $0 v$VERSION indique les signatures des paquets installes. echo $'\t' -h : Affiche ces informations echo $'\t' -v : Affiche aussi les paquets correctement signes } [ "$1" != "" -a "$1" != "-v" ] && usage && exit 1 TMPPACK=`mktemp /tmp/packages.XXXXXXXX` || exit 1 packetage() { grep -B1 $1'\$' $TMPPACK | grep -v '\$$' | grep -v '^--$' | sed 's/^/\t\t/' } echo Recherche en cours... rpm -qai | egrep '^(Name *: |Signature *: )' | sed -e 's/^Name *: \([^ ]*\) .*/\1/' -e 's/^Signature .*ID \(.*\)$/\1$/' -e 's/^Signature.*none.*$/$/' > $TMPPACK SIGS=`grep '\$$' $TMPPACK | sort | uniq -c | sed 's/\t\t*/|/'` FIRST=`echo $SIGS | sed -e 's/\$ /\n/g' -e 's/\$/\n/g' | head -1` echo $FIRST | grep '|$' &>/dev/null if [ $? -eq 0 ] then FIRST=`echo $FIRST | sed 's/|//'` echo $FIRST $'\t' paquets sans signature packetage ^ else echo "Pas de paquet sans signature" unset FIRST fi for SIG in $SIGS do if [ "$FIRST" != "" ] then unset FIRST continue fi ID=`echo $SIG | sed 's/^.*\([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\)\$$/\1/'` SUM=`rpm -qi gpg-pubkey-$ID | grep ^Summary | sed 's/^[^(]*(\(.*\))[^)]*$/\1/'` echo -n $SIG | sed -e 's/|/\t/' -e 's/\$//' echo $'\t' $SUM [ "$SUM" = "" -o "$1" = "-v" ] && packetage $ID done rm -f $TMPPACK