File: db_get.pl

package info (click to toggle)
localization-config 1.05
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 668 kB
  • ctags: 44
  • sloc: perl: 3,170; sh: 67; makefile: 38
file content (27 lines) | stat: -rwxr-xr-x 592 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/perl

use strict;
use warnings;

# Wrapper function around the script db_get.sh
# We couldn't access debconf from inside the same script
# as debconf does not allow readonly (ie non-locking) access
# to its database, and we need to call debconf-set-selections
# further in the script.

sub db_get {
    my ($key) = @_;
    my $ret = `/usr/lib/localization-config/common/db_get.sh $key 2>&1 >/dev/null`;
    
    $ret =~ s/\n*$//;
    my @res;
    if ( $ret =~ /^\d\d / ) {
        $res[0] = 10;
    } else {
        $res[0] = 0;
        $res[1] = $ret;
    }
    return @res;
}

1;