File: custom-scripts.txt

package info (click to toggle)
piuparts 0.31
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 272 kB
  • ctags: 330
  • sloc: python: 2,536; makefile: 74; sh: 6
file content (56 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Custom scripts with piuparts
------------------------------

You can specify several custom scripts to be run inside piuparts.
You have to store them in a directory and give it as argument to
piuparts: --scriptsdir=/dir/with/the/scripts

The scripts can be run:

    Before *installing* your package. The name of the script must
    start with:
    pre_install_

    After *installing* your package and its deps. In the case of the 
    upgrade test, it is after install and upgrade. The name of the 
    script must start with:
    post_install_

    After *removing* your package, The name of the script must start with:
    post_remove_

    After *purging* your package, The name of the script must start with:
    post_purge_

    Before *upgrading* your package, once the current version in the archive
    has been installed (this is done in the second test, "Installation, 
    upgrade and purging test"). The name of the script must start with:
    pre_upgrade_


You can run several scripts in every step, they are run in alphabetical 
order.

The scripts are run *inside* the piuparts chroot and only can be shell 
scripts, if you want to run Python or Perl scripts, you have to install 
Python or Perl. The chroot where piuparts is run is minized and does not 
include Perl.


It would be interesting to declare some piuparts variables like the name
of the current testing packages, and be able to use this variable in the 
custom scripts. But this option is not available yet.

Example script:

$cat post_install_number.sh
----------------------------------------------- 
#!/bin/bash

number=`dpkg -l | wc -l`
echo "There are $number packages installed."
exit 0
-----------------------------------------------