summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package.xml1
-rw-r--r--rpminfo.c2
-rw-r--r--tests/008-rpmdbinfo2.phpt16
3 files changed, 18 insertions, 1 deletions
diff --git a/package.xml b/package.xml
index b5c6e65..41ff33f 100644
--- a/package.xml
+++ b/package.xml
@@ -53,6 +53,7 @@ Available functions:
<file name="005-rpminfo-full.phpt" role="test"/>
<file name="006-rpminfo-errors.phpt" role="test"/>
<file name="007-rpmdbinfo.phpt" role="test"/>
+ <file name="008-rpmdbinfo2.phpt" role="test"/>
<file name="bidon.rpm" role="test"/>
<file name="bidon-src.rpm" role="test"/>
</dir>
diff --git a/rpminfo.c b/rpminfo.c
index fdf9d93..f20d605 100644
--- a/rpminfo.c
+++ b/rpminfo.c
@@ -275,7 +275,7 @@ PHP_FUNCTION(rpmdbinfo)
di = rpmdbInitIterator(db, RPMTAG_NAME, name, len);
}
if (!di) {
- php_error_docref(NULL, E_WARNING, "Can't open rpmdb");
+ // Not found
rpmtsCloseDB(ts);
RETURN_FALSE;
}
diff --git a/tests/008-rpmdbinfo2.phpt b/tests/008-rpmdbinfo2.phpt
new file mode 100644
index 0000000..940ad61
--- /dev/null
+++ b/tests/008-rpmdbinfo2.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Check for rpmdbinfo function
+--SKIPIF--
+<?php if (!extension_loaded("rpminfo")) print "skip"; ?>
+--FILE--
+<?php
+$a = rpmdbinfo('php*', false, RPM_MATCH_GLOB);
+var_dump(count($a) > 1);
+$a = rpmdbinfo('^php', false, RPM_MATCH_REGEX);
+var_dump(count($a) > 1);
+?>
+Done
+--EXPECTF--
+bool(true)
+bool(true)
+Done