#!/bin/bash # Copyright © Sébastien Luttringer # # 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. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. [[ -r /etc/makepkg.conf ]] && source /etc/makepkg.conf [[ -r ~/.makepkg.conf ]] && source ~/.makepkg.conf shopt -s nullglob shopt -s xpg_echo pkgs=(*$PKGEXT) (( ${#pkgs[@]} == 0 )) && 'No package to sign' && exit 1 echo '\e[1;32m==>\e[;1m You will sign the following packages:\e[m' for p in "${pkgs[@]}"; do echo "$p" done #echo -n '\e[1;32m==>\e[;1m Type your password: \e[m' #read -sr password #echo #(( ${#password} == 0 )) && echo 'Empty password!' && exit 1 echo -n '\e[1;32m==>\e[;1m Type enter to continue\e[m' read set -e for p in "${pkgs[@]}"; do [[ -e "$p.sig" ]] && 'rm' "$p.sig" #echo -n "$password" | gpg --detach-sign --passphrase-fd 0 "$p" echo signing "$p" gpg --detach-sign "$p" done # vim:set ts=2 sw=2 ft=sh noet: