[go2n@buglink:~] $

sudo rm -rf /home/me 2> /dev/null

Pacman & AUR Update Notifier

Sebenarnya banyak aplikasi system-tray notifier untuk Archlinux system updates seperti alunn, pacman-notifier, chase, dan lain-lain. Namun beberapa project sudah tidak aktif dan beberapa menggunakan library GTK+. Sedangkan untuk KDE sebenarnya ada aplikasi Chase yang dibuat oleh Chakra Project, namun saya sendiri kesulitan menggunakan Chase. Setelah googling akhirnya nemu blognya Andrea Scarpino (Archlinux KDE SC maintainer) yang menjelaskan bagaimana membuat system-tray notifier yang mudah dan simple.

Untuk membuat “Pacman & AUR Update KDE Notifier” sangat mudah dan hanya memerlukan shell script, KDialog serta AUR agent. Pada tulisan ini AUR agent yang digunakan adalah Cower. Jika pada mesin archlinux anda belum terinstall cower install terlebih dahulu via AUR.

[me@archlinux ~]$ yaourt -S cower

==> Downloading cower PKGBUILD from AUR...
x PKGBUILD
x set_curlopt_nosignal.patch

First Submitted: Thu, 30 Dec 2010 02:30:37 +0000
cower 2.9.9-2 : A simple AUR agent with a pretentious name
( Unsupported package: Potentially dangerous ! )
==> Edit PKGBUILD ? [Y/n] ("A" to abort)
==> ------------------------------------
==> n

==> cower dependencies:
 - curl (already installed)
 - yajl (already installed)
 - pacman (already installed)
 - perl (already installed)

==> Continue building cower ? [Y/n]
==> -------------------------------
==>
==> Building and installing package
==> Making package: cower 2.9.9-2 (Mon Feb  7 17:42:05 WIT 2011)
==> Checking Runtime Dependencies...
==> Checking Buildtime Dependencies...
==> Retrieving Sources...
 -> Downloading cower-2.9.9.tar.gz...
--2011-02-07 17:42:05--  https://github.com/downloads/falconindy/cower/cower-2.9.9.tar.gz
Resolving github.com... 207.97.227.239
Connecting to github.com|207.97.227.239|:443... connected.
WARNING: certificate common name “*.github.com” doesn’t match requested host name “github.com”.
HTTP request sent, awaiting response... 302 Found
Location: http://cloud.github.com/downloads/falconindy/cower/cower-2.9.9.tar.gz [following]
--2011-02-07 17:42:08--  http://cloud.github.com/downloads/falconindy/cower/cower-2.9.9.tar.gz
Resolving cloud.github.com... 204.246.165.146, 204.246.165.175, 204.246.165.158, ...
Connecting to cloud.github.com|204.246.165.146|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15064 (15K) [.gz]
Saving to: “cower-2.9.9.tar.gz.part”

100%[========================================================>] 15,064      2.28K/s   in 6.5s

2011-02-07 17:42:15 (2.28 KB/s) - “cower-2.9.9.tar.gz.part” saved [15064/15064]

 -> Found set_curlopt_nosignal.patch
==> Validating source files with md5sums...
 cower-2.9.9.tar.gz ... Passed
 set_curlopt_nosignal.patch ... Passed
==> Extracting Sources...
 -> Extracting cower-2.9.9.tar.gz with bsdtar
==> Starting build()...
patching file cower.c
c99 -c -march=x86-64 -mtune=generic -O2 -pipe -g -pedantic -Wall -Wextra -DCOWER_VERSION=\"2.9.9\"  cower.c
c99 -o cower cower.o -Wl,--hash-style=gnu -Wl,--as-needed -lcurl -lalpm -lyajl -larchive -pthread
pod2man --section=1 --center="Cower Manual" --name="COWER" --release="cower 2.9.9" README.pod > cower.1
==> Entering fakeroot environment...
==> Starting package()...
install -D -m755 cower /tmp/yaourt-tmp-me/aur-cower/pkg/usr/bin/cower
install -D -m644 cower.1 /tmp/yaourt-tmp-me/aur-cower/pkg/usr/share/man/man1/cower.1
install -D -m644 bash_completion /tmp/yaourt-tmp-me/aur-cower/pkg/etc/bash_completion.d/cower
==> Tidying install...
 -> Purging other files...
 -> Compressing man and info pages...
 -> Stripping unneeded symbols from binaries and libraries...
==> Creating package...
 -> Generating .PKGINFO file...
 -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: cower 2.9.9-2 (Mon Feb  7 17:42:16 WIT 2011)

==> Continue installing cower ? [Y/n]
==> [v]iew package contents [c]heck package with namcap
==> ---------------------------------------------------
==>

resolving dependencies...
looking for inter-conflicts...

Targets (1): cower-2.9.9-2

Total Download Size:    0.00 MB
Total Installed Size:   0.07 MB

Proceed with installation? [Y/n]
checking package integrity...
(1/1) checking for file conflicts                          [################################] 100%
(1/1) installing cower                                     [################################] 100%

Setelah install cower sekarang tuliskan shell script berikut dan simpan di /etc/crond.hourly:

#!/bin/bash
/usr/bin/pacman --sync --refresh

Shell script diatas untuk mengupdate database pacman. Selanjutnya tuliskan shell script dibawah ini dan tambahkan shell script tersebut pada user crontab anda:

#!/bin/bash

pkgs=$(pacman -Qqu | wc -l)
aurpkgs=$(cower -ud | wc -l)

unset msg1
unset msg2
unset packages

if [[ ${pkgs} -gt 0 ]]; then
 msg1="${pkgs} in pacman"
fi

if [[ ${aurpkgs} -gt 0 ]]; then
 msg2=" ${aurpkgs} in AUR"
fi
let packages=${pkgs}+${aurpkgs}

if [[ ${packages} -gt 0 ]]; then
 kdialog --title "Out-of-Date packages" --passivepopup "There are ${packages} outofdated packages (${msg1}${msg2})" 10
fi

exit 0

Screenshot notifikasi

Screenshot notifikasi

Referensi: Hey, you’ve N outofdated packages!

Have fun! :-)

=-=-=-=-=
Powered by Blogilo

One Response to Pacman & AUR Update Notifier

  1. iMemovaz 11 February 2011 at 5:03 am

    Liwat titip komen.. Gon.. link-ku pasang neng blogroll yo.. nuwun :)

    Edy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.