summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlberto Salvia Novella2019-10-03 00:59:01 +0200
committerAlberto Salvia Novella2019-10-03 00:59:01 +0200
commit442082e88a5a2e4b42f49af45a6a861a897ab83e (patch)
treed81d9ceb8f3a49101bbd415771ae09656a966789
parent0125c36ebd1bdafa51513dd2f96feddd894461fe (diff)
downloadaur-442082e88a5a2e4b42f49af45a6a861a897ab83e.tar.gz
2019-10-03 1570057140
-rwxr-xr-xBUILD30
-rwxr-xr-xPUBLISH28
2 files changed, 33 insertions, 25 deletions
diff --git a/BUILD b/BUILD
index cab06cc91765..2487916b2d24 100755
--- a/BUILD
+++ b/BUILD
@@ -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"
}
diff --git a/PUBLISH b/PUBLISH
index 836b826cd781..e606dfd7f694 100755
--- a/PUBLISH
+++ b/PUBLISH
@@ -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"
}