From fbcb4352c57d0ee9e4cccabbf62a1c215590be63 Mon Sep 17 00:00:00 2001 From: Kunoi Sayami Date: Tue, 2 Nov 2021 00:31:27 +0800 Subject: feat(add-pkg): Add glib2-static and qemu-user-static (#12) * feat(script): Support detect repository external file change Signed-off-by: KunoiSayami --- .gitmodules | 6 ++++++ pkgbuild.sh | 19 +++++++++++++++---- repo/.gpg_keys/qemu-user-static | 2 ++ repo/.hook/glib2-static | 4 ++++ repo/.yaydeps/qemu-user-static | 2 ++ repo/glib2-static | 1 + repo/qemu-user-static | 1 + 7 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 repo/.gpg_keys/qemu-user-static create mode 100644 repo/.hook/glib2-static create mode 100644 repo/.yaydeps/qemu-user-static create mode 160000 repo/glib2-static create mode 160000 repo/qemu-user-static diff --git a/.gitmodules b/.gitmodules index cb02732..49a9f66 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,9 @@ [submodule "repo/gconf"] path = repo/gconf url = https://aur.archlinux.org/gconf.git +[submodule "repo/glib2-static"] + path = repo/glib2-static + url = https://aur.archlinux.org/glib2-static.git +[submodule "repo/qemu-user-static"] + path = repo/qemu-user-static + url = https://aur.archlinux.org/qemu-user-static.git diff --git a/pkgbuild.sh b/pkgbuild.sh index 3779a57..cbb280b 100755 --- a/pkgbuild.sh +++ b/pkgbuild.sh @@ -22,13 +22,20 @@ cleanup() { unset ARCH } +function hook { + if [ -r ../.hook/"$1" ]; then + echo "Running $1 Hook script" + . ../.hook/"$1" + fi +} + ARCH=$(uname -m) PKGBUILD_DIRECTORY_BASE="repo" PKGDEST="${PWD}/packages/$ARCH" SRCDEST="${PWD}/build" CONFDEST="${PWD}/makepkg.d/makepkg.$ARCH.conf" REPO_DIFF="${PWD}/packages/$ARCH/DIFF" -SKIP_VERIFIED=0 +SKIP_VERIFIED=1 TMPCONF=$(mktemp -t makepkg.$ARCH.conf.XXXXXXXXXX) || exit 1 cat "${PWD}/makepkg.d/makepkg.base.conf" > "$TMPCONF" @@ -38,7 +45,9 @@ touch "$REPO_DIFF" function get_diff_list { git diff --name-only HEAD^ | while read line; do - if [[ $line =~ $PKGBUILD_DIRECTORY_BASE ]]; then + if [[ $line =~ $PKG/\..* ]] && [ $line != "$PKG/.verified_repos" ]; then + echo "$line" | cut -d'/' -f3 >> "$REPO_DIFF" + elif [[ $line =~ $PKGBUILD_DIRECTORY_BASE ]]; then echo "$line" | cut -d'/' -f2 >> "$REPO_DIFF" fi done @@ -53,8 +62,8 @@ if [ $# -gt 0 ] && [ "$1" = "--diff" ]; then fi if [ $# -gt 0 ] && [ "$1" = "--all" ] || [ -n "$CI_COMMIT_TITLE" ] && [[ $CI_COMMIT_TITLE =~ fix\(repo\)|REBUILD ]]; then - if [ -z "${SKIP_SOME+x}" ] || [ -n "$CI_COMMIT_MESSAGE" ] && [[ $CI_COMMIT_MESSAGE =~ \[SKIP\ SOME\] ]]; then - SKIP_VERIFIED=1 + if [ -z "${FORCE_ALL+x}" ] || [ -n "$CI_COMMIT_TITLE" ] && [[ $CI_COMMIT_TITLE =~ REBUILD(\ |_)ALL ]]; then + SKIP_VERIFIED=0 fi ls $PKGBUILD_DIRECTORY_BASE > "$REPO_DIFF" else @@ -83,6 +92,7 @@ while read FOLDER_NAME ; do while read YAYDEP ; do if [ -d "../$YAYDEP" ]; then pushd "../$YAYDEP" + hook "$YAYDEP" SRCPKGDEST=$SRCDEST SRCDEST=$SRCDEST PKGDEST=$PKGDEST MAKEPKG_CONF="$TMPCONF" makepkg --clean -si --asdeps --noconfirm --needed --noprogressbar popd else @@ -95,6 +105,7 @@ while read FOLDER_NAME ; do . ../.gpg_keys/"$FOLDER_NAME" fi + hook "$FOLDER_NAME" SRCPKGDEST=$SRCDEST SRCDEST=$SRCDEST PKGDEST=$PKGDEST MAKEPKG_CONF="$TMPCONF" makepkg --clean -s --asdeps --noconfirm --needed --noprogressbar || echo "Skip $FOLDER_NAME" popd done < "$REPO_DIFF" diff --git a/repo/.gpg_keys/qemu-user-static b/repo/.gpg_keys/qemu-user-static new file mode 100644 index 0000000..4041650 --- /dev/null +++ b/repo/.gpg_keys/qemu-user-static @@ -0,0 +1,2 @@ +#!/bin/bash +gpg --recv-keys --keyserver pgp.mit.edu 3353C9CEF108B584 \ No newline at end of file diff --git a/repo/.hook/glib2-static b/repo/.hook/glib2-static new file mode 100644 index 0000000..7c9629f --- /dev/null +++ b/repo/.hook/glib2-static @@ -0,0 +1,4 @@ +#!/bin/bash +[ ! -r /var/lib/dbus/machine-id ] && dbus-uuidgen | sudo tee /var/lib/dbus/machine-id +sed -i 's/e \\/e/g' PKGBUILD +sed -i 's/-Dinternal_pcre=false//g' PKGBUILD \ No newline at end of file diff --git a/repo/.yaydeps/qemu-user-static b/repo/.yaydeps/qemu-user-static new file mode 100644 index 0000000..9a4f968 --- /dev/null +++ b/repo/.yaydeps/qemu-user-static @@ -0,0 +1,2 @@ +glib2-static +pcre-static \ No newline at end of file diff --git a/repo/glib2-static b/repo/glib2-static new file mode 160000 index 0000000..309ab53 --- /dev/null +++ b/repo/glib2-static @@ -0,0 +1 @@ +Subproject commit 309ab53d8647337e8744ce05a58acc85b36d5efa diff --git a/repo/qemu-user-static b/repo/qemu-user-static new file mode 160000 index 0000000..a9e26d7 --- /dev/null +++ b/repo/qemu-user-static @@ -0,0 +1 @@ +Subproject commit a9e26d72aada571f4bee382aca8c59bec303b1db -- cgit v1.3.1