-
Notifications
You must be signed in to change notification settings - Fork 6
/
sign
executable file
·52 lines (40 loc) · 1.47 KB
/
sign
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/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: