[pacman-dev] [PATCH] Allow package to display a brief message before sync install

James Rayner iphitus at iphitus.org
Mon Sep 14 09:03:18 EDT 2009


The aim of this is to alert a user to system/package breaking updates
before they happen and before they approve the sync install. This is
intended primarily for kernel/initscripts/pacman, etc updates when
things could go really wrong and need to be known beforehand. Example
output below.

This adds an alert="" option to the PKGBUILD. This entry is then
stored in the package and then the db with repo-add. On a pacman sync
operation if any has an alert message it will be displayed before
"Proceed with installation"

This is a really basic implementation that I'm sure could be brushed
up, as I've not used C for a while. However the pacman code is very
clean and easy to read, so that made it pretty trivial to add.

There's an example repo with one package "alert" at
http://mess.iphitus.org/alert-test/

The PKGBUILD for the aforementioned package:
http://mess.iphitus.org/alert-test/PKGBUILD

Attached patch is against latest git.

James

# Example output (note: the format is pkgname: message)
iphitus(~/projects/alert/pacman)$ sudo pacman -S alert
resolving dependencies...
looking for inter-conflicts...

Targets (1): alert-1-1

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

alert: This package has an alert message. It may contain tacos.
Proceed with installation? [Y/n]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Allow-package-to-display-a-brief-message-before-sync.patch
Type: text/x-patch
Size: 6158 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/pacman-dev/attachments/20090914/b435abc5/attachment.bin>


More information about the pacman-dev mailing list