File: README.tclfilter

package info (click to toggle)
apt-dater 0.9.0-3%2Bwheezy1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,752 kB
  • sloc: ansic: 5,962; sh: 3,800; perl: 1,169; xml: 464; makefile: 181; sed: 16
file content (65 lines) | stat: -rw-r--r-- 2,127 bytes parent folder | download | duplicates (2)
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
57
58
59
60
61
62
63
64
65
TCL Filter
==========

Since version 0.5.9, apt-dater can be configured with TCL filter support.
This feature is disabled by default, enable it with configure:

    $ ./configure --enable-tclfilter

You need a recent TCL version installed to succeed, the Debian packages have
TCL filter support enabled.


Usage
=====

TCL filters can be used to group hosts by your own filter definition. For each
host configured, apt-dater evals your TCL filter and adds the host to the category
"Filtered" in the main screen if the return value is non-zero.

If you have a large number of hosts, it becomes hard i.e. to find out which hosts
have a certain package installed/running an obsolete release... . TCL filter helps
to filter alle hosts by such conditions.


Variables
=========

Before evaluating a TCL filter expression for a host, apt-dater sets the following
variables in the TCL environment:

 -------------+-------------------------------------------------------
  Variable    | Description
 -------------+-------------------------------------------------------
  $cat        | category index (0=Updates pending, 1=Up to date, ...)
  $group      | name of the group the hosts belongs to
  $hostname   | hostname
  $kernel     | kernel release (uname -r)
  $lsb_cname  | "Codename"-field of lsb_release -a
  $lsb_distri | "Release"-field of lsb_release -a
  $lsb_rel    | "Distributer ID"-field of lsb_release -a
  $extras     | array of extra packages
  $flags      | array of host flags (h x R K)
  $holds      | array of packages hold back
  $installed  | array of installed packages
  $updates    | array of packages w/ update available
  $clusters   | array of cluster names
 -------------+-------------------------------------------------------

The filter has the full power of TCL.


Examples
========

Filter all Debian hosts:

 return [expr [string compare $lsb_distri "Debian"] == 0]

Filter all Debian hosts running a release older than Etch:

 return [expr [string compare $lsb_distri "Debian"] == 0 && $lsb_rel < 4.0]

Filter add hosts which have bind installed:

 return [llength [array names installed "bind*"]]