File: setdebconf-v0.9

package info (click to toggle)
autoinstall 1.0
  • links: PTS
  • area: main
  • in suites: woody
  • size: 356 kB
  • ctags: 41
  • sloc: python: 2,127; perl: 145; sh: 128; makefile: 65
file content (35 lines) | stat: -rwxr-xr-x 597 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
#!/usr/bin/perl

# setdebconf - write debconf values into the database.

use Debconf::Client::ConfModule ':all';

open(DEBCONF, $ARGV[0]);
while (<DEBCONF>)
  {
    chomp;
    @field = split(/\s/, $_, 3);
    if (scalar(@field) == 2)
      {
	unset($field[1]);
	if ($field[0] ne $field[1])
	  {
	    unregister($field[1]);
	  }
      }
    elsif (scalar(@field) == 3)
      {
	if ($field[0] ne $field[1])
	  {
	    register($field[0], $field[1]);
	  }
	if ($field[2] eq '""')
	  {
	    $field[2] = '';
	  }
	set($field[1], $field[2]);
	fset($field[1], "seen", "true");
      }
  }

close DEBCONF;