diff options
author | Alberto Salvia Novella | 2019-10-03 00:59:01 +0200 |
---|---|---|
committer | Alberto Salvia Novella | 2019-10-03 00:59:01 +0200 |
commit | 442082e88a5a2e4b42f49af45a6a861a897ab83e (patch) | |
tree | d81d9ceb8f3a49101bbd415771ae09656a966789 | |
parent | 0125c36ebd1bdafa51513dd2f96feddd894461fe (diff) | |
download | aur-442082e88a5a2e4b42f49af45a6a861a897ab83e.tar.gz |
2019-10-03 1570057140
-rwxr-xr-x | BUILD | 30 | ||||
-rwxr-xr-x | PUBLISH | 28 |
2 files changed, 33 insertions, 25 deletions
@@ -10,7 +10,7 @@ mainFunction () { buildPackage () { removeBuildFiles - echoOnError "buildPackage" "makepkg --force" + makePackage removeBuildFiles } @@ -20,27 +20,35 @@ changeToThisProgramDir () { } -echoOnError () { - function="${1}" - command="${2}" - error=$(eval "${command}" 2>&1 >"/dev/null") +makePackage () { + nice="nice --adjustment=19" + ionice="ionice -c2 -n7" - if [ ${?} -ne 0 ]; then - echo "${function}: ${error}" >&2 - exit 1 - fi + silently "makePackage" "PKGEXT='.pkg.tar.gz' ${nice} ${ionice} makepkg --force" } removeBuildFiles () { name=$(variableInFile "Name" "PKGBUILD") folders="pkg src ${name}" - echoOnError "removeBuildFiles" "rm --recursive --force ${folders}" + silently "removeBuildFiles" "rm --recursive --force ${folders}" +} + + +silently () { + function="${1}" + command="${2}" + error=$(eval "${command}" 2>&1 >"/dev/null") + + if [ ${?} -ne 0 ]; then + echo "${function}: ${error}" >&2 + exit 1 + fi } updateInfoFile () { - echoOnError "updateInfoFile" "makepkg --printsrcinfo > .SRCINFO" + silently "updateInfoFile" "makepkg --printsrcinfo > .SRCINFO" } @@ -15,24 +15,24 @@ changeToThisProgramDir () { } -echoOnError () { - function="${1}" - command="${2}" - error=$(eval "${command}" 2>&1 >"/dev/null") +publish () { + summary="${1}" - if [ ${?} -ne 0 ]; then - echo "${function}: ${error}" >&2 - exit 1 - fi + silently "publish: add" "git add ." + git commit --message="${summary}" 2>&1 >"/dev/null" + silently "publish: push" "git push" } -publish () { - summary="${1}" +silently () { + function="${1}" + command="${2}" + error=$(eval "${command}" 2>&1 >"/dev/null") - echoOnError "publish: add" "git add ." - git commit --message="${summary}" 2>&1 >"/dev/null" - echoOnError "publish: push" "git push" + if [ ${?} -ne 0 ]; then + echo "${function}: ${error}" >&2 + exit 1 + fi } @@ -46,7 +46,7 @@ summary () { updateInfoFile () { - echoOnError "updateInfoFile" "makepkg --printsrcinfo > .SRCINFO" + silently "updateInfoFile" "makepkg --printsrcinfo > .SRCINFO" } |