diff options
author | Alex Butler | 2018-01-30 08:56:46 +0000 |
---|---|---|
committer | Alex Butler | 2018-01-30 08:56:46 +0000 |
commit | b33fe670a5bd408754ad5ba8c8678cd0731df328 (patch) | |
tree | 3387d0adb11df0abb6d0260f699e2a7de8c168b4 | |
parent | 8f9eb254785f7189d63ee3f2f22349aca293a44f (diff) | |
download | aur-b33fe670a5bd408754ad5ba8c8678cd0731df328.tar.gz |
0.2-1
Add pacutils dependency
Update install script
-rw-r--r-- | .SRCINFO | 9 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rw-r--r-- | aurto.install | 36 |
4 files changed, 38 insertions, 17 deletions
@@ -1,7 +1,7 @@ pkgbase = aurto pkgdesc = A simple aur tool for managing a local 'aurto' repository - pkgver = 0.1 - pkgrel = 2 + pkgver = 0.2 + pkgrel = 1 url = https://github.com/alexheretic/aurto install = aurto.install arch = any @@ -9,8 +9,9 @@ pkgbase = aurto depends = aurutils depends = devtools depends = systemd - source = https://github.com/alexheretic/aurto/archive/v0.1.tar.gz - sha256sums = 7173bf8a4ebb7203bb26f727851f5a1d9b6f351a347b3e242680ae7f44e7a3f6 + depends = pacutils + source = https://github.com/alexheretic/aurto/archive/v0.2.tar.gz + sha256sums = e104f65129bf69d48c25dd343ea5492c95493adceb4ec6b6eae361bc7fa9dba5 pkgname = aurto diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9881fec21af4..000000000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.tar.* @@ -1,19 +1,20 @@ # Maintainer: Alex Butler <alexheretic@gmail.com> pkgname=aurto -pkgver=0.1 -pkgrel=2 +pkgver=0.2 +pkgrel=1 pkgdesc="A simple aur tool for managing a local 'aurto' repository" arch=('any') url="https://github.com/alexheretic/aurto" license=('MIT') depends=('aurutils' 'devtools' - 'systemd') + 'systemd' + 'pacutils') optdepends=() makedepends=() install="aurto.install" source=("https://github.com/alexheretic/$pkgname/archive/v$pkgver.tar.gz") -sha256sums=('7173bf8a4ebb7203bb26f727851f5a1d9b6f351a347b3e242680ae7f44e7a3f6') +sha256sums=('e104f65129bf69d48c25dd343ea5492c95493adceb4ec6b6eae361bc7fa9dba5') build() { cd "$pkgname-$pkgver" diff --git a/aurto.install b/aurto.install index ea3c4bc6e141..3f0364c7ed83 100644 --- a/aurto.install +++ b/aurto.install @@ -7,6 +7,19 @@ function initialised { grep -q '^Include = /etc/pacman.d/aurto$' /etc/pacman.conf } +function setup_sudoers { + echo "## aurto rules +%$user ALL=(ALL) NOPASSWD: /usr/bin/arch-nspawn +%$user ALL=(ALL) NOPASSWD: /usr/bin/pacsync aurto +%$user ALL=(ALL) NOPASSWD:SETENV: /usr/bin/makechrootpkg +%$user ALL=(ALL) NOPASSWD:SETENV: /usr/bin/aurbuild_chroot +## /aurto rules" >> /etc/sudoers +} + +function clean_sudoers { + sed -i '/^## aurto rules$/,/^## \/aurto rules$/d' /etc/sudoers +} + post_install() { if initialised; then echo 'Already initialised' >&2 @@ -30,25 +43,32 @@ post_install() { if ! test -f /etc/sudoers.aurto-backup; then cp /etc/sudoers /etc/sudoers.aurto-backup fi - echo "## aurto rules -%$user ALL=(ALL) NOPASSWD: /usr/bin/arch-nspawn -%$user ALL=(ALL) NOPASSWD:SETENV: /usr/bin/makechrootpkg -%$user ALL=(ALL) NOPASSWD:SETENV: /usr/bin/aurbuild_chroot -## /aurto rules" >> /etc/sudoers + setup_sudoers echo 'aurto: Adding systemd timer update tasks' >&2 systemctl enable --now /usr/lib/systemd/system/check-aurto-git-trigger.timer systemctl enable --now /usr/lib/systemd/system/update-aurto.timer } + +post_upgrade() { + if ! initialised; then + exit 0 + fi + + ## redo to support package to package changes + clean_sudoers + setup_sudoers +} + pre_remove() { if ! initialised; then exit 0 fi echo 'aurto: Removing systemd timer update tasks' >&2 - systemctl disable --now check-aurto-git-trigger.timer - systemctl disable --now update-aurto.timer + systemctl disable --now check-aurto-git-trigger.timer || true + systemctl disable --now update-aurto.timer || true } post_remove() { @@ -57,7 +77,7 @@ post_remove() { fi echo 'aurto: Removing aurto rules from /etc/sudoers' >&2 - sed -i '/^## aurto rules$/,/^## \/aurto rules$/d' /etc/sudoers + clean_sudoers echo 'aurto: Removing /var/cache/pacman/aurto' >&2 rm -rf /var/cache/pacman/aurto || true |