From 97373f61aba6c1bad1fdc989fbd72273766967a8 Mon Sep 17 00:00:00 2001 From: fbt Date: Mon, 1 Jun 2015 14:24:42 +0300 Subject: [PATCH] new builder --- builder-chroot | 40 ++++++++++++++++++++++++++++++++++++++++ builder-chroot.cfg | 9 +++++++++ 2 files changed, 49 insertions(+) create mode 100755 builder-chroot create mode 100755 builder-chroot.cfg diff --git a/builder-chroot b/builder-chroot new file mode 100755 index 0000000..6979c6f --- /dev/null +++ b/builder-chroot @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# A simple script to build packages into multiple repos + +err() { echo "$1" >&2; } + +build_pkg() { + local makepkg_output makepkg_exit_code makepkg_status + + package="$1" + repo="$2" + + [[ -d "${cfg_repos_dir}/${repo}" ]] || { + echo "Creating ${cfg_repos_dir}/${repo}" + mkdir -p "${cfg_repos_dir}/${repo}" || { + return 1 + } + } + + echo -n "Building ${repo}/${package}... " + + cd "/tmp/build-${package}" + sudo /usr/local/bin/makepkg-chroot.sh "${cfg_build_dir}/${package}.chroot" "${cfg_repos_dir}/${repo}" +} + +main() { + source 'builder-chroot.cfg' + + package="$1" + repo_name="$2" + + build_pkg "$package" "$repo_name" + repo-add -n "${repo_name}.db.tar.gz" "$package"*.pkg.tar.xz + + for i in "${repos[@]}"; do + cd "${cfg_repos_dir}/${i}" + repo-add -n "${i}.db.tar.gz" *.pkg.tar.xz + done +} + +main diff --git a/builder-chroot.cfg b/builder-chroot.cfg new file mode 100755 index 0000000..144bedd --- /dev/null +++ b/builder-chroot.cfg @@ -0,0 +1,9 @@ +# The config for building packages in chroots + +cfg_git_repo="$HOME/git/pkgbuilds.git" + +cfg_build_dir="/tmp" +cfg_repos_dir="$HOME/public" +cfg_chroot_dir="/tmp/chroot" + +export GIT_DIR='.git'