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

View File

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