Simple monitor server for pacman and AUR updates
Python C Shell
Switch branches/tags
Latest commit 0cb4941 Feb 1, 2015 @foucault Add deprecation notice
Permalink
Failed to load latest commit information.
man
src
.gitignore
COPYING
MANIFEST.in
README.md
msgfmt.py
pkgupdate.conf
pkgupdate.rc
pkgupdate.service
pkgupdate_conky.py
pkgupdate_gtk.py
pkgupdate_gtk3.py
pkgupdate_list.py
pkgupdate_server.py
setup.py
sync_sandbox.sh
tests.py

README.md

pkgupdate

Deprecation notice

Please note that this project is being superseded by pkgupd but it will be maintained until feature parity is reached.

About

Pkgupdate is a small daemon that monitors repositories and AUR packages for updates in Archlinux. Since the server is application agnostic it can be interfaced by any program in any language. Thus, frontends are implementation independent and can communicate with the server via simple commands. A simple conky client that prints the number of updatable packages is shipped with the server. The server and conky client require Python 3 (this is the default in Archlinux). The gtk+ client depends on Python 2, though, since pygtk does not support python 3 yet.

HowTo

Compile and install

After downloading the source compile the required C module with

python setup.py build

and install it with

python setup.py install

Alternatively, use AUR.

Use

pkgupdate comes with a regular systemd service. You may start it with systemctl start pkgupdate. If you want it to start at every boot use systemctl enable pkgupdate. After the daemon is started you may check it out with pkgupdate_conky.py. This should return a conky formatted string (use with ${execp} or ${execpi}) with the number of updates in repos+AUR format or OK otherwise. The conky client output can be customized more if you want; pkgupdate_conky.py --help for more details. A gtk2 (pkgupdate_gtk.py) and gtk3 (pkgupdate_gtk3.py) tray application is included as well.

Configuration

The main configuration file is /etc/pkgupdate.conf but it can be overridden using the -c switch (see the manpage). The configuration options are documented in the comments. Options marked as [EXPERIMENTAL] are crash-prone. Use with caution.

Communicating

Interacting with the server is pretty easy, but the protocol is long way from being finalized. Communication is done via a UNIX socket named \0PkgUpdateSocket. Maybe in the near future the socket name will be configurable. Please note that all commands should be sent encoded in utf-8 and must be terminated with \r\n. If you do not terminate your command and the input buffer gets over the threshold the connection will be terminated and {'error':'OVFLO'} will be sent to the client. All responses are json objects encoded in utf-8 as well and fall into three main categories

  • Successful queries return {'ack':'OK',<rest of data here>}.
  • Failed queries return {'error':'<error message here>'}.
  • Status queries return {'status':'<status here>'}.

The available commands are: nudge: This just pings the server. Returns {'ack':'OK'} if the server is up.

force_upd <SERVICE_ID>: This forces the server to poll the specified action for updates. Without arguments it polls alpm for non-foreign package updates.

force_upd_all: Force all registered actions for updates.

status: Returns {'status':'WORKING'} when a background thread is working. Returns {'status':'IDLE'} otherwise.

normal: This returns all available updates as a JSON utf-8 byte-encoded string formatted as:

{'ack':'OK','repos':[{'name':PKG_NAME1,'version':PKG_VRS1},...],
'aur':[{'name':PKG_NAME1,'version':PKG_VRS1},...]}

The 'aur' line appears only if the server has been started with the -a option. The pkgupdate.rc does that by default.

Bugs

If you have discovered a bug, which is quite likely, please open an issue ticket. If you have a solution for that bug (even better) send in a pull request.

Longterm goals

These are some features that I would like to incorporate into the server but I have not yet found a way to do it. Input welcome!

  • Automatically update the server when a package manager transaction has been performed (currently experimental by using the -m option in the server's invoke command)
  • Add an abstraction layer so that the server can support more package backends.