From c866d8895a8d68b617e42bbb9ad41ecb8aa24e64 Mon Sep 17 00:00:00 2001 From: langfingaz Date: Sun, 2 May 2021 19:45:37 +0200 Subject: [PATCH] test --- build-pkg.sh | 46 ++++++++++++++++++++++++++++------------ pkg/de-p1st-dns/PKGBUILD | 2 +- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/build-pkg.sh b/build-pkg.sh index 9f54c62..f2a4bac 100755 --- a/build-pkg.sh +++ b/build-pkg.sh @@ -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 diff --git a/pkg/de-p1st-dns/PKGBUILD b/pkg/de-p1st-dns/PKGBUILD index eaedfdc..04a9cc1 100644 --- a/pkg/de-p1st-dns/PKGBUILD +++ b/pkg/de-p1st-dns/PKGBUILD @@ -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}"