From 764a6898e457c003d7d2ed1adf95737f3abd3b7e Mon Sep 17 00:00:00 2001 From: hayao Date: Sat, 12 Dec 2020 17:44:19 +0900 Subject: [PATCH] [add] : Added update script --- .gitignore | 1 + update_aur.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100755 update_aur.sh diff --git a/.gitignore b/.gitignore index 9fcf0a9..52627ae 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ pkg/ src/ +/temp diff --git a/update_aur.sh b/update_aur.sh new file mode 100755 index 0000000..b8410aa --- /dev/null +++ b/update_aur.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && pwd )" + +set -eu + +for DIR in $(find "${script_path}" -type f -name "PKGBUILD" | xargs realpath | xargs dirname); do + PACKAGE="$(basename "${DIR}")" + git clone "https://aur.archlinux.org/${PACKAGE}.git" "${script_path}/temp/${PACKAGE}" + if [[ -n "$(ls "${script_path}/temp/${PACKAGE}")" ]]; then + rm -rf "${DIR}" + mv "${script_path}/temp/${PACKAGE}" "${DIR}" + rm -rf "${DIR}/.git" + fi +done -- 2.11.0