This commit is contained in:
Daniel Langbein 2021-05-02 19:45:37 +02:00
parent ba1fb69714
commit c866d8895a
2 changed files with 34 additions and 14 deletions

View File

@ -1,11 +1,34 @@
#!/bin/bash
function build-with-aurutils() {
aur build -c
}
function build-with-makepkg() {
makepkg -Ccsr
case "$?" in
0)
# Copy the build package to /home/custompkgs
cp "${PKG}-"*.pkg.tar.zst /home/custompkgs/ || return $?
;;
13)
# Exit code 13: A package has already been built.
return 0
;;
*)
# Some other makepkg error occurred.
return 1
;;
esac
}
function build-pkg() {
# $1: package-name
local PKG
PKG="$1"
# check if PKGBUILD exists, otherwise skip
# Check if PKGBUILD exists, otherwise skip
[ -f "pkg/${PKG}/PKGBUILD" ] || {
echo "Directory pkg/${PKG} does not contain a PKGBUILD file - skipping it!";
FAILED_PKGS+=("${PKG}");
@ -14,12 +37,9 @@ function build-pkg() {
cd "pkg/${PKG}" || return $?
# build and copy to /home/custompkgs
BUILD_CMD=('makepkg' '-Ccsr' '&&' 'cp' '"${PKG}-"*.pkg.tar.zst' '/home/custompkgs/')
# BUILD_CMD=('aur' 'build' '-c')
"${BUILD_CMD[@]}" || {
# Build and copy to /home/custompkgs
# build-with-makepkg || {
build-with-aurutils || {
echo "Failed to build package ${PKG}!";
FAILED_PKGS+=("${PKG}");
}
@ -35,26 +55,26 @@ function build-all() {
}
function main() {
# usage:
# either zero arguments to build all packages
# or the names of the packages to build as arguments
# Usage:
# Either zero arguments to build all packages
# or the names of the packages to build as arguments
FAILED_PKGS=()
if [ "$#" -gt "0" ]; then
# at least one argument is given
# At least one argument is given
for PKG in "$@"; do
build-pkg "$PKG" || return $?
done
else
# no arguments given
# No arguments given
build-all || return $?
fi
# push remote repository
# Push remote repository
echo ""
arch-repo-push-new || exit

View File

@ -3,7 +3,7 @@ _pkgname=dns
_reponame=arch
pkgname="de-p1st-$_pkgname"
pkgver=0.0.2
pkgrel=3
pkgrel=4
pkgdesc="DNS configuration: Use DNS over TLS"
arch=('any')
url="https://codeberg.org/privacy1st/${_reponame}"