blob: 15c158d73a01a7399f11ced726b9b83520d55ef2 (
plain)
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
|
--TEST--
Check for rpminfo function
--SKIPIF--
<?php if (!extension_loaded("rpminfo")) print "skip";
?>
--FILE--
<?php
foreach ([__DIR__ . "/bidon.rpm", __DIR__ . "/bidon-src.rpm"] as $rpm) {
echo "--- " . basename($rpm) . " ---\n";
$i = rpminfo($rpm, true);
var_dump($i['Name']);
var_dump($i['Description']);
var_dump($i['Changelogtext']);
var_dump($i['IsSource']);
if (!$i['IsSource']) {
var_dump($i['Obsoletename']);
var_dump($i['Obsoleteflags']);
var_dump($i['Obsoleteversion']);
}
}
?>
Done
--EXPECTF--
--- bidon.rpm ---
string(5) "bidon"
string(15) "A dummy package"
array(2) {
[0]=>
string(14) "- add symlinks"
[1]=>
string(20) "- add some hardlinks"
}
bool(false)
array(1) {
[0]=>
string(6) "fooobs"
}
array(1) {
[0]=>
int(2)
}
array(1) {
[0]=>
string(1) "2"
}
--- bidon-src.rpm ---
string(5) "bidon"
string(15) "A dummy package"
array(1) {
[0]=>
string(8) "- create"
}
bool(true)
Done
|