File: 01_system.t

package info (click to toggle)
libapt-pkg-perl 0.1.43
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: perl: 1,285; ansic: 201; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (8)
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
#!/usr/bin/perl

# AptPkg::System tests

BEGIN { print "1..2\n" }

use AptPkg::Config '$_config';
use AptPkg::System '$_system';

print 'not ' unless $_config->init and $_system = $_config->system;
print "ok 1\n";

my $type;
$type ||= 'dpkg' if -f '/etc/debian_version';
$type ||= 'rpm'  if -f '/etc/redhat-release';
unless ($type)
{
    print "# unknown system type, defaulting to dpkg\n";
    $type = 'dpkg';
}

print 'not ' unless $_system->label =~ /$type/;
print "ok 2\n";

1;