summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradford Smith2021-02-06 17:46:51 -0500
committerBradford Smith2021-02-06 18:29:11 -0500
commit4810ee78c92f43f18c4ae0510ef15e3a21517148 (patch)
treebe9e70367de1127234e63d885dc736b019daa0b3
parentdf5420f921e0bfac0a1221ddf808ce792ee7ac10 (diff)
downloadaur-4810ee78c92f43f18c4ae0510ef15e3a21517148.tar.gz
Update version for v0.4.x
This changes the save file location and permissions for the cache directory. A message was added for upgrading to this from old versions.
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD14
-rw-r--r--informant.install23
3 files changed, 33 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 903a7fb165c3..7b8c64e5346c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = informant
pkgdesc = An Arch Linux News reader and pacman hook
- pkgver = 0.3.2
+ pkgver = 0.4.1
pkgrel = 1
url = https://github.com/bradford-smith94/informant
install = informant.install
@@ -11,8 +11,10 @@ pkgbase = informant
depends = python-dateutil
depends = python-feedparser
depends = python-html2text
- source = https://github.com/bradford-smith94/informant/archive/v0.3.2.tar.gz
- sha256sums = 812222834bfae6698a3e12162d7c4fc96041d0c46c0cb0269724e4e20de9e2b4
+ depends = python-cachecontrol
+ depends = python-lockfile
+ source = https://github.com/bradford-smith94/informant/archive/v0.4.1.tar.gz
+ sha256sums = 4d666f358b2461b1d3d53a7e996963e8c16ddaad1804b621eb193079ec20173c
pkgname = informant
diff --git a/PKGBUILD b/PKGBUILD
index c8d84f837543..b475660596ce 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,21 +1,27 @@
# Maintainer: Bradford Smith <aur@bradfords.me>
pkgname=informant
-pkgver=0.3.2
+pkgver=0.4.1
pkgrel=1
pkgdesc="An Arch Linux News reader and pacman hook"
arch=('any')
url="https://github.com/bradford-smith94/$pkgname"
license=('MIT')
install=informant.install
-depends=('python' 'python-docopt' 'python-dateutil' 'python-feedparser' 'python-html2text')
+depends=('python' 'python-docopt' 'python-dateutil' 'python-feedparser' 'python-html2text' 'python-cachecontrol' 'python-lockfile')
source=("https://github.com/bradford-smith94/$pkgname/archive/v$pkgver.tar.gz")
-sha256sums=('555f06e926bfe0b5b4f7e67f04d5c2e738947b85bf72231d19e6d4e8d6d39620')
+sha256sums=('e616dd32d275fccfeaa65fa1890d706075dd5f54a2b03351349adb40b308c8ca')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ python setup.py build
+}
package() {
cd "$srcdir/$pkgname-$pkgver"
- install -Dm 0755 $pkgname -t $pkgdir/usr/bin/
+ python setup.py install --root="${pkgdir}" --skip-build
install -Dm 0644 $pkgname.hook -T $pkgdir/usr/share/libalpm/hooks/00-$pkgname.hook
install -Dm 0644 LICENSE -t $pkgdir/usr/share/licenses/$pkgname/
install -Dm 0644 man/$pkgname.1 -t $pkgdir/usr/share/man/man1/
+ gzip $pkgdir/usr/share/man/man1/$pkgname.1
}
diff --git a/informant.install b/informant.install
index d30d9c749843..62191a8a2043 100644
--- a/informant.install
+++ b/informant.install
@@ -1,11 +1,20 @@
CLEAR="$(tput sgr0)"
-YELLOW="${bold}$(tput setaf 3)"
+YELLOW="$(tput bold)$(tput setaf 3)"
post_install() {
groupadd informant 2>/dev/null
- touch /var/cache/informant.dat
- chgrp informant /var/cache/informant.dat
- chmod 664 /var/cache/informant.dat
+
+ # save file
+ touch /var/lib/informant.dat
+ chgrp informant /var/lib/informant.dat
+ chmod 664 /var/lib/informant.dat
+
+ # cache dir
+ mkdir -p /var/cache/informant 2>/dev/null
+ chgrp informant /var/cache/informant
+ chmod 775 /var/cache/informant
+ chmod g+s /var/cache/informant
+
printf "%sNOTE%s: Add yourself to group \"informant\" to avoid the need for sudo\n" "$YELLOW" "$CLEAR"
}
@@ -13,7 +22,11 @@ post_upgrade() {
post_install
#new_ver=$1
old_ver=$2
+ if [[ $old_ver =~ ^0\.[0123]\.* ]]; then
+ mv /var/cache/informant.dat /var/lib/informant.dat
+ printf "%sNOTE%s: This update moves the location of the save file.\n/var/cache/informant.dat is now /var/lib/informant.dat, and cache data is saved in /var/cache/informant/.\nYou should not need to re-read old items.\n" "$YELLOW" "$CLEAR"
+ fi
if [[ $old_ver =~ ^0\.[01]\.* ]]; then
- printf "%sWARNING%s: This update changes the format of the /var/cache/informant.dat file, you will need to re-read all news items.\n" "$YELLOW" "$CLEAR"
+ printf "%sWARNING%s: This update changes the format of the save file, you will need to re-read all news items.\n" "$YELLOW" "$CLEAR"
fi
}