diff options
author | Alberto Salvia Novella | 2019-10-03 00:49:07 +0200 |
---|---|---|
committer | Alberto Salvia Novella | 2019-10-03 00:49:07 +0200 |
commit | 4add87ddc6ac6027c0016f362443ad1ada7c2fd2 (patch) | |
tree | 27310eacd7c6fb208527ff988a68f8377fbec63e | |
parent | c536660604a8cb07630f02491b36332765ba04d1 (diff) | |
download | aur-4add87ddc6ac6027c0016f362443ad1ada7c2fd2.tar.gz |
2019-10-03 1570056546
-rw-r--r-- | .SRCINFO | 2 | ||||
-rwxr-xr-x | BUILD | 30 | ||||
-rwxr-xr-x | PKGBUILD | 26 | ||||
-rwxr-xr-x | PUBLISH | 28 |
4 files changed, 49 insertions, 37 deletions
@@ -1,7 +1,7 @@ pkgbase = qsyncthingtray-git pkgdesc = Syncs files among devices, and shows the sync status on a tray icon. Version with the latest unreleased improvements. pkgver = r421.11936bc - pkgrel = 1 + pkgrel = 2 url = https://github.com/sieren/QSyncthingTray arch = i686 arch = x86_64 @@ -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" } @@ -1,27 +1,29 @@ #! /bin/bash -# (GPL3+) Alberto Salvia Novella (es20490446e.wordpress.com) Name="QSyncthingTray" LowercaseName=$(echo "${Name,,}") pkgname="${LowercaseName}-git" + pkgver=r421.11936bc -pkgrel=1 -pkgdesc="Syncs files among devices, and shows the sync status on a tray icon. Version with the latest unreleased improvements." +pkgrel=2 arch=("i686" "x86_64") -url="https://github.com/sieren/QSyncthingTray" + +pkgdesc="Syncs files among devices, and shows the sync status on a tray icon. Version with the latest unreleased improvements." license=("LGPL3") + +url="https://github.com/sieren/QSyncthingTray" +source=("git+${url}.git" "${LowercaseName}.desktop") +md5sums=("SKIP" "SKIP") + makedepends=("cmake" "git") depends=("qt5-location" "qt5-webengine" "startup-settings-git" "syncthing") provides=("${LowercaseName}") conflicts=("${LowercaseName}") -source=("git+${url}.git" "${LowercaseName}.desktop") -md5sums=("SKIP" "SKIP") pkgver() { - cd "${srcdir}/${Name}" - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" - echo + cd "${Name}" + printf "r%s.%s\n" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } @@ -42,9 +44,11 @@ package() { mkdir --parents "${pkgdir}/usr/share/applications" mv "${srcdir}/${Name}/build/${Name}" "${pkgdir}/usr/bin/${LowercaseName}" - mv "${srcdir}/${Name}/resources/images/Icon1024.png" "${pkgdir}/usr/share/pixmaps/${LowercaseName}.png" - mv "${srcdir}/${LowercaseName}.desktop" "${pkgdir}/usr/share/applications/${LowercaseName}.desktop" + cp "${srcdir}/${Name}/resources/images/Icon1024.png" "${pkgdir}/usr/share/pixmaps/${LowercaseName}.png" + cp "${srcdir}/${LowercaseName}.desktop" "${pkgdir}/usr/share/applications/${LowercaseName}.desktop" + find "${pkgdir}" -type d -exec chmod u=rwx,g=rx,o=rx {} \; + find "${pkgdir}" -type f -exec chmod u=rw,g=r,o=r {} \; chmod +x "${pkgdir}/usr/bin/${LowercaseName}" } @@ -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" } |