2015-06-01 11:24:42 +00:00
|
|
|
#!/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"
|
|
|
|
|
2015-06-01 11:30:57 +00:00
|
|
|
cd "${cfg_repos_dir}/${repo_name}"
|
2015-06-01 11:29:41 +00:00
|
|
|
repo-add -n "${repo_name}.db.tar.gz" "$package"*.pkg.tar.xz
|
2015-06-01 11:24:42 +00:00
|
|
|
}
|
|
|
|
|
2015-06-01 11:27:29 +00:00
|
|
|
main "$@"
|