From dd48508f60d0470c0aef77e0575db1da3ed69ce1 Mon Sep 17 00:00:00 2001 From: hayao Date: Sun, 11 Apr 2021 22:41:11 +0900 Subject: [PATCH] [update] : Supported Specifing gpg key --- scripts/main.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/main.sh b/scripts/main.sh index 0557847..3781174 100755 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -27,6 +27,7 @@ nocolor=false force=false force_repo=false command="" +gpgkey="" skip_pkg=() set -e @@ -43,6 +44,7 @@ _usage() { echo " -g | --giturl Specify the URL of the repository where the PKGBUILD list is stored" echo " -f | --force Force builds of already built packages" echo " --force-repo Overwrite the existing repository." + echo " -k | --gpgkey Specify the gpg key" echo " -w | --workdir Specify the work dir" echo " -h | --help Show this help message" echo @@ -272,7 +274,7 @@ sign_pkg() { remove "${_pkg_dir}/"*".sig" for pkg in $(ls "${_pkg_dir}/"*".pkg.tar."* | grep -v ".sig" | grep -v ".sh"); do _msg_info "Signing ${pkg}..." - gpg --detach-sign ${pkg} + gpg -u "${gpgkey}" --detach-sign ${pkg} done } @@ -363,8 +365,8 @@ if [[ -z "${@}" ]]; then fi options="${@}" -_opt_short="h,a:,g:,r:,w:,f,s:" -_opt_long="help,arch:,giturl:,repodir:,workdir:,force,force-repo,nocolor,skip:" +_opt_short="h,a:,g:,r:,w:,f,s:k:" +_opt_long="help,arch:,giturl:,repodir:,workdir:,force,force-repo,nocolor,skip:,gpgkey:" OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}") if [[ ${?} != 0 ]]; then exit 1 @@ -401,6 +403,10 @@ while :; do force=true shift 1 ;; + -k | --gpgkey) + gpgkey="${2}" + shift 2 + ;; --force-repo) force_repo=true shift 1 -- 2.11.0