Mailinglist Archive: opensuse-buildservice (269 mails)

< Previous Next >
Re: [opensuse-buildservice] [PATCH] teach osc to run post-command hooks
  • From: Michal Marek <mmarek@xxxxxxx>
  • Date: Thu, 25 Sep 2008 16:30:05 +0200
  • Message-id: <48DBA06D.4040107@xxxxxxx>
Michael Wolf wrote:
Yo

Attached is a patch that enables osc to run post-command hooks.

To use it, create ~/.osc/hooks. Inside that directory, create a
directory for each command you'd like to hook. For instance,
~/.osc/hooks/build/. Everything in that directory will be run when the
command completes. It tries to ignore backup files and the like, but I
surely missed a few created by editors I don't use. :)

A script in ~/.osc/hooks/build might look like:

#!/bin/sh

notify-send "osc build finished"

but of course they can be as simple or complicated as you wish. Of
course, they need to be executable.

It would be cool to set some variables like OSC_PROJECT, OSC_PACKAGE,
OSC_PACKAGE_DIR, OSC_PROJECT_DIR, OSC_REPOSITORY and so on to be able to
get some context in the hooks:

~/.osc/hooks/build/fix-build
#!/bin/sh

if test "$OSC_EXIT_STATUS" != 0; then
notify-send "please fix your stuff"
gvim -o "$OSC_PACKAGE_DIR/$OSC_SPEC_NAME" \
"$OSC_BUILD_ROOT/.build.log"
fi

:-)

Michal
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
References