aboutsummaryrefslogtreecommitdiff
path: root/pkgbuild.sh
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2021-11-03 19:48:05 +0800
committerKunoiSayami <[email protected]>2021-11-03 19:48:05 +0800
commit7833bbf7de0958551831b584464f67e4af3f6a1b (patch)
treeb12cc7c70dea8f9fde586e6c1aac491e5192ca84 /pkgbuild.sh
parent625e47a247523314c8f63de4135df17c86f4e513 (diff)
feat(script): Optimize GPG key import
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'pkgbuild.sh')
-rwxr-xr-xpkgbuild.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgbuild.sh b/pkgbuild.sh
index 39718bb..9e1e3ae 100755
--- a/pkgbuild.sh
+++ b/pkgbuild.sh
@@ -63,6 +63,11 @@ if [ $# -gt 0 ] && [ "$1" = "--diff" ]; then
exit 0
fi
+if [ "$EUID" -eq 0 ] ; then
+ echo "\033[0;32mPlease run this script as non-root\033[0m"
+ exit 3
+fi
+
if [ $# -gt 0 ] && [ "$1" = "--all" ] || [ -n "$CI_COMMIT_TITLE" ] && [[ $CI_COMMIT_TITLE =~ fix\(repo\)|REBUILD ]]; then
if [ -z "${FORCE_ALL+x}" ] || [ -n "$CI_COMMIT_TITLE" ] && [[ $CI_COMMIT_TITLE =~ REBUILD(\ |_)ALL ]]; then
SKIP_VERIFIED=0
@@ -86,7 +91,8 @@ while read FOLDER_NAME ; do
continue
fi
- if [ $SKIP_VERIFIED -eq 1 ] && grep -Fxq "$FOLDER_NAME" "../.verified_repos"; then
+ if [ -n "$CI_COMMIT_TITLE" ] && [[ $CI_COMMIT_TITLE =~ fix\(repo\)|REBUILD ]] && \
+ [ $SKIP_VERIFIED -eq 1 ] && grep -Fxq "$FOLDER_NAME" "../.verified_repos"; then
popd
continue
fi
@@ -106,6 +112,8 @@ while read FOLDER_NAME ; do
if [ -r ../.gpg_keys/"$FOLDER_NAME" ]; then
. ../.gpg_keys/"$FOLDER_NAME"
+ gpg --list-keys --fingerprint |grep pub -A 1|grep -Ev "pub|--"|tr -d ' ' \
+ | awk 'BEGIN { FS = "\n" } ; { print $1":6:" } ' | gpg --import-ownertrust
fi
hook "$FOLDER_NAME"