-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkgdb_test2.pl
64 lines (53 loc) · 1.56 KB
/
pkgdb_test2.pl
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
#!/usr/bin/perl
# Copyright 2014 Chernov A.A. <[email protected]>
# This is a part of mingw-portage project:
# http://sourceforge.net/projects/mingwportage/
# Distributed under the terms of the GNU General Public License v3
BEGIN {
# TODO: remove this define and read from config.
$XMERGE_PATH = "d:/msys_4_64/build/minmerge";
$MSYS_PATH = "d:/msys_4_64";
require "$XMERGE_PATH/lib/pkg_version.pm";
import pkg_version;
require "$XMERGE_PATH/lib/pkgdb.pm";
import pkgdb;
}
sub print_hash(%);
# test xbuild_info()
my $script = "c:/msys/1.0/build/portage/sys-libs/zlib/zlib-1.2.8.xbuild";
my %info = xbuild_info($script);
print "script: $script\n";
print_hash(%info); print "\n";
my $script = "c:/msys/1.0/build/portage/sys-libs/zlib/zlib-1.2.8-r12.xbuild";
my %info = xbuild_info($script);
print "script: $script\n";
print_hash(%info); print "\n";
my $script = "c:/mingw/var/db/pkg/sys-libs/zlib-1.2.8/zlib-1.2.8-r12.xbuild";
my %info = xbuild_info($script);
print "script: $script\n";
print_hash(%info); print "\n";
my $script = "/sys-libs/zlib/zlib-1.2.8-r12.xbuild";
my %info = xbuild_info($script);
print "script: $script\n";
print_hash(%info); print "\n";
my $script = "zlib/zlib-1.2.8-r12.xbuild";
my %info = xbuild_info($script);
print "script: $script\n";
print_hash(%info); print "\n";
sub print_hash(%)
{
my (%h) = @_;
my ($key, $val) = each(%h);
while (defined($key) && defined($val))
{
print $key . '=>' . $val;
if (($key, $val) = each(%h))
{
print ',';
}
else
{
last;
}
}
}